Documentation ¶
Overview ¶
Package clauthz provides Authorization (AuthZ) functionality.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BundleProvide ¶
BundleProvide provides a bundle server.
Types ¶
type Authz ¶
type Authz struct {
// contains filtered or unexported fields
}
Authz provides authn and authz functionality. It includes a simple web server that serves our policy bundle on a random port on localhost.
func (*Authz) IsAuthorized ¶
IsAuthorized the user for a given setup.
type BundleFS ¶
BundleFS declares a type to carry the fs.FS that holds the OPA bundle as pre-build tar.gz.
type BundleServer ¶
type BundleServer interface {
URL() string
}
BundleServer interface defines the server that bundles will be fetched from. In case of a remove bundle server the Start and Stop can do nothing.
type Config ¶
type Config struct { // id for the system that is unning OPA. OPASystemID string `env:"OPA_SYSTEM_ID" envDefault:"auth"` }
Config configures the package.
type FSBundles ¶
type FSBundles struct {
// contains filtered or unexported fields
}
FSBundles implements a bundle server that reads a tar.gz from the filesystem. Possibly through embedding it in the binary.
func NewFSBundles ¶
NewFSBundles inits the bundle server.
type MockBundle ¶
MockBundle is a type that can be supplied to easily define policies in tests.
type MockBundles ¶
MockBundles provides a bundle server that is easy to use for test.
func NewMockBundles ¶
func NewMockBundles(mb MockBundle) (bs *MockBundles, err error)
NewMockBundles inits a bundle server.