authz

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultAuthorizer

type DefaultAuthorizer struct {
	// contains filtered or unexported fields
}

DefaultAuthorizer implements a basic set of authorization rules and delegates authorization for repository resources. Access to everything else is denied.

func NewDefaultAuthorizer

func NewDefaultAuthorizer(repoAuthorizer RepositoryAuthorizer, allowAnonymous bool) DefaultAuthorizer

NewDefaultAuthorizer returns a new DefaultAuthorizer.

func (DefaultAuthorizer) Authorize

func (a DefaultAuthorizer) Authorize(ctx context.Context, subject auth.Subject, requestedScopes []auth.Scope) ([]auth.Scope, error)

type DefaultRepositoryAuthorizer

type DefaultRepositoryAuthorizer struct {
	// contains filtered or unexported fields
}

DefaultRepositoryAuthorizer implements a simple authorization logic for authenticated users.

func NewDefaultRepositoryAuthorizer

func NewDefaultRepositoryAuthorizer(allowAnonymous bool) DefaultRepositoryAuthorizer

NewDefaultRepositoryAuthorizer returns a new DefaultRepositoryAuthorizer.

func (DefaultRepositoryAuthorizer) Authorize

func (a DefaultRepositoryAuthorizer) Authorize(_ context.Context, name string, subject auth.Subject, requestedActions []string) ([]string, error)

type RepositoryAuthorizer

type RepositoryAuthorizer interface {
	Authorize(ctx context.Context, name string, subject auth.Subject, requestedActions []string) ([]string, error)
}

RepositoryAuthorizer authorizes access requests to a specific repository.

Jump to

Keyboard shortcuts

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