Skip to content

Commit 2b47f19

Browse files
Create readme.md
1 parent 603cf30 commit 2b47f19

File tree

1 file changed

+19
-0
lines changed
  • Script Includes/SCIM Payload Generator

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
A script include to generate payload for testing SCIM-based integration.
2+
3+
The script covers as specific case where user is added/removed to user groups based on the values in the 'entitlements' object of the SCIM payload.
4+
5+
The main function accepts 3 parameters:
6+
- groupsToRemove - will check all groups of which the user is currently member and will randomly remove the membership of groups equal to the number passed to the parameter
7+
- groupsToAdd - will check all groups to which the is not currently a member and will randomly create membershis for groups equal to the number passed to the parameter
8+
- newGroupsToCreate - will create new groups and add the user to them. Group names are concatenation of a prefix and randomly generated string.
9+
10+
The end result of the function is a JSON object that can be directly passed as a payload while testing via REST API explorer or Postman.
11+
12+
Usage:
13+
var groupsToRemove = 2;
14+
var groupsToAdd = 1;
15+
var newGroupsToCreate = 3;
16+
17+
var generator = new GenerateSCIMPayload();
18+
var scimPayload = generator.generateEntitlements(jamesVittoloSysID, groupsToRemove, groupsToAdd, newGroupsToCreate);
19+
gs.info(JSON.stringify(scimPayload));

0 commit comments

Comments
 (0)