Documentation ¶
Index ¶
- Constants
- Variables
- func GeneratePromotionCode() string
- func HashPromotionCode(code string) string
- type PromotionCode
- type Provider
- func (p *Provider) Create(ctx context.Context, i *identity.Anonymous) error
- func (p *Provider) Delete(ctx context.Context, i *identity.Anonymous) error
- func (p *Provider) Get(ctx context.Context, userID, id string) (*identity.Anonymous, error)
- func (p *Provider) GetByKeyID(ctx context.Context, keyID string) (*identity.Anonymous, error)
- func (p *Provider) GetMany(ctx context.Context, ids []string) ([]*identity.Anonymous, error)
- func (p *Provider) List(ctx context.Context, userID string) ([]*identity.Anonymous, error)
- func (p *Provider) New(userID string, keyID string, key []byte) *identity.Anonymous
- func (p *Provider) ParseRequest(requestJWT string, i *identity.Anonymous) (*Request, error)
- func (p *Provider) ParseRequestUnverified(requestJWT string) (r *Request, err error)
- type Request
- type RequestAction
- type Store
- func (s *Store) Create(ctx context.Context, i *identity.Anonymous) (err error)
- func (s *Store) Delete(ctx context.Context, i *identity.Anonymous) error
- func (s *Store) Get(ctx context.Context, userID, id string) (*identity.Anonymous, error)
- func (s *Store) GetByKeyID(ctx context.Context, keyID string) (*identity.Anonymous, error)
- func (s *Store) GetMany(ctx context.Context, ids []string) ([]*identity.Anonymous, error)
- func (s *Store) List(ctx context.Context, userID string) ([]*identity.Anonymous, error)
- type StoreRedis
Constants ¶
View Source
const RequestTokenType = "vnd.authgear.anonymous-request"
nolint:gosec
Variables ¶
View Source
var DependencySet = wire.NewSet( wire.Struct(new(Store), "*"), wire.Struct(new(Provider), "*"), wire.Struct(new(StoreRedis), "*"), )
View Source
var ErrPromotionCodeNotFound = errors.New("promotion code not found")
View Source
var KeyIDFormat = regexp.MustCompile(`^[-\w]{8,64}$`)
Functions ¶
func GeneratePromotionCode ¶
func GeneratePromotionCode() string
func HashPromotionCode ¶
Types ¶
type PromotionCode ¶
type Provider ¶
func (*Provider) GetByKeyID ¶
func (*Provider) ParseRequest ¶
type Request ¶
type Request struct { Key jwk.Key `json:"-"` KeyID string `json:"-"` Challenge string `json:"challenge"` Action RequestAction `json:"action"` }
type RequestAction ¶
type RequestAction string
const ( RequestActionAuth RequestAction = "auth" RequestActionPromote RequestAction = "promote" )
type Store ¶
type Store struct { SQLBuilder *appdb.SQLBuilderApp SQLExecutor *appdb.SQLExecutor }
func (*Store) GetByKeyID ¶
type StoreRedis ¶
func (*StoreRedis) CreatePromotionCode ¶
func (s *StoreRedis) CreatePromotionCode(ctx context.Context, code *PromotionCode) error
func (*StoreRedis) DeletePromotionCode ¶
func (s *StoreRedis) DeletePromotionCode(ctx context.Context, code *PromotionCode) error
func (*StoreRedis) GetPromotionCode ¶
func (s *StoreRedis) GetPromotionCode(ctx context.Context, codeHash string) (*PromotionCode, error)
Click to show internal directories.
Click to hide internal directories.