Documentation
¶
Index ¶
- Variables
- type PGXTransactor
- type Querier
- type Service
- func (s *Service) ApproveDeviceCode(ctx context.Context, userCode string, user db.User) error
- func (s *Service) CreateDeviceCode(ctx context.Context, request *api.DeviceCodeCreateRequest) (*api.DeviceCode, error)
- func (s *Service) DenyDeviceCode(ctx context.Context, userCode string, user db.User) error
- func (s *Service) ExchangeDeviceCode(ctx context.Context, request api.DeviceCodeTokenRequest, userAgent string) (*api.TokenResponse, error)
- func (s *Service) Logout(ctx context.Context, request api.LogoutRequest) error
- func (s *Service) RefreshAccessToken(ctx context.Context, request api.RefreshTokenRequest, userAgent string) (*api.TokenResponse, error)
- type Transactor
- type ValidationError
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = errors.New("resource not found") ErrConflict = errors.New("resource conflict") ErrAuthorizationPending = errors.New("authorization pending") ErrSlowDown = errors.New("slow down") ErrExpiredToken = errors.New("expired token") ErrAccessDenied = errors.New("access denied") ErrInvalidRequest = errors.New("invalid request") ErrTooManyRequests = errors.New("too many requests") ErrTransactorNotProvided = errors.New("transactor not configured") )
Functions ¶
This section is empty.
Types ¶
type PGXTransactor ¶
type PGXTransactor struct {
// contains filtered or unexported fields
}
func NewPGXTransactor ¶
func NewPGXTransactor(pool *pgxpool.Pool) *PGXTransactor
type Querier ¶
type Querier interface {
CreateAuthDeviceAuthorization(ctx context.Context, arg db.CreateAuthDeviceAuthorizationParams) (db.AuthDeviceAuthorization, error)
GetAuthDeviceAuthorizationByDeviceCode(ctx context.Context, arg db.GetAuthDeviceAuthorizationByDeviceCodeParams) (db.AuthDeviceAuthorization, error)
GetAuthDeviceAuthorizationByUserCode(ctx context.Context, arg db.GetAuthDeviceAuthorizationByUserCodeParams) (db.AuthDeviceAuthorization, error)
UpdateAuthDeviceAuthorizationStatus(ctx context.Context, arg db.UpdateAuthDeviceAuthorizationStatusParams) (db.AuthDeviceAuthorization, error)
CreateAuthSession(ctx context.Context, arg db.CreateAuthSessionParams) (db.AuthSession, error)
GetAuthSessionByRefreshTokenHash(ctx context.Context, arg db.GetAuthSessionByRefreshTokenHashParams) (db.AuthSession, error)
GetUserByID(ctx context.Context, arg db.GetUserByIDParams) (db.User, error)
RevokeAuthSession(ctx context.Context, arg db.RevokeAuthSessionParams) (db.AuthSession, error)
RevokeAuthSessionFamily(ctx context.Context, arg db.RevokeAuthSessionFamilyParams) (int64, error)
CreateAuditLog(ctx context.Context, arg db.CreateAuditLogParams) (db.AuditLog, error)
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(cfg config.Config, queries Querier, tx Transactor) *Service
func (*Service) ApproveDeviceCode ¶
func (*Service) CreateDeviceCode ¶
func (s *Service) CreateDeviceCode(ctx context.Context, request *api.DeviceCodeCreateRequest) (*api.DeviceCode, error)
func (*Service) DenyDeviceCode ¶
func (*Service) ExchangeDeviceCode ¶
func (s *Service) ExchangeDeviceCode(ctx context.Context, request api.DeviceCodeTokenRequest, userAgent string) (*api.TokenResponse, error)
func (*Service) RefreshAccessToken ¶
func (s *Service) RefreshAccessToken(ctx context.Context, request api.RefreshTokenRequest, userAgent string) (*api.TokenResponse, error)
type Transactor ¶
type ValidationError ¶
type ValidationError struct {
Message string
}
func (ValidationError) Error ¶
func (e ValidationError) Error() string
Click to show internal directories.
Click to hide internal directories.