Documentation ¶
Overview ¶
Package accessctl implements access control for an Oasis node.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Policy ¶
Policy maps from Actions to a mapping from Subjects to booleans indicating whether the given subject is allowed to perform the given action or not.
The policy is not safe for concurrent use.
func (Policy) Allow ¶
Allow adds a policy rule that allows the given Subject to perform the given Action.
func (Policy) AllowAll ¶ added in v0.2100.0
AllowAll adds a policy rule that allows anyone to perform the given action. The effect is similar as defining the action to have no access control, but is better suited for configuration that depends on runtime parameters.
func (Policy) Deny ¶
Deny removes a policy rule that allows the given Subject to perform the given Action.
type Subject ¶
type Subject string
Subject is an access control subject.
const AnySubject Subject = "*"
AnySubject is a wildcard subject. When set for an action in a policy, it matches any subject.
func SubjectFromPublicKey ¶
SubjectFromPublicKey returns a Subject from the given public key.
func SubjectFromX509Certificate ¶
func SubjectFromX509Certificate(cert *x509.Certificate) Subject
SubjectFromX509Certificate returns a Subject from the given X.509 certificate.