Documentation
¶
Overview ¶
Package requestctx defines typed request context values shared by the server middleware and HTTP controllers.
Index ¶
- func GetAPIKey(ctx context.Context) (string, bool)
- func GetAPIKeyID(ctx context.Context) (string, bool)
- func GetAPIKeyModel(ctx context.Context) (*identity.APIKey, bool)
- func WithAPIKey(ctx context.Context, value string) context.Context
- func WithAPIKeyID(ctx context.Context, value string) context.Context
- func WithAPIKeyModel(ctx context.Context, value *identity.APIKey) context.Context
- type Key
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAPIKeyID ¶
GetAPIKeyID returns the API key ID from the context.
func GetAPIKeyModel ¶
GetAPIKeyModel returns the API key model from the context.
func WithAPIKey ¶
WithAPIKey stores the raw API key in the context.
func WithAPIKeyID ¶
WithAPIKeyID stores the API key ID in the context.
Types ¶
type Key ¶
type Key string
Key is the typed context key used for server request metadata.
const ( // APIKey stores the raw API key for downstream provider-key lookups. APIKey Key = "api_key" // APIKeyID stores the authenticated Starport API key ID. APIKeyID Key = "api_key_id" // APIKeyModel stores the authenticated API key model. APIKeyModel Key = "api_key_model" // #nosec G101 - context key name, not a credential. )
Click to show internal directories.
Click to hide internal directories.