MCPcopy Create free account
hub / github.com/allfro/traefikr / MaskKey

Method MaskKey

backend/models/api_key.go:29–34  ·  view source on GitHub ↗

MaskKey returns the first 8 characters followed by ellipsis

()

Source from the content-addressed store, hash-verified

27
28// MaskKey returns the first 8 characters followed by ellipsis
29func (k *APIKey) MaskKey() string {
30 if len(k.Key) <= 8 {
31 return k.Key[:len(k.Key)] + "..."
32 }
33 return k.Key[:8] + "..."
34}
35
36// ToResponse converts APIKey to APIKeyResponse with masked key
37func (k *APIKey) ToResponse() APIKeyResponse {

Callers 1

ToResponseMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected