Documentation
¶
Overview ¶
Package implements models representing identity
Index ¶
Constants ¶
View Source
const ( IdentityTypeUser IdentityType = "User" IdentityTypeCluster IdentityType = "Cluster" IdentityTypeService IdentityType = "Service" IdentityProviderOidc IdentityProvider = "OIDC" IdentityProviderApiKey IdentityProvider = "APIKEY" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthInfo ¶
type AuthInfo struct {
AuthProvider IdentityProvider `json:"authProvider,omitempty"`
AuthProviderID string `json:"authProviderId,omitempty"`
ExpirationTime time.Time `json:"expirationTime,omitempty"`
}
type ContexIdentityType ¶
type ContexIdentityType string
Type used to set identity in context
const ContexIdentity ContexIdentityType = "ror-identity"
type Identity ¶
type Identity struct {
Auth AuthInfo `json:"auth,omitempty"`
Type IdentityType `json:"type,omitempty"`
User *User `json:"user,omitempty"`
ClusterIdentity *ServiceIdentity `json:"clusterIdentity,omitempty"`
ServiceIdentity *ServiceIdentity `json:"serviceIdentity,omitempty"`
}
Identity is a representation of the consumers identity kept in the context for authentication
func (*Identity) GetAuthInfo ¶
Function returns the auth info of the identity
func (*Identity) GetId ¶
Function returns the id of the identity.
User is represented by email, cluster by clusterid and service by service name
type IdentityProvider ¶
type IdentityProvider string
type IdentityType ¶
type IdentityType string
Type to hold the identitytype eg. user, cluster,service...
type ServiceIdentity ¶
type ServiceIdentity struct {
Id string `json:"id"`
}
The type is a representation of a cluster or service identity. May be splited if needed.
type User ¶
type User struct {
Email string `json:"email"`
IsEmailVerified bool `json:"email_verified"`
Name string `json:"name"`
Groups []string `json:"groups"`
Audience string `json:"aud"`
Issuer string `json:"iss"`
ExpirationTime int `json:"exp"`
}
The type is a representation of a user identity.
The json fields corresponds with the values provided in an oidc token.
Click to show internal directories.
Click to hide internal directories.