Documentation ¶
Index ¶
- func ConvMultipleValues(dataType string, values interface{}) (interface{}, error)
- func ConvSingleValue(dataType string, value interface{}) (interface{}, error)
- func ConvValue(dataType string, value interface{}) (interface{}, error)
- func ConvertAPIPolicy2PolicyResponse(apiPolicy *adsapi.EvaluatedPolicy, policyResp *PolicyResponse)
- func ConvertAPIRolePolicy2RolePolicyResponse(apiRolePolicy *adsapi.EvaluatedRolePolicy, rolePolicyResp *RolePolicyResponse)
- func ConvertJSONRequestToContext(ctxContext *JsonContext) (*adsapi.RequestContext, error)
- func DumpPrincipals(principals []*JsonPrincipal) []*adsapi.Principal
- func DumpRequestAttributes(attrs []*JsonAttribute) (map[string]interface{}, error)
- func DuplicateAttributeMap(attrs map[string]interface{}) map[string]interface{}
- func NewRouter(evaluator eval.InternalEvaluator) (*mux.Router, error)
- func ParseDateTime(value string) (*time.Time, error)
- func VerifyAttributeName(attrName string) error
- type AuditEvaluationResult
- type EvaluatedCondition
- type EvaluationDebugResponse
- type IsAllowedResponse
- type JsonAttribute
- type JsonContext
- type JsonPrincipal
- type JsonSubject
- type Permission
- type PermissionResponse
- type PolicyResponse
- type RESTService
- func (e *RESTService) Diagnose(w http.ResponseWriter, r *http.Request)
- func (e *RESTService) Discover(w http.ResponseWriter, r *http.Request)
- func (e *RESTService) GetAllGrantedPermissions(w http.ResponseWriter, r *http.Request)
- func (e *RESTService) GetAllGrantedRoles(w http.ResponseWriter, r *http.Request)
- func (e *RESTService) IsAllowed(w http.ResponseWriter, r *http.Request)
- type RolePolicyResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvMultipleValues ¶
func ConvSingleValue ¶
func ConvertAPIPolicy2PolicyResponse ¶
func ConvertAPIPolicy2PolicyResponse(apiPolicy *adsapi.EvaluatedPolicy, policyResp *PolicyResponse)
func ConvertAPIRolePolicy2RolePolicyResponse ¶
func ConvertAPIRolePolicy2RolePolicyResponse(apiRolePolicy *adsapi.EvaluatedRolePolicy, rolePolicyResp *RolePolicyResponse)
func ConvertJSONRequestToContext ¶
func ConvertJSONRequestToContext(ctxContext *JsonContext) (*adsapi.RequestContext, error)
func DumpPrincipals ¶
func DumpPrincipals(principals []*JsonPrincipal) []*adsapi.Principal
func DumpRequestAttributes ¶
func DumpRequestAttributes(attrs []*JsonAttribute) (map[string]interface{}, error)
func DuplicateAttributeMap ¶
Types ¶
type AuditEvaluationResult ¶
type EvaluatedCondition ¶
type EvaluationDebugResponse ¶
type EvaluationDebugResponse struct { Allowed bool `json:"allowed"` Reason string `json:"reason"` RequestContext JsonContext `json:"requestContext,omitempty"` Attributes map[string]interface{} `json:"attributes,omitempty"` GrantedRoles []string `json:"grantedRoles,omitempty"` RolePolicies []RolePolicyResponse `json:"rolePolicies,omitempty"` Policies []PolicyResponse `json:"policies,omitempty"` }
Should we add Both of ReasonCode and ReasonMessage
type IsAllowedResponse ¶
type JsonAttribute ¶
type JsonContext ¶
type JsonContext struct { Subject *JsonSubject `json:"subject"` ServiceName string `json:"serviceName"` Resource string `json:"resource"` Action string `json:"action"` Attributes []*JsonAttribute `json:"attributes"` }
func DecodeJSONContext ¶
func DecodeJSONContext(r *http.Request) (*JsonContext, error)
type JsonPrincipal ¶
type JsonSubject ¶
type JsonSubject struct { Principals []*JsonPrincipal `json:"principals,omitempty"` TokenType string `json:"tokenType"` Token string `json:"token"` }
type Permission ¶
type PermissionResponse ¶
type PolicyResponse ¶
type PolicyResponse struct { Status string `json:"status,omitempty"` ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` Effect string `json:"effect,omitempty"` Permissions []Permission `json:"permissions,omitempty"` Principals [][]string `json:"principals,omitempty"` Condition EvaluatedCondition `json:"condition,omitempty"` }
type RESTService ¶
type RESTService struct {
Evaluator eval.InternalEvaluator
}
func NewRESTService ¶
func NewRESTService(conf *cfg.Config) (*RESTService, error)
func NewRESTServiceWithEvaluator ¶
func NewRESTServiceWithEvaluator(evaluator eval.InternalEvaluator) (*RESTService, error)
func (*RESTService) Diagnose ¶
func (e *RESTService) Diagnose(w http.ResponseWriter, r *http.Request)
func (*RESTService) Discover ¶
func (e *RESTService) Discover(w http.ResponseWriter, r *http.Request)
func (*RESTService) GetAllGrantedPermissions ¶
func (e *RESTService) GetAllGrantedPermissions(w http.ResponseWriter, r *http.Request)
func (*RESTService) GetAllGrantedRoles ¶
func (e *RESTService) GetAllGrantedRoles(w http.ResponseWriter, r *http.Request)
func (*RESTService) IsAllowed ¶
func (e *RESTService) IsAllowed(w http.ResponseWriter, r *http.Request)
type RolePolicyResponse ¶
type RolePolicyResponse struct { Status string `json:"status,omitempty"` ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` Effect string `json:"effect,omitempty"` Roles []string `json:"roles,omitempty"` Principals []string `json:"principals,omitempty"` Resources []string `json:"resources,omitempty"` ResourceExpressions []string `json:"resourceExpressions,omitempty"` Condition EvaluatedCondition `json:"condition,omitempty"` }
Click to show internal directories.
Click to hide internal directories.