Skip to content

Treat "expired certs" errors returned from RPCs as retryable on the client side#38668

Merged
gzdunek merged 3 commits intomasterfrom
gzdunek/handle-remote-expired-certs
Feb 27, 2024
Merged

Treat "expired certs" errors returned from RPCs as retryable on the client side#38668
gzdunek merged 3 commits intomasterfrom
gzdunek/handle-remote-expired-certs

Conversation

@gzdunek
Copy link
Copy Markdown
Contributor

@gzdunek gzdunek commented Feb 27, 2024

Since Connect will no longer check the user cert before making an RPC, it has to be able to properly recognize "expired certs" errors that come from the server (to show a re-login dialog).
To make it work, I added an exception for the two errors IsErrorResolvableWithRelogin. Ideally, we should just return a "returnable" error directly from the client as described by Alan, but this sounds like a big task, beyond the scope of caching clients in Connect.

Depends on #38202.

@gzdunek gzdunek marked this pull request as ready for review February 27, 2024 13:24
@github-actions
Copy link
Copy Markdown
Contributor

The PR changelog entry failed validation: Changelog entry not found in the PR body. Please add a "no-changelog" label to the PR, or changelog lines starting with changelog: followed by the changelog entries for the PR.

@github-actions github-actions Bot requested review from mdwn and probakowski February 27, 2024 13:24
@gzdunek gzdunek added the no-changelog Indicates that a PR does not require a changelog entry label Feb 27, 2024
Copy link
Copy Markdown
Contributor

@codingllama codingllama left a comment

Choose a reason for hiding this comment

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

I appreciate you using the "guard" error instead of just matching strings for both, that is already a bit better.

Comment thread lib/auth/auth_with_roles.go Outdated
Comment thread lib/utils/utils.go Outdated
Comment thread lib/utils/utils.go Outdated
@codingllama
Copy link
Copy Markdown
Contributor

(Also I approved a bit quickly, please address the comments.)

Copy link
Copy Markdown
Member

@ravicious ravicious left a comment

Choose a reason for hiding this comment

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

I feel like this change can be merged alone, without waiting for the parent PR. The change in lib/teleterm/apiserver/middleware.go could be accounted for in #38202 itself.

@gzdunek
Copy link
Copy Markdown
Contributor Author

gzdunek commented Feb 27, 2024

Good point, @ravicious. I will merge this PR to master, the git history will be cleaner.

@gzdunek gzdunek force-pushed the gzdunek/handle-remote-expired-certs branch from 5dc6087 to dd93596 Compare February 27, 2024 15:39
@gzdunek gzdunek changed the base branch from gzdunek/use-cached-remote-client to master February 27, 2024 15:39
@gzdunek gzdunek changed the title Handle "expired certs" errors that come from the server Handle "expired certs" errors returned from RPCs on the client side Feb 27, 2024
@gzdunek gzdunek enabled auto-merge February 27, 2024 15:42
@gzdunek gzdunek changed the title Handle "expired certs" errors returned from RPCs on the client side Treat "expired certs" errors returned from RPCs as retryable on the client side Feb 27, 2024
@github-actions
Copy link
Copy Markdown
Contributor

🤖 Vercel preview here: https://docs-qrnxua97e-goteleport.vercel.app/docs/ver/preview

@gzdunek gzdunek added this pull request to the merge queue Feb 27, 2024
Merged via the queue into master with commit 54e331a Feb 27, 2024
@gzdunek gzdunek deleted the gzdunek/handle-remote-expired-certs branch February 27, 2024 16:42
@public-teleport-github-review-bot
Copy link
Copy Markdown

@gzdunek See the table below for backport results.

Branch Result
branch/v15 Create PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog Indicates that a PR does not require a changelog entry size/sm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants