Skip to content

docs: add summary documentation on credentials types and improve YARD comments#530

Merged
viacheslav-rostovtsev merged 2 commits into
googleapis:mainfrom
viacheslav-rostovtsev:dev/virost/refocus
Mar 20, 2025
Merged

docs: add summary documentation on credentials types and improve YARD comments#530
viacheslav-rostovtsev merged 2 commits into
googleapis:mainfrom
viacheslav-rostovtsev:dev/virost/refocus

Conversation

@viacheslav-rostovtsev
Copy link
Copy Markdown
Member

This PR adds a principal getter to credentials. The principal is safe to log and is implemented as follows:

  1. APIKeyCredentials - returns :api_key
  2. BearerTokenCredentials - returns :bearer_token
  3. GCECredentials - returns :gce_metadata
  4. IAMCredentials - returns the selector
  5. ServiceAccountCredentials - returns the service account email (issuer)
  6. ServiceAccountJwtHeaderCredentials - returns the service account email (issuer)
  7. ImpersonatedServiceAccountCredentials - returns the source principal when available, or :unknown
  8. UserRefreshCredentials - returns client_id or falls back to :user_refresh
  9. UserAuthorizer - returns the client ID
  10. ExternalAccount::BaseCredentials - returns the audience

Also added a Credentials.md documenting the available credentials.

There are also minor doc and comment improvements along the way.
This is to be used in the error details work, to reduce the size of upcoming PR.

@dazuma
Copy link
Copy Markdown
Contributor

dazuma commented Mar 18, 2025

Make sure you update the conventional commit tag before merging.

@viacheslav-rostovtsev viacheslav-rostovtsev changed the title feat: add principal to the credential types docs: add summary documentation on credentials types and improve YARD comments Mar 20, 2025
@viacheslav-rostovtsev viacheslav-rostovtsev merged commit 5437b70 into googleapis:main Mar 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants