MCPcopy Index your code
hub / github.com/coder/coder / UpdateExternalAuthLinkRefreshToken

Method UpdateExternalAuthLinkRefreshToken

coderd/database/querier.go:1260–1260  ·  view source on GitHub ↗

Optimistic lock: only update the row if the refresh token in the database still matches the one we read before attempting the refresh. This prevents a concurrent caller that lost a token-refresh race from overwriting a valid token stored by the winner.

(ctx context.Context, arg UpdateExternalAuthLinkRefreshTokenParams)

Source from the content-addressed store, hash-verified

1258 // a concurrent caller that lost a token-refresh race from overwriting a valid
1259 // token stored by the winner.
1260 UpdateExternalAuthLinkRefreshToken(ctx context.Context, arg UpdateExternalAuthLinkRefreshTokenParams) error
1261 UpdateGitSSHKey(ctx context.Context, arg UpdateGitSSHKeyParams) (GitSSHKey, error)
1262 UpdateGroupByID(ctx context.Context, arg UpdateGroupByIDParams) (Group, error)
1263 UpdateInactiveUsersToDormant(ctx context.Context, arg UpdateInactiveUsersToDormantParams) ([]UpdateInactiveUsersToDormantRow, error)

Callers 6

TestUserMethod · 0.65
TestRefreshTokenFunction · 0.65
RefreshTokenMethod · 0.65
TestUserLinksFunction · 0.65

Implementers 5

sqlQueriercoderd/database/db.go
queryMetricsStorecoderd/database/dbmetrics/querymetrics
queriercoderd/database/dbauthz/dbauthz.go
MockStorecoderd/database/dbmock/dbmock.go
MockStoreMockRecordercoderd/database/dbmock/dbmock.go

Calls

no outgoing calls

Tested by 3

TestUserMethod · 0.52
TestRefreshTokenFunction · 0.52
TestUserLinksFunction · 0.52