identity

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 7, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
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 NewIssuer

func NewIssuer(issuerType, issuerID string) *Issuer

NewIssuer creates a new Issuer

func (*Issuer) IsAAP

func (i *Issuer) IsAAP() bool

IsAAP returns true if this is an AAP issuer

func (*Issuer) IsK8s

func (i *Issuer) IsK8s() bool

IsK8s returns true if this is a K8s issuer

func (*Issuer) IsOAuth2

func (i *Issuer) IsOAuth2() bool

IsOAuth2 returns true if this is an OAuth2 issuer

func (*Issuer) IsOIDC

func (i *Issuer) IsOIDC() bool

IsOIDC returns true if this is an OIDC issuer

func (*Issuer) IsOpenShift

func (i *Issuer) IsOpenShift() bool

IsOpenShift returns true if this is an OpenShift issuer

func (*Issuer) String

func (i *Issuer) String() string

String returns a string representation of the 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) GetUID

func (m *MappedIdentity) GetUID() string

GetUID returns the user 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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL