auth

package
v1.54.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2017 License: AGPL-3.0 Imports: 17 Imported by: 20

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeJWT

func DecodeJWT(rt *env.Runtime, tokenString string) (c domain.RequestContext, claims jwt.Claims, err error)

DecodeJWT decodes raw token.

func DecodeKeycloakJWT

func DecodeKeycloakJWT(t, pk string) (c jwt.MapClaims, err error)

DecodeKeycloakJWT takes in Keycloak token string and decodes it.

func FindJWT

func FindJWT(r *http.Request) (token string)

FindJWT looks for 'Authorization' request header OR query string "?token=XXX".

func GenerateJWT

func GenerateJWT(rt *env.Runtime, user, org, domain string) string

GenerateJWT generates JSON Web Token (http://jwt.io)

func StripAuthSecrets

func StripAuthSecrets(r *env.Runtime, provider, config string) string

StripAuthSecrets removes sensitive data from auth provider configuration

Types

type Handler

type Handler struct {
	Runtime *env.Runtime
	Store   *domain.Store
}

Handler contains the runtime information such as logging and database.

func (*Handler) Login

func (h *Handler) Login(w http.ResponseWriter, r *http.Request)

Login user based up HTTP Authorization header. An encrypted authentication token is issued with an expiry date.

func (*Handler) ValidateToken

func (h *Handler) ValidateToken(w http.ResponseWriter, r *http.Request)

ValidateToken finds and validates authentication token.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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