x

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2020 License: Apache-2.0 Imports: 27 Imported by: 34

Documentation

Overview

* Copyright © 2015-2018 Aeneas Rekkas <aeneas+oss@aeneas.io> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @author Aeneas Rekkas <aeneas+oss@aeneas.io> * @copyright 2015-2018 Aeneas Rekkas <aeneas+oss@aeneas.io> * @license Apache-2.0 *

Index

Constants

View Source
const (
	OpenIDConnectKeyName = "hydra.openid.id-token"
	OAuth2JWTKeyName     = "hydra.jwt.access-token"
)

Variables

View Source
var (
	ErrNotFound = &fosite.RFC6749Error{
		Code:        http.StatusNotFound,
		Name:        http.StatusText(http.StatusNotFound),
		Description: "Unable to located the requested resource",
	}
	ErrConflict = &fosite.RFC6749Error{
		Code:        http.StatusConflict,
		Name:        http.StatusText(http.StatusConflict),
		Description: "Unable to process the requested resource because of conflict in the current state",
	}
)

Functions

func AddressIsUnixSocket

func AddressIsUnixSocket(address string) bool

func BasicAuth

func BasicAuth(username, password string) string

func CleanSQL

func CleanSQL(t *testing.T, db *sqlx.DB)

func FositeStore

func FositeStore() *storage.MemoryStore

func GenerateSecret

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

func HashByteSecret

func HashByteSecret(secret []byte) []byte

HashByteSecret hashes the secret for consumption by the AEAD encryption algorithm which expects exactly 32 bytes.

The system secret is being hashed to always match exactly the 32 bytes required by AEAD, even if the secret is long or shorter.

func HashStringSecret

func HashStringSecret(secret string) []byte

HashStringSecret hashes the secret for consumption by the AEAD encryption algorithm which expects exactly 32 bytes.

The system secret is being hashed to always match exactly the 32 bytes required by AEAD, even if the secret is long or shorter.

func IsRedirectURISecure

func IsRedirectURISecure(rc redirectConfiguration) func(redirectURI *url.URL) bool

func LogError

func LogError(err error, logger log.FieldLogger)

func MatchesRange

func MatchesRange(r *http.Request, ranges []string) error

func RejectInsecureRequests

func RejectInsecureRequests(reg tlsRegistry, c tlsConfig) negroni.HandlerFunc

Types

type BCrypt

type BCrypt struct {
	// contains filtered or unexported fields
}

BCrypt implements a BCrypt hasher.

func NewBCrypt

func NewBCrypt(c config) *BCrypt

NewBCrypt returns a new BCrypt instance.

func (*BCrypt) Compare

func (b *BCrypt) Compare(ctx context.Context, hash, data []byte) error

func (*BCrypt) Hash

func (b *BCrypt) Hash(ctx context.Context, data []byte) ([]byte, error)

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
}

type RegistryCookieStore

type RegistryCookieStore interface {
	CookieStore() sessions.Store
}

type RegistryLogger

type RegistryLogger interface {
	Logger() logrus.FieldLogger
}

type RegistryWriter

type RegistryWriter interface {
	Writer() herodot.Writer
}

type RouterAdmin

type RouterAdmin struct {
	*httprouter.Router
}

func NewRouterAdmin

func NewRouterAdmin() *RouterAdmin

func (*RouterAdmin) RouterPublic

func (r *RouterAdmin) RouterPublic() *RouterPublic

type RouterPublic

type RouterPublic struct {
	*httprouter.Router
}

func NewRouterPublic

func NewRouterPublic() *RouterPublic

func (*RouterPublic) RouterAdmin

func (r *RouterPublic) RouterAdmin() *RouterAdmin

Jump to

Keyboard shortcuts

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