auth

package
v0.0.0-...-af68207 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package auth contains implementation of authentication mechanism used to validate user credentials and create auth token.

Generated documentation is available at: https://godoc.org/github.com/RedHatInsights/insights-operator-ldapauth/auth

Documentation in literate-programming-style is available at: https://redhatinsights.github.io/insights-operator-ldapauth/packages/auth/auth.html

Index

Constants

View Source
const NoAccessMessage = "User has no rights to access"

NoAccessMessage - Error message for user with no access

Variables

This section is empty.

Functions

func Authenticate

func Authenticate(login, password, ldapHost string) (map[string]interface{}, error)

Authenticate - validate user credentials and create auth token

func GetTokenPasswordFromEnv

func GetTokenPasswordFromEnv() []byte

GetTokenPasswordFromEnv tries to read token password from the environment variable. Content of the variable (string) is converted into array of bytes to be usable.

Types

type Account

type Account struct {
	Login    string `json:"login"`
	Password string `json:"password"`
	Token    string `json:"token"`
}

Account a struct to rep user account

type Token

type Token struct {
	Login string
	jwt.StandardClaims
}

Token JWT claims struct

Jump to

Keyboard shortcuts

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