Documentation
¶
Index ¶
- Constants
- func MapToJson(m map[string]interface{}) string
- type Action
- type AllTenantsCheckResponse
- type AssignedRole
- type CheckRequest
- func NewBulkCheckRequest(requests ...CheckRequest) []CheckRequest
- func NewBulkCheckRequestParameterized(user []User, action []Action, resource []Resource, context []map[string]string) ([]CheckRequest, error)
- func NewCheckRequest(user User, action Action, resource Resource, context map[string]string) *CheckRequest
- type CheckResponse
- type PermitBaseEnforcer
- type PermitEnforcer
- type Resource
- type TenantDetails
- type User
Constants ¶
View Source
const ( DefaultTenant = "default" DefaultTimeout = 30 AllowKey = "allow" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AllTenantsCheckResponse ¶ added in v0.0.14
type AllTenantsCheckResponse struct {
CheckResponse
Tenant TenantDetails `json:"tenant"`
}
type AssignedRole ¶
type CheckRequest ¶
type CheckRequest struct {
User User `json:"user"`
Action Action `json:"action"`
Resource Resource `json:"resource"`
Context map[string]string `json:"context"`
}
func NewBulkCheckRequest ¶ added in v0.0.14
func NewBulkCheckRequest(requests ...CheckRequest) []CheckRequest
func NewBulkCheckRequestParameterized ¶ added in v0.0.14
func NewCheckRequest ¶
type CheckResponse ¶
type PermitBaseEnforcer ¶
type PermitBaseEnforcer struct {
// contains filtered or unexported fields
}
type PermitEnforcer ¶
type PermitEnforcer struct {
PermitBaseEnforcer
}
func NewPermitEnforcerClient ¶
func NewPermitEnforcerClient(config *config.PermitConfig) *PermitEnforcer
func (*PermitEnforcer) AllTenantsCheck ¶ added in v0.0.14
func (e *PermitEnforcer) AllTenantsCheck(user User, action Action, resource Resource, additionalContext ...map[string]string) ([]TenantDetails, error)
func (*PermitEnforcer) BulkCheck ¶ added in v0.0.14
func (e *PermitEnforcer) BulkCheck(requests ...CheckRequest) ([]bool, error)
type Resource ¶
type Resource struct {
Type string `json:"type,omitempty"`
ID string `json:"id,omitempty"`
Tenant string `json:"tenant,omitempty"`
Attributes map[string]string `json:"attributes,omitempty"`
Context map[string]string `json:"context,omitempty"`
}
func ResourceBuilder ¶
func (*Resource) WithAttributes ¶
func (*Resource) WithTenant ¶
type TenantDetails ¶ added in v0.0.14
type User ¶
type User struct {
Key string `json:"key,omitempty"`
FirstName string `json:"first_name,omitempty"`
LastName string `json:"last_name,omitempty"`
Email string `json:"email,omitempty"`
Roles []AssignedRole `json:"roles,omitempty"`
Attributes map[string]string `json:"attributes,omitempty"`
}
func UserBuilder ¶
func (*User) WithFirstName ¶
func (*User) WithLastName ¶
func (*User) WithRoles ¶
func (u *User) WithRoles(roles []AssignedRole) *User
Click to show internal directories.
Click to hide internal directories.