Documentation
¶
Index ¶
- func ApiStatusToErr(status domain.Status) error
- func NilOutManagedObjectMetaProperties(om *domain.ObjectMeta)
- func StoreErrorToApiStatus(err error, created bool, kind string, name *string) domain.Status
- type AuthTokenProxy
- type AuthUserInfoProxy
- type IdentityMapper
- func (m *IdentityMapper) GetUserOrganizations(ctx context.Context, identity common.Identity) ([]*model.Organization, error)
- func (m *IdentityMapper) IsMemberOf(ctx context.Context, identity common.Identity, orgID uuid.UUID) (bool, error)
- func (m *IdentityMapper) MapIdentityToDB(ctx context.Context, identity common.Identity) ([]*model.Organization, error)
- func (m *IdentityMapper) Start()
- func (m *IdentityMapper) Stop()
- type OrgProvisioner
- type OrgProvisionerInterface
- type ProviderConfig
- type ProxyResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApiStatusToErr ¶ added in v0.6.0
func NilOutManagedObjectMetaProperties ¶ added in v0.6.0
func NilOutManagedObjectMetaProperties(om *domain.ObjectMeta)
Types ¶
type AuthTokenProxy ¶ added in v1.0.0
type AuthTokenProxy struct {
// contains filtered or unexported fields
}
AuthTokenProxy handles OAuth2 token exchange by proxying to configured providers
func NewAuthTokenProxy ¶ added in v1.0.0
func NewAuthTokenProxy(authN *authn.MultiAuth) *AuthTokenProxy
NewAuthTokenProxy creates a new auth token proxy
func (*AuthTokenProxy) ProxyTokenRequest ¶ added in v1.0.0
func (p *AuthTokenProxy) ProxyTokenRequest(ctx context.Context, providerName string, tokenReq *domain.TokenRequest) (*domain.TokenResponse, int)
ProxyTokenRequest handles OAuth2 token exchange requests Returns TokenResponse and HTTP status code (200 for success, 400 for errors per OAuth2 spec)
type AuthUserInfoProxy ¶ added in v1.0.0
type AuthUserInfoProxy struct {
// contains filtered or unexported fields
}
AuthUserInfoProxy handles OIDC UserInfo requests by extracting identity from context
func NewAuthUserInfoProxy ¶ added in v1.0.0
func NewAuthUserInfoProxy(authN common.AuthNMiddleware) *AuthUserInfoProxy
NewAuthUserInfoProxy creates a new auth userinfo proxy
func (*AuthUserInfoProxy) ProxyUserInfoRequest ¶ added in v1.0.0
func (p *AuthUserInfoProxy) ProxyUserInfoRequest(ctx context.Context) (*domain.UserInfoResponse, domain.Status)
ProxyUserInfoRequest handles OIDC UserInfo requests by extracting the authenticated identity from context
type IdentityMapper ¶ added in v1.0.0
type IdentityMapper struct {
// contains filtered or unexported fields
}
IdentityMapper handles mapping from identity information to database entities
func NewIdentityMapper ¶ added in v1.0.0
func NewIdentityMapper(organizationStore organizationstore.Store, provisioner OrgProvisionerInterface, log logrus.FieldLogger) *IdentityMapper
NewIdentityMapper creates a new IdentityMapper instance
func (*IdentityMapper) GetUserOrganizations ¶ added in v1.0.0
func (m *IdentityMapper) GetUserOrganizations(ctx context.Context, identity common.Identity) ([]*model.Organization, error)
GetUserOrganizations returns the organizations for a user based on their identity
func (*IdentityMapper) IsMemberOf ¶ added in v1.0.0
func (m *IdentityMapper) IsMemberOf(ctx context.Context, identity common.Identity, orgID uuid.UUID) (bool, error)
IsMemberOf checks if a user is a member of a specific organization
func (*IdentityMapper) MapIdentityToDB ¶ added in v1.0.0
func (m *IdentityMapper) MapIdentityToDB(ctx context.Context, identity common.Identity) ([]*model.Organization, error)
MapIdentityToDB maps identity information to database entities It ensures that organizations exist in the database and returns the mapped entities Note: Users are not stored in the database - only organizations are persisted
func (*IdentityMapper) Start ¶ added in v1.0.0
func (m *IdentityMapper) Start()
Start starts the cache background cleanup goroutine. Call Stop() to shut it down.
func (*IdentityMapper) Stop ¶ added in v1.0.0
func (m *IdentityMapper) Stop()
Stop stops the cache background cleanup
type OrgProvisioner ¶ added in v1.2.0
type OrgProvisioner struct {
// contains filtered or unexported fields
}
OrgProvisioner ensures that default resources exist for every organization. It is called by IdentityMapper only when new organizations are created, so each org is provisioned at most once per identity-mapper cache TTL.
func NewOrgProvisioner ¶ added in v1.2.0
func NewOrgProvisioner(catalogStore catalogstore.Store, log logrus.FieldLogger) *OrgProvisioner
NewOrgProvisioner creates a new OrgProvisioner.
func (*OrgProvisioner) EnsureDefaults ¶ added in v1.2.0
func (p *OrgProvisioner) EnsureDefaults(ctx context.Context, orgs []*model.Organization)
EnsureDefaults creates default resources for the given newly-created organizations. It is only called for orgs that IdentityMapper just created via UpsertMany. Errors are logged and not returned; missing defaults are non-fatal to request handling.
type OrgProvisionerInterface ¶ added in v1.2.0
type OrgProvisionerInterface interface {
EnsureDefaults(ctx context.Context, orgs []*model.Organization)
}
OrgProvisionerInterface is implemented by anything that can provision default resources for new orgs.
type ProviderConfig ¶ added in v1.0.0
type ProviderConfig struct {
Issuer string
TokenEndpoint string
ClientId string
UseBasicAuth bool // If true, send client_id/client_secret as Basic Auth header instead of form data
}
ProviderConfig holds the configuration needed to proxy requests to an OAuth2 provider
type ProxyResult ¶ added in v1.0.0
type ProxyResult struct {
TokenResponse *domain.TokenResponse
StatusCode int
}
ProxyResult holds the result of proxying a token request, including the upstream HTTP status
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package authprovider is a generated GoMock package.
|
Package authprovider is a generated GoMock package. |
|
Package canary is a generated GoMock package.
|
Package canary is a generated GoMock package. |
|
Package catalog is a generated GoMock package.
|
Package catalog is a generated GoMock package. |
|
Package certificatesigningrequest is a generated GoMock package.
|
Package certificatesigningrequest is a generated GoMock package. |
|
Package checkpoint is a generated GoMock package.
|
Package checkpoint is a generated GoMock package. |
|
Package dependencyref is a generated GoMock package.
|
Package dependencyref is a generated GoMock package. |
|
Package device is a generated GoMock package.
|
Package device is a generated GoMock package. |
|
Package enrollmentrequest is a generated GoMock package.
|
Package enrollmentrequest is a generated GoMock package. |
|
Package event is a generated GoMock package.
|
Package event is a generated GoMock package. |
|
Package fleet is a generated GoMock package.
|
Package fleet is a generated GoMock package. |
|
Package organization is a generated GoMock package.
|
Package organization is a generated GoMock package. |
|
Package repository is a generated GoMock package.
|
Package repository is a generated GoMock package. |
|
Package resourcesync is a generated GoMock package.
|
Package resourcesync is a generated GoMock package. |
|
Package syncstate is a generated GoMock package.
|
Package syncstate is a generated GoMock package. |
|
Package templateversion is a generated GoMock package.
|
Package templateversion is a generated GoMock package. |
|
Package vulnerabilityfinding is a generated GoMock package.
|
Package vulnerabilityfinding is a generated GoMock package. |