Documentation
¶
Overview ¶
Package harness provides RBAC/ABAC test helpers for downstream services that consume the generated API. It builds signed HS256 tokens with chosen roles, scopes, and attributes and the matching bearer headers so handler authorization can be exercised in unit and integration tests. Code generated by apic; DO NOT EDIT.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BearerHeader ¶
BearerHeader returns a standard Authorization header value.
Types ¶
type JWTClaims ¶
type JWTClaims struct {
Subject string `json:"sub,omitempty"`
Roles []string `json:"roles,omitempty"`
Scopes []string `json:"scopes,omitempty"`
Attributes map[string]string `json:"attributes,omitempty"`
IssuedAt int64 `json:"iat,omitempty"`
NotBefore int64 `json:"nbf,omitempty"`
ExpiresAt int64 `json:"exp,omitempty"`
}
JWTClaims is a minimal claim-set used by auth tests.
Click to show internal directories.
Click to hide internal directories.