Protect what matters – even after you're gone. Make a plan for your digital legacy today.
Forum Discussion
simonbs
3 months agoNew Contributor
.env files should support more file formats
Hey, I was incredibly excited to see the 1Password beta supporting .env files. After testing it out in the latest beta, I understand that this is incredibly useful for environments that support trad...
simonbs
3 months agoNew Contributor
From your note, it sounds like the request is to output different types of files that could be defined by a template and then the Environments feature would replace the secrets (like you mentioned like 'op inject' does from the command prompt)
Yep, exactly. I think of the new .env support as writing secrets to a traditional .env template, but it could just as well be any other template, for example, one where secrets are written to a .swift file. If the .env feature of 1Password allowed us to supply our own template, similar to `op inject`, then this problem would be solved.
I'd love to test the flow you suggest, but I'm not sure I follow it. Here's what I've gathered so far:
- I think your bullet no. 1 is the `enum Secrets { ... }` that I have in my original post.
- In #2 I create an environment in 1Password with my secrets.
However, from there, I'm unsure what to do. What's my destination in #3, and how do the secrets end up in my .swift file so I can access them at runtime in my app?
1P_Phil
Moderator
3 months agoHi simonbs ,
Thanks for the continued input, I was thinking about this over last night, perhaps you could have a Production Environment flow using the AWS Secrets Sync outlet for your production app whereby the environment gets pushed up to AWS and then you access the secrets from the the production app through an API request.
If you have AWS as a backend, there are Swift APIs you can use to access the AWS Secret Manager.
Thanks,
Phil