auth

package
v1.5.17 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Debug = env.GetBool("DEBUG", false)
	Host  = env.GetString("AUTH_HOST", "https://auth.toscale.io")
)

Functions

func IsAdmin added in v1.5.15

func IsAdminFiber added in v1.5.15

func IsAdminFiber(c *fiber.Ctx) error

func ValidateAdminPermissions added in v1.5.15

func ValidateAdminPermissions(next fasthttp.RequestHandler, serviceName string) fasthttp.RequestHandler

func VerifyAdmin

func VerifyAdmin(ctx *fasthttp.RequestCtx, host string) (uint64, error)

func VerifyAdminFiber added in v1.5.1

func VerifyAdminFiber(c *fiber.Ctx, host string) (uint64, error)

func VerifyUserFiber added in v1.5.13

func VerifyUserFiber(c *fiber.Ctx, host string) (uint64, error)

Types

type TotalAdminPermission added in v1.5.8

type TotalAdminPermission struct {
	IsAvailableTools          bool `json:"tools,omitempty"`
	IsAvailableTerminals      bool `json:"terminals,omitempty"`
	IsAvailableUsers          bool `json:"users,omitempty"`
	IsAvailableBackendTesting bool `json:"backendTesting,omitempty"`
	IsAvailableDocumentation  bool `json:"documentation,omitempty"`
	IsAvailableInsights       bool `json:"insights,omitempty"`
	IsAvailableBalancer       bool `json:"balancer,omitempty"`
	IsAvailableNews           bool `json:"news,omitempty"`
	IsAvailableTwitter        bool `json:"twitter,omitempty"`
	IsAvailableForex          bool `json:"forex,omitempty"`
	IsAvailableLanguages      bool `json:"languages,omitempty"`
}

func FetchAdminPermissions added in v1.5.8

func FetchAdminPermissions(ctx *fasthttp.RequestCtx, host string) (perms TotalAdminPermission, err error)

func GetAdminPermissions added in v1.5.15

func GetAdminPermissions(ctx *fasthttp.RequestCtx) (permissions TotalAdminPermission, err error)

Jump to

Keyboard shortcuts

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