pkg

package
v1.0.0-beta.9 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2018 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = &fosite.RFC6749Error{
		Code:        http.StatusNotFound,
		Name:        http.StatusText(http.StatusNotFound),
		Description: "Unable to located the requested resource",
	}
)
View Source
var HMACStrategy = &oauth2.HMACSHAStrategy{
	Enigma: &hmac.HMACStrategy{
		GlobalSecret: []byte("1234567890123456789012345678901234567890"),
	},
	AccessTokenLifespan:   time.Hour,
	AuthorizeCodeLifespan: time.Hour,
}

Functions

func BasicAuth added in v0.11.10

func BasicAuth(username, password string) string

func FositeStore

func FositeStore() *storage.MemoryStore

func GenerateSecret

func GenerateSecret(length int) ([]byte, error)

func LadonWarden

func LadonWarden(ps map[string]ladon.Policy) ladon.Warden

func LoadJSONWebKey

func LoadJSONWebKey(json []byte, pub bool) (*jose.JSONWebKey, error)

func LoadPrivateKey

func LoadPrivateKey(data []byte) (interface{}, error)

LoadPrivateKey loads a private key from PEM/DER/JWK-encoded data.

func LoadPublicKey

func LoadPublicKey(data []byte) (interface{}, error)

LoadPublicKey loads a public key from PEM/DER/JWK-encoded data.

func LogError

func LogError(err error, logger log.FieldLogger)

func Must

func Must(err error, message string, args ...interface{})

func MustINSECURELOWENTROPYRSAKEYFORTEST added in v0.10.0

func MustINSECURELOWENTROPYRSAKEYFORTEST() *rsa.PrivateKey

func PermanentRedirect

func PermanentRedirect(to string) func(rw http.ResponseWriter, r *http.Request, _ httprouter.Params)

func Retry

func Retry(logger logrus.FieldLogger, maxWait time.Duration, failAfter time.Duration, f func() error) (err error)

func Tokens

func Tokens(length int) (res [][]string)

Types

type FositeStorer

type FositeStorer interface {
	fosite.Storage
	oauth2.CoreStorage
	openid.OpenIDConnectRequestStorage
	pkce.PKCERequestStorage

	RevokeRefreshToken(ctx context.Context, requestID string) error

	RevokeAccessToken(ctx context.Context, requestID string) error

	FlushInactiveAccessTokens(ctx context.Context, notAfter time.Time) error
}

Jump to

Keyboard shortcuts

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