entities

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const AnonymousRole = "anonymous"

Variables

This section is empty.

Functions

This section is empty.

Types

type OpAction

type OpAction string
var ActionDelete OpAction = "delete"
var ActionDestroy OpAction = "destroy"
var ActionRead OpAction = "read"
var ActionSign OpAction = "sign"
var ActionWrite OpAction = "write"

type OpResource

type OpResource string
var ResourceWallets OpResource = "wallets"

type Operation

type Operation struct {
	Action   OpAction
	Resource OpResource
}

type Permission

type Permission string
const DeleteWallet Permission = "delete:wallets"
const DestroyWallet Permission = "destroy:wallets"
const ReadWallet Permission = "read:wallets"
const SignWallet Permission = "sign:wallets"
const WriteWallet Permission = "write:wallets"

func ListPermissions

func ListPermissions() []Permission

func ListWildcardPermission

func ListWildcardPermission(p string) []Permission

type Role

type Role struct {
	Name        string
	Permissions []Permission
}

type RoleSpecs

type RoleSpecs struct {
	Permissions []Permission `json:"permission"`
}

type UserClaims

type UserClaims struct {
	Tenant      string
	Permissions []string
	Roles       []string
}

UserClaims represent raw claims extracted from an authentication method

type UserInfo

type UserInfo struct {
	// AuthMode records the mode that succeeded to Authenticate the request ('tls', 'api-key', 'oidc' or ”)
	AuthMode string

	// Tenant belonged by the user
	Tenant string

	// Tenant identifies the user
	Username string

	// Roles indicates the user's membership
	Roles []string

	// Permissions specify
	Permissions []Permission
}

func NewAnonymousUser

func NewAnonymousUser() *UserInfo

func NewWildcardUser

func NewWildcardUser() *UserInfo

Jump to

Keyboard shortcuts

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