auth

package
v0.0.0-...-5004fd2 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RoleValueAgentActiveHost   = "Agent.ActiveHost"
	RoleValueCertificateEnroll = "Certificate.Enroll"
)
View Source
const (
	AppConfidentialIdentityContextKey contextKey
)

Variables

This section is empty.

Functions

func AuthorizeAdminOnly

func AuthorizeAdminOnly(c context.Context) bool

Deprecated use authz.AuthorizeAdminOnly instead.

func AuthorizeSelfOrAdmin

func AuthorizeSelfOrAdmin(c context.Context, namespaceID uuid.UUID) bool

func GetDelegateClient

func GetDelegateClient[C, CK any](c context.Context, contextKey CK) *C

func HasRole

func HasRole(c context.Context, roleValue string) bool

func PreconfiguredKeysJWTAuthorization

func PreconfiguredKeysJWTAuthorization(keys []cloudkey.JsonWebKey, aud string) echo.MiddlewareFunc

func ProxiedAADAuth

func ProxiedAADAuth(next echo.HandlerFunc) echo.HandlerFunc

func ResolveSelfNamespace

func ResolveSelfNamespace(c context.Context, nsID string) uuid.UUID

func UnverifiedAADJwtAuth

func UnverifiedAADJwtAuth(next echo.HandlerFunc) echo.HandlerFunc

func WithDelegatedClient

func WithDelegatedClient[C, CK any](c ctx.RequestContext, contextKey CK, getClient func(azcore.TokenCredential) (*C, error)) (ctx.RequestContext, *C, error)

Types

type AuthIdentity

type AuthIdentity interface {
	ClientPrincipalID() uuid.UUID
	ClientPrincipalDisplayName() string
	AppID() string
	HasAdminRole() bool
	HasRole(roleValue string) bool
	GetOnBehalfOfTokenCredential(c context.Context, opts *azidentity.OnBehalfOfCredentialOptions) (azcore.TokenCredential, error)
}

func GetAuthIdentity

func GetAuthIdentity(c context.Context) AuthIdentity

type AzureAppConfidentialIdentity

type AzureAppConfidentialIdentity interface {
	AzureIdentity
	NewOnBehalfOfTokenCredential(userAssertion string, opts *azidentity.OnBehalfOfCredentialOptions) (azcore.TokenCredential, error)
}

type AzureIdentity

type AzureIdentity interface {
	TokenCredential() azcore.TokenCredential
	TenantID() string
	ClientID() string
}

Jump to

Keyboard shortcuts

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