identitymanager

package
v0.1.17 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2018 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HTTPHeaderReqURI     = "X-Auth-Request-Redirect"
	HTTPHeaderOrigMethod = "X-Original-Method"
	HTTPHeaderEmail      = "X-Auth-Request-Email"
)

HTTP constants

Variables

View Source
var IdentityManagerFlags = struct {
	CookieName           string `long:"cookie-name" description:"The cookie name used to identify users" default:"_oauth2_proxy"`
	SkipAuth             bool   `long:"skip-auth" description:"Skips authorization, not to be used in production env"`
	BootstrapConfigPath  string `long:"bootstrap-config-path" description:"The path that contains the bootstrap keys" default:"/bootstrap"`
	DbFile               string `long:"db-file" description:"Backend DB URL/Path" default:"./db.bolt"`
	DbBackend            string `long:"db-backend" description:"Backend DB Name" default:"boltdb"`
	DbUser               string `long:"db-username" description:"Backend DB Username" default:"dispatch"`
	DbPassword           string `long:"db-password" description:"Backend DB Password" default:"dispatch"`
	DbDatabase           string `long:"db-database" description:"Backend DB Name" default:"dispatch"`
	ResyncPeriod         int    `long:"resync-period" description:"The time period (in seconds) to refresh policies" default:"30"`
	OAuth2ProxyAuthURL   string `` /* 152-byte string literal not displayed */
	ServiceAccountDomain string `long:"service-account-domain" description:"The default domain name to use for service accounts" default:"svc.dispatch.local"`
	OrgID                string `long:"organization" description:"(temporary) Static organization id" default:"dispatch"`
	Tracer               string `long:"tracer" description:"Open Tracing Tracer endpoint" default:""`
}{}

IdentityManagerFlags are configuration flags for the identity manager

Functions

func NewIdentityController added in v0.1.13

func NewIdentityController(store entitystore.EntityStore, enforcer *casbin.SyncedEnforcer) controller.Controller

NewIdentityController creates a new controller to manage the reconciliation of policy entities

func SetupEnforcer added in v0.1.13

func SetupEnforcer(store entitystore.EntityStore) *casbin.SyncedEnforcer

SetupEnforcer sets up the casbin enforcer

Types

type Action added in v0.1.13

type Action string

Action defines the type for an action

const (
	ActionGet    Action = "get"
	ActionCreate Action = "create"
	ActionUpdate Action = "update"
	ActionDelete Action = "delete"
)

Identity manager action constants

type CasbinEntityAdapter added in v0.1.13

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

CasbinEntityAdapter type

func NewCasbinEntityAdapter added in v0.1.13

func NewCasbinEntityAdapter(store entitystore.EntityStore) *CasbinEntityAdapter

NewCasbinEntityAdapter creates a new casbin entity adapter

func (*CasbinEntityAdapter) AddPolicy added in v0.1.13

func (a *CasbinEntityAdapter) AddPolicy(sec string, ptype string, rule []string) error

AddPolicy adds a policy rule to the storage.

func (*CasbinEntityAdapter) LoadPolicy added in v0.1.13

func (a *CasbinEntityAdapter) LoadPolicy(model casbinModel.Model) error

LoadPolicy loads a policy into the casbin entity adapter

func (*CasbinEntityAdapter) RemoveFilteredPolicy added in v0.1.13

func (a *CasbinEntityAdapter) RemoveFilteredPolicy(sec string, ptype string, fieldIndex int, fieldValues ...string) error

RemoveFilteredPolicy removes policy rules that match the filter from the storage.

func (*CasbinEntityAdapter) RemovePolicy added in v0.1.13

func (a *CasbinEntityAdapter) RemovePolicy(sec string, ptype string, rule []string) error

RemovePolicy removes a policy rule from the storage.

func (*CasbinEntityAdapter) SavePolicy added in v0.1.13

func (a *CasbinEntityAdapter) SavePolicy(model casbinModel.Model) error

SavePolicy saves all policy rules to the storage.

type Handlers

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

Handlers defines the interface for the identity manager handlers

func NewHandlers added in v0.1.13

func NewHandlers(watcher controller.Watcher, store entitystore.EntityStore, enforcer *casbin.SyncedEnforcer) *Handlers

NewHandlers create a new Policy Manager Handler

func (*Handlers) ConfigureHandlers

func (h *Handlers) ConfigureHandlers(api middleware.RoutableAPI)

ConfigureHandlers registers the identity manager handlers to the API

type Organization added in v0.1.16

type Organization struct {
	entitystore.BaseEntity
}

Organization is a data struct used to store organization (tenants) into entity store

type Policy added in v0.1.13

type Policy struct {
	entitystore.BaseEntity
	Rules []Rule `json:"rules"`
}

Policy is a data struct used to store policy into entity store

type Resource added in v0.1.13

type Resource string

Resource defines the type for a resource

const (
	ResourceIAM Resource = "iam"
)

Identity manager resources type constants

type Rule added in v0.1.13

type Rule struct {
	entitystore.BaseEntity
	Subjects  []string `json:"subjects"`
	Resources []string `json:"resources"`
	Actions   []string `json:"actions"`
}

Rule is a data struct to store rules within a policy

type ServiceAccount added in v0.1.13

type ServiceAccount struct {
	entitystore.BaseEntity
	PublicKey    string `json:"publicKey"`
	Domain       string `json:"domain"`
	JWTAlgorithm string `json:"jwtAlgorithm"`
}

ServiceAccount is a data struct used to store service accounts into entity store

Directories

Path Synopsis
gen
restapi
Package restapi Identity Manager VMware Dispatch Identity Manager
Package restapi Identity Manager VMware Dispatch Identity Manager

Jump to

Keyboard shortcuts

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