I noticed that some off-the-shelf SaaS connectors include a directPermissions property in their entitlement metadata, and I was curious how I could include this in my own SaaS connector? From what I can tell, it’s not documented, and the only example I can see is @colin_mckibben’s SaaS connector
Specifically, here in the std:entitlement:list
.stdEntitlementList(async (context: Context, input: any, res: Response<StdEntitlementListOutput>) => {
const response1 = await client.getRoles()
for (const gr of response1.data) {
const group: Group = new Group(gr)
const response2 = await client.getRoleDuties(group.identity)
const duties = new Set<string>(response2.data.map((x: { name: string }) => x.name))
group.attributes.duties = Array.from(duties).sort()
const dutyIds = response2.data.map((x: { dutyId: any }) => x.dutyId)
if (config.includePermissions) {
const permissions = new Set<string>()
for (const duty of dutyIds) {
const response3 = await client.getDutyPrivileges(duty)
for (const privilege of response3.data) {
permissions.add(privilege.permission.name)
}
}
group.attributes.permissions = Array.from(permissions).sort()
}
logger.info(group)
res.send(group)
}
})
it appears it’s being added to the entitlement attribute as an array of string values, but I’ve seen in the off-the-shelf CyberArk connector that it appears an array of objects is also possible
"directPermissions": [
{
"target": "PRIV_CHK_MCHEEK",
"rights": [
"accessWithoutConfirmation",
"addAccounts",
"backupSafe",
"createFolders",
"deleteAccounts",
"deleteFolders",
"initiateCPMAccountManagementOperations",
"listAccounts",
"manageSafe",
"manageSafeMembers",
"moveAccountsAndFolders",
"renameAccounts",
"requestsAuthorizationLevel1",
"retrieveAccounts",
"specifyNextAccountContent",
"unlockAccounts",
"updateAccountContent",
"updateAccountProperties",
"useAccounts",
"viewAuditLog",
"viewSafeMembers"
]
}
]
So, what’s within the realm of possibility here? Do we just return an object mapped to a permissions property?
Looking for guidance from @fernando_delosrios and @philip-ellis as well