Documentation ¶
Index ¶
- func EmailDomain(email string) string
- func ValidateOptions(o config.Options) error
- type Authorize
- func (a *Authorize) Authorize(ctx context.Context, in *pb.Identity) (*pb.AuthorizeReply, error)
- func (a *Authorize) IsAdmin(ctx context.Context, in *pb.Identity) (*pb.IsAdminReply, error)
- func (a *Authorize) UpdateOptions(o config.Options) error
- func (a *Authorize) ValidIdentity(route string, identity *Identity) bool
- type Identity
- type IdentityValidator
- type MockIdentityValidator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EmailDomain ¶ added in v0.0.5
EmailDomain returns the domain portion of an email.
func ValidateOptions ¶ added in v0.0.5
ValidateOptions checks to see if configuration values are valid for the authorize service. Returns first error, if found.
Types ¶
type Authorize ¶
type Authorize struct { // contains filtered or unexported fields }
Authorize struct holds
func (*Authorize) Authorize ¶
Authorize validates the user identity, device, and context of a request for a given route. Currently only checks identity.
func (*Authorize) UpdateOptions ¶ added in v0.0.5
UpdateOptions updates internal structures based on config.Options
type Identity ¶
type Identity struct { User string Email string Groups []string // Impersonation ImpersonateEmail string ImpersonateGroups []string }
Identity contains a user's identity information.
func (*Identity) IsImpersonating ¶ added in v0.0.5
IsImpersonating returns whether the user is trying to impersonate another user email or group.
type IdentityValidator ¶
IdentityValidator provides an interface to check whether a user has access to a given route.
func NewIdentityWhitelist ¶
func NewIdentityWhitelist(policies []config.Policy, admins []string) IdentityValidator
NewIdentityWhitelist returns an indentity validator. todo(bdd) : a radix-tree implementation is probably more efficient
type MockIdentityValidator ¶
MockIdentityValidator is a mock implementation of IdentityValidator
func (*MockIdentityValidator) IsAdmin ¶ added in v0.0.5
func (mv *MockIdentityValidator) IsAdmin(i *Identity) bool
IsAdmin is a mock implementation IdentityValidator's IsAdmin method