Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing multiline values into --set #33

Open
liamnichols opened this issue Jun 26, 2023 · 2 comments
Open

Passing multiline values into --set #33

liamnichols opened this issue Jun 26, 2023 · 2 comments

Comments

@liamnichols
Copy link

Background

I want to use envchain within our mobile team to store the App Store Connect API key credentials, which consist of an issuer id, key id and .p8 key file.

For simplicity and security, we already hold the .p8 file contents in secrets on Bitrise and since we need to run some operations locally, it feels like it would be appropriate to do this as well using envchain.

Problem

The problem that I faced however was that I couldn't get the multiline string to work with envchain --set.

If i try pasting it, only the first line is accepted. I also tried something like the following:

$ cat /path/to/key.p8 | envchain --set asc APP_STORE_CONNECT_API_KEY_KEY

But the same issue, only the first line is written.

Workaround

I can open the Keychain Access app and paste the multiline string in there, but it would be great if this could be avoided.

I'm sorry that I can't open a Pull Request directly for this, I am not very good with C 😄

@sorah
Copy link
Owner

sorah commented Jun 26, 2023

I can open the Keychain Access app and paste the multiline string in there, but it would be great if this could be avoided.

Yes this is a current restriction and valid workaround to deal with multiline strings...

@liamnichols
Copy link
Author

Thanks for confirming @sorah! In the end I was able to use the security command directly to automate it a bit better:

$ security add-generic-password -c appl -D envchain -s envchain-asc -a APP_STORE_CONNECT_API_KEY_KEY -w "$(cat /path/to/AuthKey_FFFFFFFFFFF.p8)"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants