policytestsupport

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 License: Apache-2.0 Imports: 9 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 []policysupport.PolicyInfo, actPolicies []policysupport.PolicyInfo) bool

func HasPolicy

func HasPolicy(expPolicies []policysupport.PolicyInfo, act policysupport.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) []policysupport.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) providerscommon.ResourceActionRoles

func MakeRarList

func MakeRarList(retActionRoles map[string][]string) []providerscommon.ResourceActionRoles

func MakeRoleSubjectTestPolicies

func MakeRoleSubjectTestPolicies(actionMembers map[string][]string) []policysupport.PolicyInfo

MakeRoleSubjectTestPolicies - makes policies with passed in param actionMembers = { "GET/humanresources/us": ["role1", "role2"] }

func MakeRoleSubjectTestPolicy

func MakeRoleSubjectTestPolicy(resourceId string, action string, roles []string) policysupport.PolicyInfo

func MakeTestPolicies

func MakeTestPolicies(actionMembers map[string]ActionMembers) []policysupport.PolicyInfo

func MakeTestPolicy

func MakeTestPolicy(resourceId string, action string, actionMembers ActionMembers) policysupport.PolicyInfo

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