Documentation ¶
Index ¶
Constants ¶
View Source
const ( UndefinedAuthz AuthzDecision = iota AllowedAuthz AuthzDecision = iota DeniedAuthz AuthzDecision = iota DeniedAuthzString string = "Denied" AllowedAuthzString string = "Allowed" UndefinedAuthzString string = "Undefined" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthzDecision ¶
type AuthzDecision int
func (AuthzDecision) String ¶
func (decision AuthzDecision) String() string
type KeycloakAuthorizationProvider ¶
type KeycloakAuthorizationProvider struct {
// contains filtered or unexported fields
}
func (*KeycloakAuthorizationProvider) Authorize ¶
func (p *KeycloakAuthorizationProvider) Authorize() (AuthzDecision, error)
func (*KeycloakAuthorizationProvider) GenerateUMATicket ¶
func (p *KeycloakAuthorizationProvider) GenerateUMATicket() (string, error)
type OpaAuthorizationProvider ¶
type OpaAuthorizationProvider struct {
// contains filtered or unexported fields
}
func (*OpaAuthorizationProvider) Authorize ¶
func (p *OpaAuthorizationProvider) Authorize() (AuthzDecision, error)
type OpaAuthzRequest ¶
type OpaAuthzRequest struct {
Input *OpaInput `json:"input"`
}
type OpaAuthzResponse ¶
type OpaAuthzResponse struct {
Result bool `json:"result"`
}
type Provider ¶
type Provider interface {
Authorize() (AuthzDecision, error)
}
type Resource ¶
type Resource struct { // URL the url for the resource URL string `json:"uri" yaml:"uri"` // Methods the method type Methods []string `json:"methods" yaml:"methods"` // WhiteListed permits the prefix through WhiteListed bool `json:"white-listed" yaml:"white-listed"` // RequireAnyRole indicates that ANY of the roles are required, the default is all RequireAnyRole bool `json:"require-any-role" yaml:"require-any-role"` // Headers required to access this url Headers []string `json:"headers" yaml:"headers"` // Roles the roles required to access this url Roles []string `json:"roles" yaml:"roles"` // Groups is a list of groups the user is in Groups []string `json:"groups" yaml:"groups"` // Acr (Authentication Context Class Reference) is a list of allowed levels of authentication for user Acr []string `json:"acr" yaml:"acr"` }
Resource represents a url resource to protect
func NewResource ¶
func NewResource() *Resource
func (Resource) GetHeaders ¶
GetHeaders returns a list of headers for this resource
Click to show internal directories.
Click to hide internal directories.