Documentation
¶
Index ¶
Constants ¶
View Source
const ( UserAudience = "user-auth.chainloop" APIAudience = "api-token-auth.chainloop" )
Variables ¶
This section is empty.
Functions ¶
func MismatchedOrganization ¶ added in v1.119.0
MismatchedOrganization returns the API token's organization when it differs from the selected organization. A missing organization claim is allowed: instance-admin tokens intentionally use the organization header.
Types ¶
type ParsedToken ¶
type ParsedToken struct {
ID string
OrgID string
OrgName string
TokenType v1.Attestation_Auth_AuthType
}
func Parse ¶
func Parse(token string) (*ParsedToken, error)
Parse the token and return the type of token. At the moment in Chainloop we have 3 types of tokens: 1. User account token 2. API token 3. Federated token Each one of them have an associated audience claim that we use to identify the type of token. If the token is not present, nor we cannot match it with one of the expected audience, return nil.
Click to show internal directories.
Click to hide internal directories.