rbac

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 6 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GroupPermissions added in v0.1.14

type GroupPermissions struct {
	// ID is the unique, immutable project identifier.
	ID string `json:"id"`
	// Roles are the privileges a user has for the group.
	Roles []roles.Role `json:"roles"`
}

GroupPermissions are privilege grants for a project.

type OrganizationPermissions added in v0.1.14

type OrganizationPermissions struct {
	// IsAdmin allows the user to play with all resources in an organization.
	IsAdmin bool `json:"isAdmin,omitempty"`
	// Name is the name of the organization.
	Name string `json:"name"`
	// Groups are any groups the user belongs to in an organization.
	Groups []GroupPermissions `json:"groups,omitempty"`
}

OrganizationPermissions are privilege grants for an organization.

type Permissions added in v0.1.14

type Permissions struct {
	// IsSuperAdmin HAS SUPER COW POWERS!!!
	IsSuperAdmin bool `json:"isSuperAdmin,omitempty"`
	// Organizations are any organizations the user has access to.
	Organizations []OrganizationPermissions `json:"organizations,omitempty"`
}

Permissions are privilege grants for the entire system.

type RBAC

type RBAC struct {
	// contains filtered or unexported fields
}

RBAC contains all the scoping rules for services across the platform.

func New

func New(client client.Client, namespace string) *RBAC

New creates a new RBAC client.

func (*RBAC) GetOrganizatons added in v0.1.14

func (r *RBAC) GetOrganizatons(ctx context.Context) (*unikornv1.OrganizationList, error)

GetOrganizatons grabs all organizations for the system.

func (*RBAC) UserExists

func (r *RBAC) UserExists(ctx context.Context, email string) (bool, error)

UserExists is an optimized version of the permissions builder that is used to authorize authentication requests. Failure here means the user need to signup and register themselves with an organization uing a back-channel.

func (*RBAC) UserPermissions added in v0.1.14

func (r *RBAC) UserPermissions(ctx context.Context, email string) (*Permissions, error)

UserPermissions builds up a hierarchy of permissions for a user, this is used both internally and given out to resource servers via token introspection.

Jump to

Keyboard shortcuts

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