Conversation
before trying to get a managed token, perform a check to see if the endpoint is available. this times out significantly quicker than the get_managed_token function, and caches the result in an environment variable for future use
There was a problem hiding this comment.
Pull request overview
This PR adds a fast “IMDS available” probe before attempting managed-identity authentication, aiming to avoid the longer timeout path when running outside Azure and to cache the result for subsequent calls.
Changes:
- Gate the managed-token attempt in
get_auth_token()behind a newimds_available()check. - Introduce
imds_available()(with generated documentation) that probes the IMDS/MSI endpoint and caches the result inIMDS_AVAILABLE. - Minor formatting alignment in the
get_auth_token()examples/docs.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
R/get_auth_token.R |
Adds imds_available() and uses it to gate managed-token retrieval in get_auth_token(). |
man/imds_available.Rd |
New documentation page for imds_available(). |
man/get_auth_token.Rd |
Example indentation/formatting adjustment. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
francisbarton
left a comment
There was a problem hiding this comment.
Please can you have a think about the comment - I'm not demanding a change but it might make sense to add in a defensive line somewhere.
|
Thanks! |
|
@francisbarton I've switched from |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
before trying to get a managed token, perform a check to see if the endpoint is available. this times out significantly quicker than the get_managed_token function, and caches the result in an environment variable for future use