docs(auth): improve signer docs#4180
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4180 +/- ##
==========================================
- Coverage 94.76% 94.75% -0.02%
==========================================
Files 186 186
Lines 7068 7068
==========================================
- Hits 6698 6697 -1
- Misses 370 371 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
dbolduc
left a comment
There was a problem hiding this comment.
Feel free to overrule me on showing how to create signers from service account key json directly.
I just thought Google Cloud did not like people downloading those. But if it is the way to do performant signing in practice, your example would be relevant to the top-level doc.
| //! # } | ||
| //! ``` | ||
| //! | ||
| //! ## Example: Creating a Signer using a Service Account Key File |
There was a problem hiding this comment.
I thought we want to discourage people from downloading these
src/auth/src/signer.rs
Outdated
| //! | ||
| //! ## Example: Creating a Signer using Application Default Credentials (ADC) | ||
| //! | ||
| //! This is the recommended way for most applications. It automatically finds credentials from the environment. |
There was a problem hiding this comment.
Maybe add that "If your ADC are [service account credentials], the signing will be local and not make any network requests. This can be useful in environments where network access is restricted and performance is critical."
Then we might not need the next section?
Maybe. Your call.
There was a problem hiding this comment.
If you remove the other section, this could just be:
Applications can use their Application Default Credentials (ADC) to create a signer.
If your ADC are [service account credentials], the signing will be local and not
make any network requests. This can be useful in environments where network access
is restricted and performance is critical.
# Example
// blah blah blah
// let signer = Builder::default().build_signer()?;
// blah blah blah
dbolduc
left a comment
There was a problem hiding this comment.
This PR is an obvious improvement to the docs. Feel free to merge and address any of my nits in a follow up
Towards #3645