authorization

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2022 License: BSD-2-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//ErrUngrantedImplicitAutoGrant implies that theres no auto granted authorization for this user
	ErrUngrantedImplicitAutoGrant error = errors.New("implicit auto grant not granted yet")
	//ErrRetiredApplication implies that the application is in retired state and canot be used anymore
	ErrRetiredApplication error = errors.New("application is retired")
	//ErrNotFound indicates that the requested entity could not be found
	ErrNotFound error = errors.New("requested entity not found")
)

Functions

This section is empty.

Types

type ApplicationSupplier

type ApplicationSupplier interface {
	ApplicationByID(ctx context.Context, id int) (*application.Application, error)
	ApplicationByClientID(ctx context.Context, clientID string) (*application.Application, error)
}

type Authorization

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

func (*Authorization) Application

func (a *Authorization) Application() *application.Application

func (*Authorization) ID

func (a *Authorization) ID() uuid.UUID

func (*Authorization) IsRevoked

func (a *Authorization) IsRevoked() bool

func (*Authorization) Properties

func (a *Authorization) Properties() *AuthorizationProperties

func (*Authorization) Scopes

func (a *Authorization) Scopes() []string

func (*Authorization) UserID

func (a *Authorization) UserID() uuid.UUID

type AuthorizationProperties

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

type Service

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

func NewAuthorizationService

func NewAuthorizationService(log *zap.Logger,
	store *db.DataStore,
	dispatcher *events.Dispatcher,
	supplier ApplicationSupplier) *Service

func (*Service) AuthorizationByCommonToken

func (s *Service) AuthorizationByCommonToken(
	ctx context.Context,
	tokenType string,
	token string,
) (*Authorization, error)

func (*Service) ImplicitAuthorization

func (s *Service) ImplicitAuthorization(
	ctx context.Context,
	userID uuid.UUID,
	clientID string,
	scopes string,
) (*Authorization, error)

func (*Service) VerifyUserAuthorization

func (s *Service) VerifyUserAuthorization(
	ctx context.Context,
	userID uuid.UUID,
	clientID string,
) (*Authorization, error)

VerifyUserAuthorization returns a non-revoked authorization for a non-retired application

Jump to

Keyboard shortcuts

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