fix(db_perform_request/response): refresh bearer token manually with margin - #254
Closed
max607 wants to merge 1 commit into
Closed
fix(db_perform_request/response): refresh bearer token manually with margin#254max607 wants to merge 1 commit into
max607 wants to merge 1 commit into
Conversation
Contributor
|
I think this would be easier if httr2 would introduce a buffer param for the expiry time since other use-cases might hit the same issue. |
Collaborator
|
I'm inclined to agree with @m-muecke, this is a slightly annoying behaviour from Databricks API side that is a bit clunky to handle. I'll have a think and review again early next week and assess if it is something httr2 is open to merging. |
Collaborator
|
This is now tracked upstream in httr2:
The proposed fix adds a configurable OAuth expiry margin, allowing brickster to refresh tokens early without clearing httr2 private cache state. |
Collaborator
|
Now that r-lib/httr2#861 is merged, I'll address this in a separate PR as soon as it reaches CRAN and can update dependencies version + code. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Databricks API rejects tokens that will expire in <30s with the error 403 "Token is expiring within 30 seconds. (token expired)". This results in an error as httr2 only refreshes expired tokens.
This issue is similar, e.g., to this PR for the Databricks SDK in Go.