strategy

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2016 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HMACSHAStrategy

type HMACSHAStrategy struct {
	Enigma                *enigma.HMACStrategy
	AccessTokenLifespan   time.Duration
	AuthorizeCodeLifespan time.Duration
}

func (HMACSHAStrategy) AccessTokenSignature

func (h HMACSHAStrategy) AccessTokenSignature(token string) string

func (HMACSHAStrategy) AuthorizeCodeSignature

func (h HMACSHAStrategy) AuthorizeCodeSignature(token string) string

func (HMACSHAStrategy) GenerateAccessToken

func (h HMACSHAStrategy) GenerateAccessToken(_ context.Context, _ fosite.Requester) (token string, signature string, err error)

func (HMACSHAStrategy) GenerateAuthorizeCode

func (h HMACSHAStrategy) GenerateAuthorizeCode(_ context.Context, _ fosite.Requester) (token string, signature string, err error)

func (HMACSHAStrategy) GenerateRefreshToken

func (h HMACSHAStrategy) GenerateRefreshToken(_ context.Context, _ fosite.Requester) (token string, signature string, err error)

func (HMACSHAStrategy) RefreshTokenSignature

func (h HMACSHAStrategy) RefreshTokenSignature(token string) string

func (HMACSHAStrategy) ValidateAccessToken

func (h HMACSHAStrategy) ValidateAccessToken(_ context.Context, r fosite.Requester, token string) (err error)

func (HMACSHAStrategy) ValidateAuthorizeCode

func (h HMACSHAStrategy) ValidateAuthorizeCode(_ context.Context, r fosite.Requester, token string) (err error)

func (HMACSHAStrategy) ValidateRefreshToken

func (h HMACSHAStrategy) ValidateRefreshToken(_ context.Context, _ fosite.Requester, token string) (err error)

type HMACSession

type HMACSession struct {
	AccessTokenExpiry   time.Time
	AuthorizeCodeExpiry time.Time
}

HMACSession Container for the HMAC session.

func (*HMACSession) AccessTokenExpiresAt

func (s *HMACSession) AccessTokenExpiresAt(fallback time.Time) time.Time

func (*HMACSession) AuthorizeCodeExpiresAt

func (s *HMACSession) AuthorizeCodeExpiresAt(fallback time.Time) time.Time

type HMACSessionContainer

type HMACSessionContainer interface {
	// AccessTokenExpiresAt returns the access token's expiry.
	AccessTokenExpiresAt(fallback time.Time) time.Time

	// AccessTokenExpiresAt returns the authorize code's expiry.
	AuthorizeCodeExpiresAt(fallback time.Time) time.Time
}

type JWTSession

type JWTSession struct {
	JWTClaims *jwt.JWTClaims
	JWTHeader *jwt.Headers
}

JWTSession Container for the JWT session.

func (*JWTSession) GetJWTClaims

func (j *JWTSession) GetJWTClaims() *jwt.JWTClaims

func (*JWTSession) GetJWTHeader

func (j *JWTSession) GetJWTHeader() *jwt.Headers

type JWTSessionContainer

type JWTSessionContainer interface {
	// GetJWTClaims returns the claims.
	GetJWTClaims() *jwt.JWTClaims

	// GetJWTHeader returns the header.
	GetJWTHeader() *jwt.Headers
}

type RS256JWTStrategy

type RS256JWTStrategy struct {
	*jwt.RS256JWTStrategy
}

RS256JWTStrategy is a JWT RS256 strategy.

func (RS256JWTStrategy) AccessTokenSignature

func (h RS256JWTStrategy) AccessTokenSignature(token string) string

func (RS256JWTStrategy) AuthorizeCodeSignature

func (h RS256JWTStrategy) AuthorizeCodeSignature(token string) string

func (*RS256JWTStrategy) GenerateAccessToken

func (h *RS256JWTStrategy) GenerateAccessToken(_ context.Context, requester fosite.Requester) (token string, signature string, err error)

func (*RS256JWTStrategy) GenerateAuthorizeCode

func (h *RS256JWTStrategy) GenerateAuthorizeCode(_ context.Context, requester fosite.Requester) (token string, signature string, err error)

func (*RS256JWTStrategy) GenerateRefreshToken

func (h *RS256JWTStrategy) GenerateRefreshToken(_ context.Context, requester fosite.Requester) (token string, signature string, err error)

func (RS256JWTStrategy) RefreshTokenSignature

func (h RS256JWTStrategy) RefreshTokenSignature(token string) string

func (*RS256JWTStrategy) ValidateAccessToken

func (h *RS256JWTStrategy) ValidateAccessToken(_ context.Context, _ fosite.Requester, token string) error

func (*RS256JWTStrategy) ValidateAuthorizeCode

func (h *RS256JWTStrategy) ValidateAuthorizeCode(_ context.Context, requester fosite.Requester, token string) error

func (*RS256JWTStrategy) ValidateRefreshToken

func (h *RS256JWTStrategy) ValidateRefreshToken(_ context.Context, _ fosite.Requester, token string) error

Jump to

Keyboard shortcuts

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