Documentation
¶
Overview ¶
internal/auth/token.go
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BearerToken ¶
BearerToken formats a JWT as a Bearer auth header value.
func EmptyProto ¶
EmptyProto returns a commonv1.Empty message (convenience).
func GetPATOnce ¶
func GetPATOnce() string
GetPATOnce returns NWEB_API_KEY without storing it anywhere. Only for auth commands that explicitly manage PATs.
Types ¶
type Claims ¶ added in v0.16.0
type Claims struct {
Sub string `json:"sub"`
WorkspaceID string `json:"nweb:workspace_id"`
SourcePatID string `json:"nweb:source_pat_id"`
Exp int64 `json:"exp"`
}
Claims holds the subset of JWT payload fields used by the CLI.
func ParseClaims ¶ added in v0.16.0
ParseClaims decodes the payload segment of a JWT without verifying the signature.
type Resolver ¶
type Resolver struct {
Profile config.Profile
ProfileName string
WorkspaceID string // flag override
NoPersist bool
ConfigPath string
Insecure bool
// OnTokenRefreshed is called after a successful PAT exchange.
OnTokenRefreshed func(jwt string, expiresAt time.Time, workspaceID string)
}
Resolver resolves a valid JWT for API calls.
Click to show internal directories.
Click to hide internal directories.