argo-web-api: github.com/ARGOeu/argo-web-api/utils/authentication Index | Files

package authentication

import "github.com/ARGOeu/argo-web-api/utils/authentication"

Index

Package Files

authenticate.go

func Authenticate Uses

func Authenticate(h http.Header, cfg config.Config) bool

func AuthenticateAdmin Uses

func AuthenticateAdmin(h http.Header, cfg config.Config) bool

AuthenticateAdmin is used to authenticate and administrator of ARGO and allow further CRUD ops wrt the argo_core database (i.e. add a new tenant, modify another tenant's configuration etc)

func AuthenticateTenant Uses

func AuthenticateTenant(h http.Header, cfg config.Config) (config.MongoConfig, string, error)

AuthenticateTenant is used to find which tenant the user making the requests belongs to and return the database configuration for that specific tenant. If the api-key in the request is not found in any tenant an empty configuration is returned along with an error

func IsAdminRestricted Uses

func IsAdminRestricted(h http.Header, cfg config.Config) bool

IsAdminRestricted resturns a boolean value if an admin user is in restricted mode or not. Admin user in restricted mode has read only access to certain calls

type Auth Uses

type Auth struct {
    ApiKey     string `bson:"api_key"`
    Restricted bool   `bson:"restricted"`
}

type InfoStruct Uses

type InfoStruct struct {
    Name string `bson:"name"`
}

type Tenant Uses

type Tenant struct {
    Info InfoStruct `bson:"info"`
}

Package authentication imports 6 packages (graph) and is imported by 14 packages. Updated 2018-11-06. Refresh now. Tools for package owners.