Skip to content

Commit

Permalink
refactor(client): organize rbac, abac methods
Browse files Browse the repository at this point in the history
  • Loading branch information
david-r-cox committed Oct 11, 2024
1 parent d9d3a28 commit f4540c2
Show file tree
Hide file tree
Showing 23 changed files with 63 additions and 30 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 10 additions & 10 deletions client/src/abac/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export { checkAbacPolicy } from "./checkAbacPolicy";
export { createPolicy } from "./createPolicy";
export { deletePolicy } from "./deletePolicy";
export { evaluatePolicies } from "./evaluatePolicies";
export { getGroupAttribute } from "./getGroupAttribute";
export { getPolicy } from "./getPolicy";
export { getUserAttribute } from "./getUserAttribute";
export { setGroupAttribute } from "./setGroupAttribute";
export { setUserAttribute } from "./setUserAttribute";
export { updatePolicy } from "./updatePolicy";
export { checkAbacPolicy } from "./policy/checkAbacPolicy";
export { createPolicy } from "./policy/createPolicy";
export { deletePolicy } from "./policy/deletePolicy";
export { evaluatePolicies } from "./policy/evaluatePolicies";
export { getPolicy } from "./policy/getPolicy";
export { updatePolicy } from "./policy/updatePolicy";
export { getGroupAttribute } from "./attribute/getGroupAttribute";
export { getUserAttribute } from "./attribute/getUserAttribute";
export { setGroupAttribute } from "./attribute/setGroupAttribute";
export { setUserAttribute } from "./attribute/setUserAttribute";
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
53 changes: 43 additions & 10 deletions client/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,52 @@ import {
RoleId,
} from "./types";

/* TODO: Add:
1. ABAC (Attribute-Based Access Control):
- evaluatePolicies
- getGroupAttribute
export {
createApiKey,
getAllKeyMetadata,
loadApiKeySummaries,
revokeApiKey,
rotateApiKey,
assignPermissionToRole,
addUserToGroup,
removeUserFromGroup,
createRole,
createPermission,
getParentRole,
setParentRole,
getRolePermissions,
updateUserClaimsCache,
userHasPermission,
checkAbacPolicy,
createPolicy,
deletePolicy,
evaluatePolicies,
getGroupAttribute,
getPolicy,
getUserAttribute,
setGroupAttribute,
setUserAttribute,
updatePolicy,
authenticate,
Logger,
ApiKeyEntity,
ApiKeySummary,
ApiKeyMetadata,
ApiKeyId,
AuthResult,
Description,
PermissionId,
PermissionName,
PolicyId,
UserId,
RotateApiKeyResult,
GroupId,
RoleId,
};

2. API Keys:
- No missing functions

/* TODO: Add:
3. RBAC (Role-Based Access Control):
- createRole
- getParentRole
- getRolePermissions
- removeUserFromGroup
- removePermissionFromRole
4. Utils:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 10 additions & 10 deletions client/src/rbac/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export * from "./addUserToGroup";
export * from "./removeUserFromGroup";
export * from "./assignPermissionToRole";
export * from "./createPermission";
export * from "./createRole";
export * from "./getParentRole";
export * from "./getRolePermissions";
export * from "./setParentRole";
export * from "./updateUserClaimsCache";
export * from "./userHasPermission";
export { addUserToGroup } from "./group/addUserToGroup";
export { removeUserFromGroup } from "./group/removeUserFromGroup";
export { assignPermissionToRole } from "./permission/assignPermissionToRole";
export { createPermission } from "./permission/createPermission";
export { userHasPermission } from "./permission/userHasPermission";
export { createRole } from "./role/createRole";
export { getParentRole } from "./role/getParentRole";
export { getRolePermissions } from "./role/getRolePermissions";
export { setParentRole } from "./role/setParentRole";
export { updateUserClaimsCache } from "./cache/updateUserClaimsCache";
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit f4540c2

Please sign in to comment.