Skip to content

feat(catalog): refresh oauth tokens#793

Merged
zeroshade merged 1 commit intoapache:mainfrom
rockwotj:refresh
Mar 18, 2026
Merged

feat(catalog): refresh oauth tokens#793
zeroshade merged 1 commit intoapache:mainfrom
rockwotj:refresh

Conversation

@rockwotj
Copy link
Contributor

@rockwotj rockwotj commented Mar 17, 2026

The rest catalog was using a fixed token for the lifetime of the
catalog. We need to refresh the token when the oauth server gives us an
expiration. This means the credential fetch needs to move into the
roundtripper. Also, since we use the same http client for refreshing and
making catalog requests, we add a context key to prevent recursion.

Fixes: #794

@rockwotj rockwotj mentioned this pull request Mar 17, 2026
The rest catalog was using a fixed token for the lifetime of the
catalog. We need to refresh the token when the oauth server gives us an
expiration. This means the credential fetch needs to move into the
roundtripper. Also, since we use the same http client for refreshing and
making catalog requests, we add a context key to prevent recursion.

var capturedAuthHeader string
mux.HandleFunc("/v1/namespaces", func(w http.ResponseWriter, r *http.Request) {
capturedAuthHeader = r.Header.Get("Authorization")
Copy link
Member

Choose a reason for hiding this comment

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

should we assert the authorization is what we expect here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we assert it down below, this just captures

@zeroshade zeroshade changed the title rest: refresh oauth tokens feat(catalog): refresh oauth tokens Mar 18, 2026
@rockwotj rockwotj requested a review from zeroshade March 18, 2026 19:03
@zeroshade zeroshade merged commit 6842055 into apache:main Mar 18, 2026
13 checks passed
@rockwotj rockwotj deleted the refresh branch March 18, 2026 19:46
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.

Refresh oauth tokens

2 participants