MCPcopy Create free account
hub / github.com/bytebase/bytebase / DeleteOAuth2RefreshToken

Method DeleteOAuth2RefreshToken

backend/store/oauth2_refresh_token.go:73–88  ·  view source on GitHub ↗
(ctx context.Context, clientID, tokenHash string)

Source from the content-addressed store, hash-verified

71}
72
73func (s *Store) DeleteOAuth2RefreshToken(ctx context.Context, clientID, tokenHash string) error {
74 q := qb.Q().Space(`
75 DELETE FROM oauth2_refresh_token
76 WHERE token_hash = ? AND client_id = ?
77 `, tokenHash, clientID)
78
79 query, args, err := q.ToSQL()
80 if err != nil {
81 return err
82 }
83
84 if _, err := s.GetDB().ExecContext(ctx, query, args...); err != nil {
85 return errors.Wrap(err, "failed to delete OAuth2 refresh token")
86 }
87 return nil
88}
89
90func (s *Store) DeleteOAuth2RefreshTokensByUserAndClient(ctx context.Context, userEmail, clientID string) error {
91 q := qb.Q().Space(`

Callers 2

handleRevokeMethod · 0.80

Calls 4

GetDBMethod · 0.95
QFunction · 0.92
SpaceMethod · 0.80
ToSQLMethod · 0.80

Tested by

no test coverage detected