auth

package
v2.5.1+incompatible Latest Latest
Warning

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

Go to latest
Published: May 16, 2019 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddExternalUser added in v1.70.0

func AddExternalUser(ctx domain.RequestContext, rt *env.Runtime, store *store.Store, u user.User, addSpace bool) (nu user.User, err error)

AddExternalUser method to setup user account in Documize using Keycloak/LDAP provided user data.

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   *store.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. TODO: remove

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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