Skip to content

📝 Address Copilot review comments on PR #38#39

Merged
HanXHX merged 1 commit into
masterfrom
fix_auth2
May 14, 2026
Merged

📝 Address Copilot review comments on PR #38#39
HanXHX merged 1 commit into
masterfrom
fix_auth2

Conversation

@HanXHX
Copy link
Copy Markdown
Contributor

@HanXHX HanXHX commented May 14, 2026

  • Fix misleading comment on fetchOIDCCached concurrency (C1)
  • Document that returned OIDCConfig pointer must not be mutated (C2)
  • Skip server-side revocation in Logout when baseURL is empty, avoiding a noisy second warning after a config load failure (C3)
  • Update GetValidToken docstring to document the RETYC_TOKEN fallback-to-disk behaviour, and emit a warning to stderr when the fall-through actually triggers (C4)

- Fix misleading comment on fetchOIDCCached concurrency (C1)
- Document that returned OIDCConfig pointer must not be mutated (C2)
- Skip server-side revocation in Logout when baseURL is empty,
  avoiding a noisy second warning after a config load failure (C3)
- Update GetValidToken docstring to document the RETYC_TOKEN
  fallback-to-disk behaviour, and emit a warning to stderr when
  the fall-through actually triggers (C4)
Copilot AI review requested due to automatic review settings May 14, 2026 07:54
@HanXHX HanXHX merged commit 2947a5c into master May 14, 2026
4 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the auth/OIDC flow to address prior review comments by clarifying concurrency semantics and improving user-facing behavior around logout and token selection (env token vs disk token).

Changes:

  • Clarifies fetchOIDCCached concurrency expectations and documents that the returned *OIDCConfig must not be mutated.
  • Avoids attempting server-side session revocation during Logout when baseURL is empty.
  • Documents RETYC_TOKEN fallback-to-disk behavior in GetValidToken and emits a warning when fallback is triggered.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
internal/service/auth.go Updates cached OIDC config documentation and adjusts logout revocation behavior when baseURL is empty.
internal/auth/oidc.go Expands GetValidToken documentation and adds a stderr warning when RETYC_TOKEN is invalid and the code falls back to disk token logic.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/service/auth.go
Comment on lines 203 to 206
tok, lerr := config.LoadToken()
if lerr == nil && tok.RefreshToken != "" {
if lerr == nil && tok.RefreshToken != "" && baseURL != "" {
oidcCfg, oerr := fetchOIDCCached(ctx, baseURL, httpClient)
if oerr != nil {
Comment thread internal/auth/oidc.go
Comment on lines 381 to +385
if !errors.Is(err, ErrNoRefreshToken) {
return nil, fmt.Errorf("RETYC_TOKEN refresh failed: %w", err)
}
// ErrNoRefreshToken (invalid_grant): fall through to disk token.
fmt.Fprintf(os.Stderr, "warning: RETYC_TOKEN is expired or revoked, falling back to stored disk token\n")
// Fall through to the disk token path below.
@HanXHX HanXHX deleted the fix_auth2 branch May 15, 2026 16:09
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.

2 participants