Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultTenant = "default" DefaultTimeout = 30 AllowKey = "allow" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
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 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
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 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.