MCPcopy Create free account
hub / github.com/astercloud/aster / Authenticate

Method Authenticate

server/auth/apikey.go:57–64  ·  view source on GitHub ↗

Authenticate 验证 API Key

(ctx context.Context, credentials any)

Source from the content-addressed store, hash-verified

55
56// Authenticate 验证 API Key
57func (a *APIKeyAuthenticator) Authenticate(ctx context.Context, credentials any) (*User, error) {
58 key, ok := credentials.(string)
59 if !ok {
60 return nil, ErrInvalidCredentials
61 }
62
63 return a.Validate(ctx, key)
64}
65
66// Validate 验证 API Key 并返回用户信息
67func (a *APIKeyAuthenticator) Validate(ctx context.Context, key string) (*User, error) {

Callers

nothing calls this directly

Calls 1

ValidateMethod · 0.95

Tested by

no test coverage detected