authz

package
v0.0.0-...-dc8a31d Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Groups is an in-memory collection of groups
	Groups = map[string]*Group{}

	// Users is an in-memory collection of users
	Users = map[string]*User{}
)

Functions

func Load

func Load(fname string) error

Load loads the authz data onto memory

Types

type AccessControlRules

type AccessControlRules map[string]RoleMap

AccessControlRules is a mapping of resource name to the role map which governs access control for it

type Group

type Group struct {
	Roles []Role
}

Group represents privilege held by a group

type IdentitySet

type IdentitySet struct {
	Users  []string
	Groups []string
}

IdentitySet represents a set of identities

type ProtectedResource

type ProtectedResource struct {
	Name string
}

ProtectedResource represents a uniquely named, rbac-protected resource.

type Role

type Role struct {
	Name     string
	Resource string
}

Role represents a role with privilege over a resource

type RoleMap

type RoleMap map[string]IdentitySet

RoleMap is a map of role name to the set of identities which can assume the role

type User

type User struct {
	Roles  []Role
	Groups []*Group
}

User represents privilege held by a user

Jump to

Keyboard shortcuts

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