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

feat(bom): read application default creds if available #794

Merged
merged 1 commit into from
Jan 12, 2018

Conversation

lwander
Copy link
Member

@lwander lwander commented Jan 4, 2018

No description provided.

Copy link

@ewiseblatt ewiseblatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this.

requestInitializer = GoogleCredentials.setHttpTimeout(GoogleCredential.getApplicationDefault());
log.info("Loaded application default credential for reading BOMs & profiles.");
} catch (Exception e) {
requestInitializer = GoogleCredentials.retryRequestInitializer();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because credentials are not normally required in a standard use case scenario, the message details are probably distracting -- at least if they are because there no credentials. If the error is a problem with actual supplied credentials then that would be interesting.

Copy link
Member Author

@lwander lwander Jan 4, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's fair - I added this since I thought you might find it useful when getting started, especially because there will be no other indication (other than a 401 when trying to read) that your creds may not have been loaded. Is that OK?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

your call. I'm not sure of the context of this call. I assumed that the generated exception would be different if you did not have credentials vs if they were invalid. For example if you arent on GCP and dont have the environment variable set then I dont think the exception message would be useful and unlikely relevant.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

relegated to log.debug

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