repository

package
v0.0.0-...-2d73068 Latest Latest
Warning

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

Go to latest
Published: May 13, 2020 License: Apache-2.0 Imports: 7 Imported by: 3

Documentation

Index

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

Cleanup deletes all oauth references created more than 24hrs ago returns NotFoundError or InternalError

func (*GormOauthStateReferenceRepository) Create

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

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

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

Jump to

Keyboard shortcuts

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