Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrGetPermissionsResponseBodyNil error used when a nil response is returned from the permissions API. ErrGetPermissionsResponseBodyNil = errors.New("error creating get permissions request http.Request required but was nil") // ErrFailedToParsePermissionsResponse error used when an unexpected response body is returned from the permissions API and it fails to parse. ErrFailedToParsePermissionsResponse = errors.New("error parsing permissions bundle response body") // ErrNotCached error error used when permissions are not found in the cache. ErrNotCached = errors.New("permissions bundle not found in the cache") )
Functions ¶
This section is empty.
Types ¶
type APIClient ¶
type APIClient struct {
// contains filtered or unexported fields
}
APIClient implementation of permissions.Store that gets permission data from the permissions API
func NewClient ¶
NewClient constructs a new APIClient instance with a default http client and Options.
func NewClientWithClienter ¶
func NewClientWithClienter(host string, httpClient HTTPClient, opts Options) *APIClient
NewClientWithClienter constructs a new APIClient instance.
func NewClientWithOptions ¶
NewClientWithOptions returns a new APIClient with default http
type Bundle ¶
type Bundle map[string]EntityIDToPolicies
Bundle is the optimised lookup table for permissions.
type Condition ¶
type Condition struct {
Attribute string `json:"attribute"`
Operator Operator `json:"operator"`
Values []string `json:"values"`
}
Condition is used within a policy to match additional attributes.
type EntityData ¶
EntityData groups the different entity types into a single parameter
type EntityIDToPolicies ¶
EntityIDToPolicies maps an entity ID to a slice of policies.
type HTTPClient ¶
HTTPClient is the interface that defines a client for making HTTP requests
type Operator ¶
type Operator string
Operator is used to define a set of supported Condition operators