authentication

package
v1.14.1 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2025 License: Apache-2.0, Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authenticate

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

func AuthenticateAdmin

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

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

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

func IsSuperAdminUI

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

IsSuperAdminUI resturns a boolean value if the user is a dedicated super admin ui service user

Types

type Auth

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

type DbConfItem

type DbConfItem struct {
	Store    string `bson:"store"`
	Server   string `bson:"server"`
	Port     int    `bson:"port"`
	Database string `bson:"database"`
	Username string `bson:"username"`
	Password string `bson:"password"`
}

type DbInfoUsers

type DbInfoUsers struct {
	Info   Info         `bson:"info"`
	DbConf []DbConfItem `bson:"db_conf"`
	Users  []UserItem   `bson:"users"`
}

type Info

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

type InfoStruct

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

type Tenant

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

type UserItem

type UserItem struct {
	Id     string   `bson:"id"`
	Name   string   `bson:"name"`
	Email  string   `bson:"email"`
	ApiKey string   `bson:"api_key"`
	Roles  []string `bson:"roles"`
}

Jump to

Keyboard shortcuts

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