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

marshaling/json export feature? #688

Open
Jordan-Mesches opened this issue Feb 8, 2021 · 1 comment
Open

marshaling/json export feature? #688

Jordan-Mesches opened this issue Feb 8, 2021 · 1 comment
Labels
type: question Request for information or clarification. Not an issue.

Comments

@Jordan-Mesches
Copy link

I'm currently using AWS lambda, and I'm trying to use this library to interact with some gsuite products. So naturally I want to split up different parts of my project as to embrace micro service architecture that comes with lambda. So here comes my problem, I want to have a Authenticator lambda that can return Authentication to other lambdas, however when using service_account_creds.with_subject(admin-email) it returns a google.oauth2.service_account.Credentialsobject. Now this is great however I'm not able to return this in my lambda, and my attempts at marshaling it myself have failed. So it'd be great if their was a feature to either Marshall the object, or like export it to Json or something like that.

Also if does already exist sorry, I was unable to find it anywhere.

Originally posted by @Jordan-Mesches in googleapis/google-api-python-client#1178

@Jordan-Mesches Jordan-Mesches changed the title I'm currently using AWS lambda, and I'm trying to use this library to interact with some gsuite products. So naturally I want to split up different parts of my project as to embrace micro service architecture that comes with lambda. So here comes my problem, I want to have a Authenticator lambda that can return Authentication to other lambdas, however when using service_account_creds.with_subject(admin-email) it returns a google.oauth2.service_account.Credentialsobject. Now this is great however I'm not able to return this in my lambda, and my attempts at marshaling it myself have failed. So it'd be great if their was a feature to either Marshall the object, or like export it to Json or something like that. marshaling/json export feature? Feb 8, 2021
@busunkim96 busunkim96 transferred this issue from googleapis/google-cloud-python Feb 9, 2021
@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Feb 9, 2021
@busunkim96
Copy link
Contributor

Hi,

The library doesn't provide a way to export the service account credentials. If you want to re-create the service account you would need the original service account JSON object downloaded from https://console.cloud.google.com. https://googleapis.dev/python/google-auth/latest/reference/google.oauth2.service_account.html#google.oauth2.service_account.Credentials

@arithmetic1728 Could you advise if there'a a better way to accomplish what @Jordan-Mesches is looking to do?

@busunkim96 busunkim96 added type: question Request for information or clarification. Not an issue. and removed triage me I really want to be triaged. labels Feb 9, 2021
@yoshi-automation yoshi-automation added triage me I really want to be triaged. and removed triage me I really want to be triaged. labels Feb 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

3 participants