Documentation
¶
Index ¶
- func NewGOrmDB(dbType string, dsn string) (*gorm.DB, error)
- type ClientDBModel
- func (c *ClientDBModel) AfterFind() (err error)
- func (c *ClientDBModel) BeforeCreate() error
- func (c *ClientDBModel) GetApprovedGrantTypes() oidcsdk.Arguments
- func (c *ClientDBModel) GetApprovedScopes() oidcsdk.Arguments
- func (c *ClientDBModel) GetAttribute(key string) interface{}
- func (c *ClientDBModel) GetID() string
- func (c *ClientDBModel) GetIDTokenSigningAlg() jose.SignatureAlgorithm
- func (c *ClientDBModel) GetRedirectURIs() []string
- func (c *ClientDBModel) GetSecret() string
- func (c *ClientDBModel) IsPublic() bool
- func (c *ClientDBModel) SetApprovedGrantTypes(gty oidcsdk.Arguments)
- func (c *ClientDBModel) SetApprovedScopes(scp oidcsdk.Arguments)
- func (c *ClientDBModel) SetAttribute(key string, value interface{})
- func (c *ClientDBModel) SetIDTokenSigningAlg(alg jose.SignatureAlgorithm)
- func (c *ClientDBModel) SetRedirectURIs(uris []string)
- func (c *ClientDBModel) TableName() string
- type ClientStore
- type KeyDBModel
- type KeyStore
- type TokenDBModel
- type TokenStore
- func (d *TokenStore) AutoMigrate()
- func (d *TokenStore) GetProfileWithAccessTokenSign(_ context.Context, signature string) (profile oidcsdk.RequestProfile, reqId string, err error)
- func (d *TokenStore) GetProfileWithAuthCodeSign(_ context.Context, signature string) (profile oidcsdk.RequestProfile, reqId string, err error)
- func (d *TokenStore) GetProfileWithRefreshTokenSign(_ context.Context, signature string) (profile oidcsdk.RequestProfile, reqId string, err error)
- func (d *TokenStore) InvalidateWithRequestID(_ context.Context, reqID string, what uint8) (err error)
- func (d *TokenStore) StoreTokenProfile(_ context.Context, reqId string, signatures oidcsdk.TokenSignatures, ...) (err error)
- type UserDBModel
- type UserStore
- func (u *UserStore) Authenticate(_ context.Context, username string, credential []byte) (err error)
- func (u *UserStore) AutoMigrate()
- func (u *UserStore) FetchUserProfile(_ context.Context, username string) oidcsdk.RequestProfile
- func (u *UserStore) GetClaims(context.Context, string, oidcsdk.Arguments, []string) (map[string]interface{}, error)
- func (u *UserStore) IsConsentRequired(context.Context, string, string, oidcsdk.Arguments) bool
- func (u *UserStore) StoreConsent(context.Context, string, string, oidcsdk.Arguments) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ClientDBModel ¶
type ClientDBModel struct {
gorm.Model
ClientID string `gorm:"column:client_id;unique_index;not null;size:256"`
ClientSecret string `gorm:"column:client_secret;size:256"`
Public bool `gorm:"column:public;unique_index;not null"`
Attributes map[string]interface{} `gorm:"-"`
AttributeData string `gorm:"column:attributes;type:lob"`
}
func NewClientDBModel ¶
func NewClientDBModel() *ClientDBModel
func (*ClientDBModel) AfterFind ¶
func (c *ClientDBModel) AfterFind() (err error)
func (*ClientDBModel) BeforeCreate ¶
func (c *ClientDBModel) BeforeCreate() error
func (*ClientDBModel) GetApprovedGrantTypes ¶
func (c *ClientDBModel) GetApprovedGrantTypes() oidcsdk.Arguments
func (*ClientDBModel) GetApprovedScopes ¶
func (c *ClientDBModel) GetApprovedScopes() oidcsdk.Arguments
func (*ClientDBModel) GetAttribute ¶
func (c *ClientDBModel) GetAttribute(key string) interface{}
func (*ClientDBModel) GetID ¶
func (c *ClientDBModel) GetID() string
func (*ClientDBModel) GetIDTokenSigningAlg ¶
func (c *ClientDBModel) GetIDTokenSigningAlg() jose.SignatureAlgorithm
func (*ClientDBModel) GetRedirectURIs ¶
func (c *ClientDBModel) GetRedirectURIs() []string
func (*ClientDBModel) GetSecret ¶
func (c *ClientDBModel) GetSecret() string
func (*ClientDBModel) IsPublic ¶
func (c *ClientDBModel) IsPublic() bool
func (*ClientDBModel) SetApprovedGrantTypes ¶
func (c *ClientDBModel) SetApprovedGrantTypes(gty oidcsdk.Arguments)
func (*ClientDBModel) SetApprovedScopes ¶
func (c *ClientDBModel) SetApprovedScopes(scp oidcsdk.Arguments)
func (*ClientDBModel) SetAttribute ¶
func (c *ClientDBModel) SetAttribute(key string, value interface{})
func (*ClientDBModel) SetIDTokenSigningAlg ¶
func (c *ClientDBModel) SetIDTokenSigningAlg(alg jose.SignatureAlgorithm)
func (*ClientDBModel) SetRedirectURIs ¶
func (c *ClientDBModel) SetRedirectURIs(uris []string)
func (*ClientDBModel) TableName ¶
func (c *ClientDBModel) TableName() string
type ClientStore ¶
type ClientStore struct {
// contains filtered or unexported fields
}
func NewClientStore ¶
func NewClientStore(db *gorm.DB) *ClientStore
func (*ClientStore) AutoMigrate ¶
func (c *ClientStore) AutoMigrate()
func (*ClientStore) FetchClientProfile ¶
func (c *ClientStore) FetchClientProfile(_ context.Context, clientId string) oidcsdk.RequestProfile
type KeyDBModel ¶
type KeyDBModel struct {
gorm.Model
KID string `gorm:"column:key_id;size:100;unique_index;not null"`
Asymmetric bool `gorm:"column:asymmetric;not null;size:50"`
Algorithm string `gorm:"column:algorithm;size:50"`
Use string `gorm:"column:use;size:10"`
PrivateKey string `gorm:"column:private_key;type:lob"`
PublicKey string `gorm:"column:public_key;type:lob"`
SecretKey string `gorm:"column:secret_key;type:lob"`
}
func (*KeyDBModel) GetPrivateKey ¶
func (km *KeyDBModel) GetPrivateKey() (interface{}, error)
func (*KeyDBModel) GetPublicKey ¶
func (km *KeyDBModel) GetPublicKey() (interface{}, error)
func (*KeyDBModel) SetPrivateKey ¶
func (km *KeyDBModel) SetPrivateKey(key interface{}) error
func (*KeyDBModel) SetPublicKey ¶
func (km *KeyDBModel) SetPublicKey(key interface{}) error
func (*KeyDBModel) TableName ¶
func (km *KeyDBModel) TableName() string
type KeyStore ¶
type KeyStore struct {
// contains filtered or unexported fields
}
func NewKeyStore ¶
func (*KeyStore) AutoMigrate ¶
func (k *KeyStore) AutoMigrate()
func (*KeyStore) GetAllSecrets ¶
func (k *KeyStore) GetAllSecrets() *jose.JSONWebKeySet
type TokenDBModel ¶
type TokenDBModel struct {
gorm.Model
RequestID string `gorm:"column:request_id;unique_index;size:60;default:null"`
ATSignature sql.NullString `gorm:"column:at_signature;unique_index;default:null"`
ACSignature sql.NullString `gorm:"column:ac_signature;unique_index;default:null"`
RTSignature sql.NullString `gorm:"column:rt_signature;unique_index;default:null"`
ACExpiry time.Time `gorm:"column:ac_expiry"`
ATExpiry time.Time `gorm:"column:at_expiry"`
RTExpiry time.Time `gorm:"column:rt_expiry"`
ProfileData string `gorm:"column:profile;type:lob"`
RequestProfile oidcsdk.RequestProfile `gorm:"-"`
}
func (*TokenDBModel) AfterFind ¶
func (t *TokenDBModel) AfterFind() (err error)
func (*TokenDBModel) BeforeCreate ¶
func (t *TokenDBModel) BeforeCreate() error
func (*TokenDBModel) TableName ¶
func (t *TokenDBModel) TableName() string
type TokenStore ¶
type TokenStore struct {
// contains filtered or unexported fields
}
func NewTokenStore ¶
func NewTokenStore(db *gorm.DB) *TokenStore
func (*TokenStore) AutoMigrate ¶
func (d *TokenStore) AutoMigrate()
func (*TokenStore) GetProfileWithAccessTokenSign ¶
func (d *TokenStore) GetProfileWithAccessTokenSign(_ context.Context, signature string) (profile oidcsdk.RequestProfile, reqId string, err error)
func (*TokenStore) GetProfileWithAuthCodeSign ¶
func (d *TokenStore) GetProfileWithAuthCodeSign(_ context.Context, signature string) (profile oidcsdk.RequestProfile, reqId string, err error)
func (*TokenStore) GetProfileWithRefreshTokenSign ¶
func (d *TokenStore) GetProfileWithRefreshTokenSign(_ context.Context, signature string) (profile oidcsdk.RequestProfile, reqId string, err error)
func (*TokenStore) InvalidateWithRequestID ¶
func (*TokenStore) StoreTokenProfile ¶
func (d *TokenStore) StoreTokenProfile(_ context.Context, reqId string, signatures oidcsdk.TokenSignatures, profile oidcsdk.RequestProfile) (err error)
type UserDBModel ¶
type UserDBModel struct {
gorm.Model
Username string `gorm:"column:username;unique_index;size:256;not null"`
Password string `gorm:"column:password;size:256;not null"`
Locked bool `gorm:"column:locked"`
Blocked bool `gorm:"column:blocked"`
WrongAttemptStart *time.Time `gorm:"column:wrong_attempt_start"`
WrongAttemptCount uint8 `gorm:"column:wrong_attempt_count"`
}
func (*UserDBModel) TableName ¶
func (t *UserDBModel) TableName() string
type UserStore ¶
type UserStore struct {
WrongAttemptWindow time.Duration
WrongAttemptCount uint8
// contains filtered or unexported fields
}
func NewUserStore ¶
func (*UserStore) Authenticate ¶
func (*UserStore) AutoMigrate ¶
func (u *UserStore) AutoMigrate()
func (*UserStore) FetchUserProfile ¶
func (*UserStore) IsConsentRequired ¶
Click to show internal directories.
Click to hide internal directories.