security

package
v0.30.1 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: MIT Imports: 0 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Principal

type Principal interface {
	// Name returns the name of this Principal.
	Name() string
}

Principal represents an identity of a Subject. e.g. UserId, Username, Account or Role

type Role

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

Role represents a certain level of authorization and correspond to one or more privileges in a system.

func NewRole

func NewRole(name string) Role

NewRole returns a new Role with `name`.

func (Role) Name

func (r Role) Name() string

type Subject

type Subject interface {
	// Principals returns identities of this Subject
	Principals() []Principal

	// Credentials return security-related attributes of this Subject.
	Credentials() []any
}

Subject is any entity that requests access to a resource. e.g. Process, Machine, Service or User

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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