authz

package
v0.0.0-...-2e58fa2 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

README

Authorization

This package currently has two authorizer implementations: one that allows full access and another that calls a kessel relations-api service.

We're committed to the relations-api as the authorizer interface. I don't see a need at this time for higher abstraction or a delegation design like in authn.

Documentation

Index

Constants

View Source
const (
	AllowAll     = "allow-all"
	Kessel       = "kessel"
	RelationsAPI = "kessel-relations"
)

Variables

This section is empty.

Functions

func CheckAuthorizer

func CheckAuthorizer(config CompletedConfig) string

func New

func New(ctx context.Context, config CompletedConfig, logger *log.Helper) (api.Authorizer, error)

Types

type CompletedConfig

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

type Config

type Config struct {
	Authz  string
	Kessel *kessel.Config
}

func NewConfig

func NewConfig(o *Options) *Config

func (*Config) Complete

func (c *Config) Complete(ctx context.Context) (CompletedConfig, []error)

type Options

type Options struct {
	Authz  string          `mapstructure:"impl"`
	Kessel *kessel.Options `mapstructure:"kessel"`
}

TODO: presumably more will go here to authenticate Common Inventory as a service to call Kessel.

func NewOptions

func NewOptions() *Options

func (*Options) AddFlags

func (o *Options) AddFlags(fs *pflag.FlagSet, prefix string)

func (*Options) Complete

func (o *Options) Complete() []error

func (*Options) Validate

func (o *Options) Validate() []error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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