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.
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.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
mint
command
Command mint prints a standard RFC 7519 HS256 JWT to stdout, signed with the supplied shared secret, so non-Go test stacks (pytest/PyJWT, curl, etc.) can obtain a harness-minted token without linking any Go code.
|
Command mint prints a standard RFC 7519 HS256 JWT to stdout, signed with the supplied shared secret, so non-Go test stacks (pytest/PyJWT, curl, etc.) can obtain a harness-minted token without linking any Go code. |
Click to show internal directories.
Click to hide internal directories.