Documentation ¶
Index ¶
- Constants
- Variables
- func ContainsPolicies(t *testing.T, expPolicies []hexapolicy.PolicyInfo, ...) bool
- func HasPolicy(expPolicies []hexapolicy.PolicyInfo, act hexapolicy.PolicyInfo) bool
- func MakeActionMembers() map[string]ActionMembers
- func MakeEmail(principalId string) string
- func MakePolicies(actionMembers map[string][]string, resourceId string) []hexapolicy.PolicyInfo
- func MakePolicyTestUser(emailNoPrefix string) string
- func MakePolicyTestUsers(actionMember ActionMembers) []string
- func MakePrincipalEmailMap() map[string]string
- func MakeRar(actionAndRes string, roles []string) rar.ResourceActionRoles
- func MakeRarList(retActionRoles map[string][]string) []rar.ResourceActionRoles
- func MakeRoleSubjectTestPolicies(actionMembers map[string][]string) []hexapolicy.PolicyInfo
- func MakeRoleSubjectTestPolicy(resourceId string, action string, roles []string) hexapolicy.PolicyInfo
- func MakeTestPolicies(actionMembers map[string]ActionMembers) []hexapolicy.PolicyInfo
- func MakeTestPolicy(resourceId string, action string, actionMembers ActionMembers) hexapolicy.PolicyInfo
- func MatchPolicy(exp hexapolicy.PolicyInfo, act hexapolicy.PolicyInfo) bool
- type ActionMembers
Constants ¶
View Source
const ActionGetHrUs = "GET/humanresources/us"
View Source
const ActionGetProfile = "GET/profile"
View Source
const PolicyObjectResourceId = "some-resource-id"
View Source
const ResourceHrUs = "/humanresources/us"
View Source
const ResourceProfile = "/profile"
View Source
const UserIdGetHrUs = "get-hr-us-user-id"
View Source
const UserIdGetHrUsAndProfile = "get-hr-us-profile-user-id"
View Source
const UserIdGetProfile = "get-profile-user-id"
View Source
const UserIdUnassigned1 = "unassigned-user-id-1"
View Source
const UserIdUnassigned2 = "unassigned-user-id-2"
Variables ¶
View Source
var UserEmailGetHrUs = MakeEmail(UserIdGetHrUs)
View Source
var UserEmailGetHrUsAndProfile = MakeEmail(UserIdGetHrUsAndProfile)
View Source
var UserEmailGetProfile = MakeEmail(UserIdGetProfile)
Functions ¶
func ContainsPolicies ¶
func ContainsPolicies(t *testing.T, expPolicies []hexapolicy.PolicyInfo, actPolicies []hexapolicy.PolicyInfo) bool
func HasPolicy ¶
func HasPolicy(expPolicies []hexapolicy.PolicyInfo, act hexapolicy.PolicyInfo) bool
func MakeActionMembers ¶
func MakeActionMembers() map[string]ActionMembers
func MakePolicies ¶
func MakePolicies(actionMembers map[string][]string, resourceId string) []hexapolicy.PolicyInfo
func MakePolicyTestUser ¶
func MakePolicyTestUsers ¶
func MakePolicyTestUsers(actionMember ActionMembers) []string
func MakePrincipalEmailMap ¶
func MakeRarList ¶
func MakeRarList(retActionRoles map[string][]string) []rar.ResourceActionRoles
func MakeRoleSubjectTestPolicies ¶
func MakeRoleSubjectTestPolicies(actionMembers map[string][]string) []hexapolicy.PolicyInfo
MakeRoleSubjectTestPolicies - makes policies with passed in param actionMembers = { "GET/humanresources/us": ["role1", "role2"] }
func MakeRoleSubjectTestPolicy ¶
func MakeRoleSubjectTestPolicy(resourceId string, action string, roles []string) hexapolicy.PolicyInfo
func MakeTestPolicies ¶
func MakeTestPolicies(actionMembers map[string]ActionMembers) []hexapolicy.PolicyInfo
func MakeTestPolicy ¶
func MakeTestPolicy(resourceId string, action string, actionMembers ActionMembers) hexapolicy.PolicyInfo
func MatchPolicy ¶
func MatchPolicy(exp hexapolicy.PolicyInfo, act hexapolicy.PolicyInfo) bool
Types ¶
type ActionMembers ¶
Click to show internal directories.
Click to hide internal directories.