Documentation ¶
Index ¶
- type GormOauthStateReferenceRepository
- func (r *GormOauthStateReferenceRepository) Cleanup(ctx context.Context) (int64, error)
- func (r *GormOauthStateReferenceRepository) Create(ctx context.Context, reference *OauthStateReference) (*OauthStateReference, error)
- func (r *GormOauthStateReferenceRepository) Delete(ctx context.Context, ID uuid.UUID) error
- func (r *GormOauthStateReferenceRepository) Load(ctx context.Context, state string) (*OauthStateReference, error)
- type OauthStateReference
- type OauthStateReferenceRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GormOauthStateReferenceRepository ¶
type GormOauthStateReferenceRepository struct {
// contains filtered or unexported fields
}
GormOauthStateReferenceRepository implements OauthStateReferenceRepository using gorm
func NewOauthStateReferenceRepository ¶
func NewOauthStateReferenceRepository(db *gorm.DB) *GormOauthStateReferenceRepository
NewOauthStateReferenceRepository creates a new oauth state reference repo
func (*GormOauthStateReferenceRepository) Cleanup ¶
func (r *GormOauthStateReferenceRepository) Cleanup(ctx context.Context) (int64, error)
Cleanup deletes all oauth references created more than 24hrs ago returns NotFoundError or InternalError
func (*GormOauthStateReferenceRepository) Create ¶
func (r *GormOauthStateReferenceRepository) Create(ctx context.Context, reference *OauthStateReference) (*OauthStateReference, error)
Create creates a new oauth state reference in the DB returns InternalError
func (*GormOauthStateReferenceRepository) Delete ¶
Delete deletes the reference with the given id returns NotFoundError or InternalError
func (*GormOauthStateReferenceRepository) Load ¶
func (r *GormOauthStateReferenceRepository) Load(ctx context.Context, state string) (*OauthStateReference, error)
Load loads state reference by state
type OauthStateReference ¶
type OauthStateReference struct { gormsupport.Lifecycle ID uuid.UUID `sql:"type:uuid default uuid_generate_v4()" gorm:"primary_key"` State string Referrer string ResponseMode *string }
OauthStateReference represents a oauth state reference
func (OauthStateReference) Equal ¶
func (r OauthStateReference) Equal(u convert.Equaler) bool
Equal returns true if two States objects are equal; otherwise false is returned.
func (OauthStateReference) TableName ¶
func (r OauthStateReference) TableName() string
TableName implements gorm.tabler
type OauthStateReferenceRepository ¶
type OauthStateReferenceRepository interface { Create(ctx context.Context, state *OauthStateReference) (*OauthStateReference, error) Delete(ctx context.Context, ID uuid.UUID) error Cleanup(ctx context.Context) (int64, error) Load(ctx context.Context, state string) (*OauthStateReference, error) }
OauthStateReferenceRepository encapsulate storage & retrieval of state references