Documentation
¶
Index ¶
- Constants
- type Issuer
- type MappedIdentity
- func (m *MappedIdentity) GetIssuer() *Issuer
- func (m *MappedIdentity) GetOrgRoles() []OrganizationRoles
- func (m *MappedIdentity) GetOrganizations() []*orgmodel.Organization
- func (m *MappedIdentity) GetRolesForOrg(orgID string) []string
- func (m *MappedIdentity) GetUID() string
- func (m *MappedIdentity) GetUsername() string
- func (m *MappedIdentity) IsSuperAdmin() bool
- type OrganizationRoles
Constants ¶
const ( AuthTypeK8s = "k8s" AuthTypeOIDC = "OIDC" AuthTypeOAuth2 = "OAuth2" AuthTypeAAP = "AAPGateway" AuthTypeOpenShift = "openshift" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Issuer ¶
type Issuer struct {
// Type of the issuer (OIDC, AAP, K8s, etc.)
Type string `json:"type"`
// ID of the issuer (e.g., OIDC issuer URL, K8s cluster name, AAP instance ID)
ID string `json:"id"`
}
Issuer represents the source that produced an identity
func (*Issuer) IsOpenShift ¶
IsOpenShift returns true if this is an OpenShift issuer
type MappedIdentity ¶
type MappedIdentity struct {
// Organizations the user belongs to (mapped from external identity)
Organizations []*orgmodel.Organization `json:"organizations"`
// OrgRoles maps organization ID to roles for that organization
OrgRoles map[string][]string `json:"org_roles"`
// SuperAdmin indicates if the user has the global flightctl-admin role
SuperAdmin bool `json:"is_super_admin"`
// Original username and UID for reference
Username string `json:"username"`
UID string `json:"uid"`
// Issuer that produced this identity (OIDC, AAP, K8s, etc.)
Issuer *Issuer `json:"issuer"`
}
MappedIdentity represents an identity with all its mapped database objects This is the internal identity object that contains local DB entities
func NewMappedIdentity ¶
func NewMappedIdentity(username, uid string, organizations []*orgmodel.Organization, orgRoles map[string][]string, isSuperAdmin bool, issuer *Issuer) *MappedIdentity
NewMappedIdentity creates a new MappedIdentity
func (*MappedIdentity) GetIssuer ¶
func (m *MappedIdentity) GetIssuer() *Issuer
GetIssuer returns the issuer that produced this identity
func (*MappedIdentity) GetOrgRoles ¶
func (m *MappedIdentity) GetOrgRoles() []OrganizationRoles
GetOrgRoles returns a list of organization-roles pairs
func (*MappedIdentity) GetOrganizations ¶
func (m *MappedIdentity) GetOrganizations() []*orgmodel.Organization
GetOrganizations returns the full organization objects
func (*MappedIdentity) GetRolesForOrg ¶
func (m *MappedIdentity) GetRolesForOrg(orgID string) []string
GetRolesForOrg returns the roles for a specific organization by ID
func (*MappedIdentity) GetUsername ¶
func (m *MappedIdentity) GetUsername() string
GetUsername returns the username
func (*MappedIdentity) IsSuperAdmin ¶
func (m *MappedIdentity) IsSuperAdmin() bool
IsSuperAdmin returns whether the user has the global flightctl-admin role
type OrganizationRoles ¶
type OrganizationRoles struct {
Organization *orgmodel.Organization
Roles []string
}
OrganizationRoles pairs an organization with its roles