Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var System = system{}
System defines a singleton principal that can be used to bypass security checks. e.g. internal service to service interactions
View Source
var SystemSubject = systemSubject{[]any{System}}
Functions ¶
func Credentials ¶ added in v0.30.2
Credentials configures a Subject with initial credentials.
func HasAllPrincipals ¶ added in v0.30.2
HasAllPrincipals return true if the subject possess all principals.
func HasAnyPrincipals ¶ added in v0.30.2
HasAnyPrincipals return true if the subject possess any principals.
func Principals ¶ added in v0.30.2
Principals configures a Subject with initial principals.
Types ¶
type Group ¶ added in v0.30.2
type Group struct {
Name string
}
Group organizes users having common capabilities.
type Subject ¶
type Subject interface { // Principals return the identities of this Subject. // e.g. UserId, Username, Group or Role Principals() []any // Credentials return security-related attributes of this Subject. // e.g. passwords, certificates, claims Credentials() []any // AddPrincipals adds the principals if not present. AddPrincipals(ps ...any) // AddCredentials add credentials if not present. AddCredentials(cs ...any) }
Subject is any entity that requests access to a resource. e.g. Process, Machine, Service or User
func NewSubject ¶ added in v0.30.2
NewSubject creates a new Subject with optional principals and credentials.
Click to show internal directories.
Click to hide internal directories.