infisical icon indicating copy to clipboard operation
infisical copied to clipboard

Infisical SDKs for each language.

Open dangtony98 opened this issue 2 years ago • 8 comments

Feature description

Currently, the way to load environment variables into an Infisical app is to do so via CLI. With docker, users typically embed the CLI into containers and have the CLI use the token to fetch back secrets and inject them into the containers; without docker, the story is similar with all fetching and injection functionality done via CLI.

AWS has its own SDK. Azure has its own SDK.

It would be great to have language-specific SDKs across Node.js, Python, Ruby, Go, etc. that users can easily install into their apps and pull back environment variables that way.

Why would it be useful?

It would be useful because perhaps people don't want to embed a CLI into their docker images or maybe they don't want to have users install the CLI at all; they might want it as a separate npm package that comes easily installable for a team. Ultimately, this initiative is about increasing access to interacting with secrets on Infisical.

Additional context

If this sounds interesting, hit me up or contact me over in the Slack community.

dangtony98 avatar Feb 09 '23 11:02 dangtony98

Wow, that's interesting. I thought it would be nice to have something related to SDK, so I came into the issue and it's interesting.

If possible, I'd like to participate.

mdjoo0810 avatar Feb 14 '23 07:02 mdjoo0810

That'd be awesome! Which language are you familiar with? I think the most impactful languages for SDK would be Javascript and Python to start as a lot of people have asked for it

maidul98 avatar Feb 14 '23 07:02 maidul98

I'd love to kickstart the "frame" for the Node SDK since I worked on the initial version of the node-based CLI before and know the crypto.

@mdjoo0810 let me know which language you'd want to work on — Happy to jam on this :D

dangtony98 avatar Feb 14 '23 07:02 dangtony98

I usually use Go and Kotlin(w. Java), but I think Javascript is also possible :smile:

mdjoo0810 avatar Feb 14 '23 07:02 mdjoo0810

Ooo awesome. Would you wanna tackle the Java SDK?

Also not sure if you've joined our community Slack yet here but it'd be great if you could hop in there; we can discuss with @maidul98 as well.

dangtony98 avatar Feb 14 '23 07:02 dangtony98

I think java can contribute even more! it would be good to join in the slack community and talk about the details

mdjoo0810 avatar Feb 14 '23 08:02 mdjoo0810

Yeah that'd be great!

@mdjoo0810 Feel free to ping me in Slack when you do join - We can discuss :)

dangtony98 avatar Feb 14 '23 16:02 dangtony98

One thing to look into: https://github.com/aws/jsii

It supports a bunch of languages out of the box and would simplify development and upkeep.

vladzaharia avatar Feb 28 '23 04:02 vladzaharia

Hello! Being recently interested in Infisical and its possible use in my company, I had already started in my corner a python equivalent for the retrieval of secrets via service token. I find the CLI handy for local manipulations but less so for integration into the production environment with complex situations like using gunicorn to create python workers (so not directly starting a python process that can receive the env vars from the CLI).

I share the repository with you: https://github.com/Astropilot/infisicalpy

For now I just implemented the equivalent of the infisical run command for secret retrieval:

from infisicalpy import SecretService

secret_service = SecretService(token="YOUR_SERVICE_TOKEN")

secrets = secret_service.get_all(expand=True, secret_overriding=True, tags=[])

But I thought it could be interesting to propose a wrapper around the API which is in my roadmap!

I will surely come on the Slack by Monday to participate to the discussion, I think that the ideal would be to have a common interface if several SDK for different languages are proposed (if possible)!

Astropilot avatar Mar 03 '23 16:03 Astropilot

@Astropilot this is amazing. We are currently working on also allowing service tokens to have write access, so soon you can also write using the service token in the SDK. Do join our slack if you haven't https://infisical.com/slack

CC: @dangtony98

maidul98 avatar Mar 03 '23 16:03 maidul98

@Astropilot Wow this is incredible — I love the initiative taken here!

I did start a infisical-node repository but it's still a work in progress and not yet suitable for production.

It'd be great to have you pop into the Slack to discuss how to best standardize the SDKs!

dangtony98 avatar Mar 04 '23 13:03 dangtony98

Closing this issue in favor of separate issues for each language SDK!

dangtony98 avatar Mar 15 '23 10:03 dangtony98