auth

package
v0.15.48 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HeaderHandler

func HeaderHandler(ac *Auth, next http.Handler) (http.HandlerFunc, error)

func IsAuth

func IsAuth(ct context.Context) bool

func JwtHandler

func JwtHandler(ac *Auth, next http.Handler) (http.HandlerFunc, error)

func RailsCookieHandler

func RailsCookieHandler(ac *Auth, next http.Handler) (http.HandlerFunc, error)

func RailsHandler

func RailsHandler(ac *Auth, next http.Handler) (http.HandlerFunc, error)

func RailsMemcacheHandler

func RailsMemcacheHandler(ac *Auth, next http.Handler) (http.HandlerFunc, error)

func RailsRedisHandler

func RailsRedisHandler(ac *Auth, next http.Handler) (http.HandlerFunc, error)

func SimpleHandler

func SimpleHandler(ac *Auth, next http.Handler) (http.HandlerFunc, error)

func WithAuth

func WithAuth(next http.Handler, ac *Auth) (http.Handler, error)

Types

type Auth

type Auth struct {
	Name          string
	Type          string
	Cookie        string
	CredsInHeader bool `mapstructure:"creds_in_header"`

	Rails struct {
		Version       string
		SecretKeyBase string `mapstructure:"secret_key_base"`
		URL           string
		Password      string
		MaxIdle       int `mapstructure:"max_idle"`
		MaxActive     int `mapstructure:"max_active"`
		Salt          string
		SignSalt      string `mapstructure:"sign_salt"`
		AuthSalt      string `mapstructure:"auth_salt"`
	}

	JWT struct {
		Provider   string
		Secret     string
		PubKeyFile string `mapstructure:"public_key_file"`
		PubKeyType string `mapstructure:"public_key_type"`
		Audience   string `mapstructure:"audience"`
	}

	Header struct {
		Name   string
		Value  string
		Exists bool
	}
}

Auth struct contains authentication related config values used by the Super Graph service

Jump to

Keyboard shortcuts

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