policytestsupport

package
v0.7.0-beta.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

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 MakeEmail

func MakeEmail(principalId string) string

func MakePolicies

func MakePolicies(actionMembers map[string][]string, resourceId string) []hexapolicy.PolicyInfo

func MakePolicyTestUser

func MakePolicyTestUser(emailNoPrefix string) string

func MakePolicyTestUsers

func MakePolicyTestUsers(actionMember ActionMembers) []string

func MakePrincipalEmailMap

func MakePrincipalEmailMap() map[string]string

func MakeRar

func MakeRar(actionAndRes string, roles []string) rar.ResourceActionRoles

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

type ActionMembers struct {
	MemberIds []string
	Emails    []string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL