MCPcopy
hub / github.com/autobrr/qui / ValidateKey

Method ValidateKey

internal/models/client_api_key.go:156–159  ·  view source on GitHub ↗
(ctx context.Context, rawKey string)

Source from the content-addressed store, hash-verified

154}
155
156func (s *ClientAPIKeyStore) ValidateKey(ctx context.Context, rawKey string) (*ClientAPIKey, error) {
157 keyHash := HashAPIKey(rawKey)
158 return s.GetByKeyHash(ctx, keyHash)
159}
160
161func (s *ClientAPIKeyStore) UpdateLastUsed(ctx context.Context, keyHash string) error {
162 tx, err := s.db.BeginTx(ctx, nil)

Callers 1

ClientAPIKeyMiddlewareFunction · 0.80

Calls 2

GetByKeyHashMethod · 0.95
HashAPIKeyFunction · 0.85

Tested by

no test coverage detected