identity

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleAuthMe

func HandleAuthMe(w http.ResponseWriter, r *http.Request, deps Dependencies)

func HandleRegistryCredentialItem

func HandleRegistryCredentialItem(w http.ResponseWriter, r *http.Request, deps Dependencies)

func HandleRegistryCredentials

func HandleRegistryCredentials(w http.ResponseWriter, r *http.Request, deps Dependencies)

func HandleSignup

func HandleSignup(w http.ResponseWriter, r *http.Request, deps Dependencies)

func HandleUserAPIKeyItem

func HandleUserAPIKeyItem(w http.ResponseWriter, r *http.Request, deps Dependencies)

func HandleUserAPIKeys

func HandleUserAPIKeys(w http.ResponseWriter, r *http.Request, deps Dependencies)

func HandleUserImagePublishActivity

func HandleUserImagePublishActivity(w http.ResponseWriter, r *http.Request, deps Dependencies)

func HandleUsers

func HandleUsers(w http.ResponseWriter, r *http.Request, deps Dependencies)

func NormalizePasswordUserRole

func NormalizePasswordUserRole(raw string) (string, error)

func RegistryCredentialUsername

func RegistryCredentialUsername(p apiauth.Principal) string

Types

type Dependencies

type Dependencies struct {
	Platform             *platformstore.Store
	UserKeys             UserAPIKeyStore
	PrincipalFromContext func(context.Context) (apiauth.Principal, bool)
	AuthenticateRequest  func(*http.Request) (apiauth.Principal, bool, error)
	WriteJSON            func(http.ResponseWriter, int, any)
	WriteBodyDecodeError func(http.ResponseWriter, error)
	RequestIP            func(*http.Request) string
	RequestSource        func(*http.Request) string
	AuditSource          func(*http.Request, apiauth.Principal) string
	AuditIdentityLabel   func(apiauth.Principal) string
}

type UserAPIKeyStore

type UserAPIKeyStore interface {
	AuthenticateUserAPIKey(ctx context.Context, rawKey string) (apiauth.Principal, bool, error)
	ListUserAPIKeys(ctx context.Context, userID string) ([]platformstore.APIKeySummary, error)
	CreateUserAPIKey(ctx context.Context, userID, name string) (platformstore.APIKeySummary, string, error)
	RevokeUserAPIKey(ctx context.Context, userID, id string) (platformstore.APIKeySummary, error)
}

Jump to

Keyboard shortcuts

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