-
Notifications
You must be signed in to change notification settings - Fork 11
feat: add Data Fabric roles and directory services #473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dsuresh-ap
wants to merge
16
commits into
main
Choose a base branch
from
feature/data-fabric-roles-sdk
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
3410fbc
feat(data-fabric): add roles and directory services
dsuresh-ap 8f6a268
fix: remove directory casing fallbacks
dsuresh-ap 603e0b9
fix: remove role casing fallbacks
dsuresh-ap 760a96b
fix: align Data Fabric access schemas
dsuresh-ap abfcb7d
fix: address Data Fabric review feedback
dsuresh-ap 056ae62
fix: remove client-only access integration checks
dsuresh-ap 546e22a
test: gate optional live integration suites
dsuresh-ap 745b4e9
fix: add folderKey header support to data fabric roles
dsuresh-ap 4fcd196
fix: address Data Fabric role review feedback
dsuresh-ap 8b42b9d
fix: use enum for Data Fabric directory type names
dsuresh-ap ffc5705
fix: simplify Data Fabric role headers
dsuresh-ap e80cece
test: use beforeAll guards for integration config
dsuresh-ap 3697bb9
docs: sync Data Fabric role examples
dsuresh-ap 43618d8
test: skip optional integrations only in CI
dsuresh-ap d5f4cad
test: exclude optional integrations in CI
dsuresh-ap 91a3837
fix: address data fabric access review comments
dsuresh-ap File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| import { | ||
| DataFabricDirectoryEntityType, | ||
| DataFabricDirectoryEntityTypeName, | ||
| } from './directory.types'; | ||
|
|
||
| export interface DataFabricDirectoryAssignPayload { | ||
| directoryEntities: Array<{ | ||
| externalId: string; | ||
| type: DataFabricDirectoryEntityType; | ||
| resolved: true; | ||
| }>; | ||
| roles: string[]; | ||
| isUIEnabled: boolean; | ||
| } | ||
|
|
||
| export interface DataFabricDirectoryRevokePayload { | ||
| externalIds: string[]; | ||
| } | ||
|
|
||
| export interface RawDataFabricDirectoryRole { | ||
| id: string; | ||
| name: string; | ||
| } | ||
|
|
||
| export interface RawDataFabricDirectoryEntry { | ||
| externalId: string; | ||
| name: string; | ||
| email?: string | null; | ||
| type: DataFabricDirectoryEntityTypeName; | ||
| roles?: RawDataFabricDirectoryRole[] | null; | ||
| objectType?: string | null; | ||
| isUIEnabled: boolean; | ||
| } | ||
|
|
||
| export interface RawDataFabricDirectoryListResponse { | ||
| totalCount: number; | ||
| results: RawDataFabricDirectoryEntry[]; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,137 @@ | ||
| import { | ||
| DataFabricDirectoryAssignOptions, | ||
| DataFabricDirectoryAssignmentResult, | ||
| DataFabricDirectoryEntityTypeInput, | ||
| DataFabricDirectoryEntry, | ||
| DataFabricDirectoryGetAllOptions, | ||
| DataFabricDirectoryListOptions, | ||
| DataFabricDirectoryListResponse, | ||
| } from './directory.types'; | ||
|
|
||
| /** | ||
| * @internal | ||
| */ | ||
| export interface DataFabricDirectoryServiceModel { | ||
| /** | ||
| * Lists one page of Data Fabric directory principals and their current roles. | ||
| * | ||
| * Returns directory entries with external IDs, principal metadata, and | ||
| * assigned Data Fabric roles. | ||
| * | ||
| * @param options - Optional offset paging options | ||
| * @returns Promise resolving to {@link DataFabricDirectoryListResponse} | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * import { DataFabricDirectoryService } from '@uipath/uipath-typescript/entities'; | ||
| * | ||
| * const directory = new DataFabricDirectoryService(sdk); | ||
| * const page = await directory.list({ skip: 0, top: 50 }); | ||
| * const firstPrincipal = page.results[0]; | ||
| * ``` | ||
| * | ||
| * @internal | ||
| */ | ||
| list(options?: DataFabricDirectoryListOptions): Promise<DataFabricDirectoryListResponse>; | ||
|
|
||
| /** | ||
| * Lists all Data Fabric directory principals and their current roles. | ||
| * | ||
| * Follows the Data Fabric directory top/skip pagination and returns | ||
| * normalized entries. Entries without assigned roles include an empty | ||
| * `roles` array. | ||
| * | ||
| * @param options - Optional page-size options | ||
| * @returns Promise resolving to an array of {@link DataFabricDirectoryEntry} | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * import { DataFabricDirectoryService } from '@uipath/uipath-typescript/entities'; | ||
| * | ||
| * const directory = new DataFabricDirectoryService(sdk); | ||
| * const principals = await directory.getAll({ pageSize: 100 }); | ||
| * ``` | ||
| * | ||
| * @internal | ||
| */ | ||
| getAll(options?: DataFabricDirectoryGetAllOptions): Promise<DataFabricDirectoryEntry[]>; | ||
|
|
||
| /** | ||
| * Assigns Data Fabric roles to one or more principals. | ||
| * | ||
| * The Data Fabric API replaces the role set for each principal, so this | ||
| * method preserves existing roles by default and posts the union of current | ||
| * and requested role IDs. | ||
| * | ||
| * Role IDs can be discovered with `DataFabricRoleService.getAll()`. Set | ||
| * `preserveExisting: false` only when intentionally replacing a principal's | ||
| * Data Fabric role set. | ||
| * | ||
| * @param principalIds - Principal external ID or IDs | ||
| * @param principalType - Principal type | ||
| * @param roleIds - Data Fabric role IDs to assign | ||
| * @param options - Optional assignment behavior | ||
| * @returns Promise resolving to an array of {@link DataFabricDirectoryAssignmentResult} | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * import { DataFabricDirectoryEntityTypeName, DataFabricDirectoryService, DataFabricRoleService } from '@uipath/uipath-typescript/entities'; | ||
| * | ||
| * const roles = new DataFabricRoleService(sdk); | ||
| * const directory = new DataFabricDirectoryService(sdk); | ||
| * | ||
| * const dataWriter = (await roles.getAll()).find(role => role.name === 'DataWriter'); | ||
| * if (!dataWriter) { | ||
| * throw new Error('DataWriter role not found'); | ||
| * } | ||
| * | ||
| * await directory.assignRoles('<identity-group-id>', DataFabricDirectoryEntityTypeName.Group, [dataWriter.id]); | ||
| * ``` | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * await directory.assignRoles('<identity-user-id>', DataFabricDirectoryEntityTypeName.User, ['<role-id>'], { | ||
| * preserveExisting: false, | ||
| * }); | ||
| * ``` | ||
| * | ||
| * @internal | ||
| */ | ||
| assignRoles( | ||
| principalIds: string | string[], | ||
| principalType: DataFabricDirectoryEntityTypeInput, | ||
| roleIds: string[], | ||
| options?: DataFabricDirectoryAssignOptions | ||
| ): Promise<DataFabricDirectoryAssignmentResult[]>; | ||
|
|
||
| /** | ||
| * Revokes all direct Data Fabric roles from one or more principals. | ||
| * | ||
| * The Data Fabric API removes all role assignments for each supplied external | ||
| * ID. Use this when a principal should no longer have direct Data Fabric | ||
| * access. Inherited access through groups is not changed. | ||
| * | ||
| * @param principalIds - Principal external ID or IDs | ||
| * @returns Promise resolving when the roles are revoked | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * import { DataFabricDirectoryService } from '@uipath/uipath-typescript/entities'; | ||
| * | ||
| * const directory = new DataFabricDirectoryService(sdk); | ||
| * | ||
| * await directory.revokeRoles('<identity-user-id>'); | ||
| * ``` | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * await directory.revokeRoles([ | ||
| * '<identity-user-id>', | ||
| * '<identity-group-id>', | ||
| * ]); | ||
| * ``` | ||
| * | ||
| * @internal | ||
| */ | ||
| revokeRoles(principalIds: string | string[]): Promise<void>; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,98 @@ | ||
| /** | ||
| * @internal | ||
| */ | ||
| export enum DataFabricDirectoryEntityType { | ||
| /** Identity user, robot user, or directory robot principal. */ | ||
| User = 0, | ||
| /** Identity group principal. */ | ||
| Group = 1, | ||
| /** External application principal. */ | ||
| Application = 2, | ||
| } | ||
|
|
||
| /** | ||
| * @internal | ||
| */ | ||
| export enum DataFabricDirectoryEntityTypeName { | ||
| User = 'User', | ||
| Group = 'Group', | ||
| Application = 'Application', | ||
| } | ||
|
|
||
| /** | ||
| * @internal | ||
| */ | ||
| export type DataFabricDirectoryEntityTypeInput = | ||
| | DataFabricDirectoryEntityType | ||
| | DataFabricDirectoryEntityTypeName; | ||
|
|
||
| /** | ||
| * @internal | ||
| */ | ||
| export interface DataFabricDirectoryRole { | ||
| id: string; | ||
| name: string; | ||
| } | ||
|
|
||
| /** | ||
| * @internal | ||
| */ | ||
| export interface DataFabricDirectoryEntry { | ||
| externalId: string; | ||
| name: string; | ||
| email?: string | null; | ||
| type: DataFabricDirectoryEntityTypeName; | ||
| roles: DataFabricDirectoryRole[]; | ||
| objectType?: string | null; | ||
| isUIEnabled: boolean; | ||
| } | ||
|
|
||
| /** | ||
| * @internal | ||
| */ | ||
| export interface DataFabricDirectoryListOptions { | ||
| skip?: number; | ||
| top?: number; | ||
| } | ||
|
|
||
| /** | ||
| * @internal | ||
| */ | ||
| export interface DataFabricDirectoryGetAllOptions { | ||
| pageSize?: number; | ||
| } | ||
|
|
||
| /** | ||
| * @internal | ||
| */ | ||
| export interface DataFabricDirectoryListResponse { | ||
| totalCount: number; | ||
| results: DataFabricDirectoryEntry[]; | ||
| } | ||
|
|
||
| /** | ||
| * @internal | ||
| */ | ||
| export interface DataFabricDirectoryAssignOptions { | ||
| /** | ||
| * Preserve the principal's current Data Fabric roles. | ||
| * | ||
| * Defaults to true because the Data Fabric role assignment endpoint replaces | ||
| * the role set for each principal. | ||
| */ | ||
| preserveExisting?: boolean; | ||
| /** | ||
| * Enables Data Fabric UI access for the assigned principal. | ||
| * | ||
| * Defaults to true. | ||
| */ | ||
| uiEnabled?: boolean; | ||
| } | ||
|
|
||
| /** | ||
| * @internal | ||
| */ | ||
| export interface DataFabricDirectoryAssignmentResult { | ||
| principalId: string; | ||
| roleIds: string[]; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| export * from './entities.types'; | ||
| export * from './entities.models'; | ||
| export * from './choicesets.types'; | ||
| export * from './choicesets.models'; | ||
| export * from './choicesets.models'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| import { DataFabricRole, DataFabricRoleGetAllOptions } from './roles.types'; | ||
|
|
||
| /** | ||
| * @internal | ||
| */ | ||
| export interface DataFabricRoleServiceModel { | ||
| /** | ||
| * Lists Data Fabric access roles. | ||
| * | ||
| * Returns tenant Data Fabric roles such as Admin, Designer, DataWriter, and | ||
| * DataReader. Role IDs from this method can be passed to | ||
| * `DataFabricDirectoryService.assignRoles()`. | ||
| * | ||
| * @param options - Optional query options | ||
| * @returns Promise resolving to an array of {@link DataFabricRole} | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * import { DataFabricRoleService } from '@uipath/uipath-typescript/entities'; | ||
| * | ||
| * const roles = new DataFabricRoleService(sdk); | ||
| * const allRoles = await roles.getAll(); | ||
| * const dataWriter = allRoles.find(role => role.name === 'DataWriter'); | ||
| * ``` | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * const rolesWithoutStats = await roles.getAll({ stats: false }); | ||
| * ``` | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * const folderRoles = await roles.getAll({ folderKey: '<folder-key>' }); | ||
| * ``` | ||
| * | ||
| * @internal | ||
| */ | ||
| getAll(options?: DataFabricRoleGetAllOptions): Promise<DataFabricRole[]>; | ||
|
dsuresh-ap marked this conversation as resolved.
|
||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.