iamregistry

package
v0.52.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: MIT Imports: 5 Imported by: 1

Documentation

Overview

Package iamregistry provides data structures for resolving IAM roles and permissions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Roles

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

Roles are a set of roles.

func NewRoles

func NewRoles(roles ...*adminpb.Role) (*Roles, error)

NewRoles creates a set of Roles from a pre-defined roles annotation.

func (*Roles) Count

func (r *Roles) Count() int

Count returns a count of the roles.

func (*Roles) FindRoleByName

func (r *Roles) FindRoleByName(name string) (*adminpb.Role, bool)

FindRoleByName looks up a role by resource name.

func (*Roles) RangeRoles

func (r *Roles) RangeRoles(fn func(*adminpb.Role) bool)

RangeRoles iterates over all registered roles while f returns true. The iteration order is undefined.

func (*Roles) RangeRolesByPermission

func (r *Roles) RangeRolesByPermission(permission string, fn func(*adminpb.Role) bool)

RangeRolesByPermission iterates over all registered roles with the provided permission while f returns true. The iteration order is undefined, and permissions with wildcards are not allowed.

func (*Roles) RoleHasPermission

func (r *Roles) RoleHasPermission(name, permission string) bool

RoleHasPermission checks whether the role with the provided name has the provided permission.

Jump to

Keyboard shortcuts

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