auth

package
v0.0.0-...-8472d0d Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2023 License: Apache-2.0 Imports: 20 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

View Source
var JWTTTL int

Functions

func AddAuthToRequest

func AddAuthToRequest(request *http.Request)

AddAuthToRequest to add authorization headers to a request. For use in a client

func AddAuthToRequestForUser

func AddAuthToRequestForUser(request *http.Request, userName string)

AddAuthToRequestForUser to add authorization headers to a request. For use in a client

func AuthenticateCASUser

func AuthenticateCASUser(next http.Handler) http.Handler

func AuthorizeRequest

func AuthorizeRequest(role, resourceType string, resourceID func(echo.Context) string) func(echo.HandlerFunc) echo.HandlerFunc

AuthorizeRequest is an echo middleware function that will check the authorization of a user for a specific resource.

func CheckHeaderBasedAuth

func CheckHeaderBasedAuth(next echo.HandlerFunc) echo.HandlerFunc

func CheckRolesForUser

func CheckRolesForUser(user string, accessKey string, role string, resourceID string, resourceType string) (bool, error)

CheckRolesForUser to check authorization of a user for a specific resource. For use in an endpoint receiving requests

func GetGroupsForUser

func GetGroupsForUser(user string) ([]string, *nerr.E)

GetGroupsForUser gets a list of groups that the user belongs to

func GetUsersByGroup

func GetUsersByGroup(group string) ([]structs.Person, *nerr.E)

GetUsersByGroup gets the list of users in a group

func LookupResourceFromAddress

func LookupResourceFromAddress(ctx echo.Context) string

LookupResourceFromAddress uses the ":address" parameter from the endpoint and returns the resourceID requested.

Types

This section is empty.

Jump to

Keyboard shortcuts

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