authentication

package
v0.0.0-...-9b02830 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EXPIRATION_TIME = MinExpirationTime
View Source
var LDAP_PORT = "389"
View Source
var MinExpirationTime = 30
View Source
var MinSizeSigningKey = 10
View Source
var SERVICE_NAME = "authentication"
View Source
var SIGNING_KEY = "AllYourBase"

Functions

func AdminRequiredMiddleware

func AdminRequiredMiddleware(c *routing.Context) error

func AuthenticateWithLDAP

func AuthenticateWithLDAP(email string, password string) bool

func AuthorizationMiddleware

func AuthorizationMiddleware(c *routing.Context) error

func CheckUserMiddleware

func CheckUserMiddleware(c *routing.Context) error

func GenerateToken

func GenerateToken(username string, password string) (string, error)

func GetAuthenticatedUser

func GetAuthenticatedUser(c *routing.Context) userModels.User

func GetUserFromToken

func GetUserFromToken(c *routing.Context) (jwt.MapClaims, error)

func InitGAPIAuthenticationServer

func InitGAPIAuthenticationServer()

func LdapUserCreateOrUpdate

func LdapUserCreateOrUpdate(user userModels.User)

func NotAuthorized

func NotAuthorized(c *routing.Context) error

func OAuthClientRequiredMiddleware

func OAuthClientRequiredMiddleware(c *routing.Context) error

func UserNotAllowed

func UserNotAllowed(c *routing.Context) error

func ValidateToken

func ValidateToken(tokenString string) (jwt.MapClaims, error)

func ValidateUserCredentials

func ValidateUserCredentials(username string, password string) (userModels.User, error)

Types

type TokenCustomClaims

type TokenCustomClaims struct {
	Username string `json:"Username"`
	jwt.StandardClaims
}

type TokenRequestObj

type TokenRequestObj struct {
	Username string `json:username`
	Password string `json:password`
}

Jump to

Keyboard shortcuts

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