pkg

package
v0.10.0-alpha.19 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2017 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = &RichError{
		Status: http.StatusNotFound,
		error:  errors.New("Not found"),
	}
)
View Source
var HMACStrategy = &oauth2.HMACSHAStrategy{
	Enigma: &hmac.HMACStrategy{
		GlobalSecret: []byte("1234567890123456789012345678901234567890"),
	},
	AccessTokenLifespan:   time.Hour,
	AuthorizeCodeLifespan: time.Hour,
}

Functions

func CopyURL

func CopyURL(u *url.URL) *url.URL

func FositeStore

func FositeStore() *storage.MemoryStore

func GenerateSecret

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

func JoinURL

func JoinURL(u *url.URL, args ...string) (ep *url.URL)

func JoinURLStrings

func JoinURLStrings(host string, parts ...string) string

func LadonWarden

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

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 Retry

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

func SplitNonEmpty added in v0.8.7

func SplitNonEmpty(s, sep string) []string

SplitNonEmpty is a special case of strings.Split which returns an empty slice if string is empty

func Tokens

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

Types

type FositeStorer

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

	RevokeRefreshToken(ctx context.Context, requestID string) error

	RevokeAccessToken(ctx context.Context, requestID string) error
}

type RichError added in v0.8.6

type RichError struct {
	Status int
	// contains filtered or unexported fields
}

func (*RichError) StatusCode added in v0.8.6

func (e *RichError) StatusCode() int

Jump to

Keyboard shortcuts

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