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

[Secret Manager] Secret Manager Integration #58

Closed
anovis opened this issue May 21, 2021 · 7 comments · Fixed by #141
Closed

[Secret Manager] Secret Manager Integration #58

anovis opened this issue May 21, 2021 · 7 comments · Fixed by #141
Labels
proposal Proposal for a new feature in Goblet

Comments

@anovis
Copy link
Collaborator

anovis commented May 21, 2021

A built in integration with Secret Manager to inject secrets into cloudfunctions. Currently the options are to supply env variable, or to write the secret manager logic yourself.

example config.json

"secrets": {
  "GH_TOKEN": projects/{project_id}/secrets/GH_TOKEN/versions/2",
  "OTHER_TOKEN"
}

with default being projects/{project_id}/secrets/{secret_name}/versions/latest

then in your code you would use config.secrets to access

from goblet.config import Config

config = Config()
@app.route("/reveal")
def reveal_secret():
    return config.secrets.GH_TOKEN
@anovis anovis added the proposal Proposal for a new feature in Goblet label May 21, 2021
@anovis
Copy link
Collaborator Author

anovis commented Sep 29, 2021

looks like gcp support secret manager integration in preview

https://cloud.google.com/blog/products/serverless/cloud-functions-integrates-with-google-secret-manager

should have a beta flag where we can enable some of these features.

@anovis
Copy link
Collaborator Author

anovis commented Nov 16, 2021

looks like it is only supported for gcloud cli and the console for now. will continue to monitor for the v1beta api to include this feature

@aebrahim
Copy link

FYI googleapis/python-functions#130

@anovis
Copy link
Collaborator Author

anovis commented Nov 17, 2021

interesting. goblet actually calls the rest api directly via https://cloud.google.com/functions/docs/reference/rest, so i am wondering if there is another library that handles the secret volumes .

their docs only show console and gcloud https://cloud.google.com/functions/docs/configuring/secrets#making_a_secret_accessible_to_a_function

@amirbtb
Copy link

amirbtb commented Jan 29, 2022

Secrets in Cloud Functions are finally in GA 🥳
GCP Release Notes
But it looks like their docs is still only showing console and gcloud..

@anovis
Copy link
Collaborator Author

anovis commented Jan 29, 2022

Interestingly, goblet supports secrets already with the cloudrun backend since we actually use a gcloud command behind the scenes to build and deploy the container.

will continue to look into secret support for the cloudfunction backend

@anovis
Copy link
Collaborator Author

anovis commented Feb 15, 2022

looks like secrets are added to v1 endpoints now https://cloud.google.com/functions/docs/reference/rest/v1/projects.locations.functions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal Proposal for a new feature in Goblet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants