Documentation ¶
Index ¶
- func CreateClient(ctx context.Context, clientSecretHash ClientSecretHasher, ...) (clientID string, clientSecret string, err error)
- func NewHandler(c *Config) http.Handler
- func RedirectWhenLoggedInAndAssigned(callbackURL string) func(http.Handler) http.Handler
- type AccessTokenResponds
- type Authorization
- func (a *Authorization) ClientID() uuid.UUID
- func (a *Authorization) Code() string
- func (a *Authorization) CodeChallenge() string
- func (a *Authorization) Delete(ctx context.Context) error
- func (a *Authorization) IDStr() string
- func (a *Authorization) RedirectURI() string
- func (a *Authorization) SetUserID(ctx context.Context, userID uint) error
- func (a *Authorization) State() string
- func (a *Authorization) UserID() uint
- type Client
- type ClientSecretHasher
- type ClientSecretVerifier
- type Config
- type IDToken
- type IdTokenClaims
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateClient ¶
func NewHandler ¶
Types ¶
type AccessTokenResponds ¶
type Authorization ¶
type Authorization struct { ID uint `gorm:"primarykey"` CreatedAt time.Time UpdatedAt time.Time InternalClientID uuid.UUID `gorm:"column:client_id;type:VARCHAR;size:191;not null"` Client Client `gorm:"foreignKey:InternalClientID"` InternalUserID *uint `gorm:"column:user_id"` User *model.User `gorm:"foreignKey:InternalUserID"` InternalState string `gorm:"column:state"` InternalCode []byte `gorm:"column:code;type:BLOB(16)"` InternalCodeChallenge string `gorm:"column:code_challenge;type:BLOB(16)"` SessionID uuid.UUID `gorm:"column:session_id;type:VARCHAR(191);not null"` }
func FirstAuthorization ¶
func FirstAuthorization(ctx context.Context) (*Authorization, error)
func (*Authorization) ClientID ¶
func (a *Authorization) ClientID() uuid.UUID
func (*Authorization) Code ¶
func (a *Authorization) Code() string
func (*Authorization) CodeChallenge ¶
func (a *Authorization) CodeChallenge() string
func (*Authorization) IDStr ¶
func (a *Authorization) IDStr() string
func (*Authorization) RedirectURI ¶
func (a *Authorization) RedirectURI() string
func (*Authorization) SetUserID ¶
func (a *Authorization) SetUserID(ctx context.Context, userID uint) error
func (*Authorization) State ¶
func (a *Authorization) State() string
func (*Authorization) UserID ¶
func (a *Authorization) UserID() uint
type Client ¶
type Client struct { ID uuid.UUID `gorm:"primarykey"` CreatedAt time.Time UpdatedAt time.Time DeletedAt gorm.DeletedAt `gorm:"index"` Description string `gorm:"type:VARCHAR(255);not null"` ClientSecret string `gorm:"type:VARCHAR(255);not null"` InternalRedirectURI string `gorm:"column:redirect_uri;type:VARCHAR(255);not null"` }
func (*Client) RedirectURI ¶
func (*Client) VerifyClientSecret ¶
type ClientSecretHasher ¶
func NewClientSecretHasher ¶
func NewClientSecretHasher() ClientSecretHasher
type ClientSecretVerifier ¶
type Config ¶
type Config struct { IssuerUrl string PrivateKey *ecdsa.PrivateKey }
type IDToken ¶
type IDToken struct { Key *ecdsa.PrivateKey Issuer string ExpiresIn time.Duration UserID uint ClientID uuid.UUID }
func (IDToken) MarshalText ¶
type IdTokenClaims ¶
type IdTokenClaims struct {
jwt.RegisteredClaims
}
Click to show internal directories.
Click to hide internal directories.