Documentation ¶
Index ¶
- Variables
- type ApplicationSupplier
- type Authorization
- type AuthorizationProperties
- type Service
- func (s *Service) AuthorizationByCommonToken(ctx context.Context, tokenType string, token string) (*Authorization, error)
- func (s *Service) ImplicitAuthorization(ctx context.Context, userID uuid.UUID, clientID string, scopes string) (*Authorization, error)
- func (s *Service) VerifyUserAuthorization(ctx context.Context, userID uuid.UUID, clientID string) (*Authorization, error)
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 (*Service) ImplicitAuthorization ¶
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
Click to show internal directories.
Click to hide internal directories.