Skip to content

Commit

Permalink
Dev/dbrailovsky/5.9.1 (#89)
Browse files Browse the repository at this point in the history
* HierarchyIdentityFilter

* Auth API Extensions

* fix

* fix

* fix

* CHANGELOG and description

* Update visuals-api.d.ts

* comments

* fix

* 6.0.0

* fixed version

* fix

---------

Co-authored-by: Roi Hochler <roihochler@microsoft.com>
Co-authored-by: David Brailovsky <dbrailovsky@microsoft.com>
  • Loading branch information
3 people committed May 6, 2024
1 parent 8b98122 commit 69a0205
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 26 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Change Log - Power BI Custom Visuals API
## 5.9.1
* `acquireAADTokenService` : Enhanced to support multiple clouds.

## 5.9.0
* `AcquireAADTokenResult` : Extended with additional properties.
* `createOpaqueUtils` : Create an encapsulated utility for the visual.
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "powerbi-visuals-api",
"version": "5.9.0",
"version": "5.9.1",
"description": "Power BI Custom Visuals API type definitions for typescript",
"types": "index",
"main": "index.js",
Expand Down
88 changes: 67 additions & 21 deletions schema.capabilities.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,30 +101,76 @@
"privilege": {
"type": "object",
"description": "privilege - Defines the name, essentiality, and optional parameters for a privilege",
"properties": {
"name": {
"type": "string",
"description": "The internal name of the privilege",
"enum": [
"WebAccess",
"LocalStorage",
"ExportContent",
"AADAuthentication"
]
},
"essential": {
"type": "boolean",
"description": "Determines if the privilege is essential for the visual. Default value is false"
"oneOf": [
{
"properties": {
"name": {
"type": "string",
"description": "The internal name of the privilege",
"enum": [
"WebAccess",
"LocalStorage",
"ExportContent"
]
},
"essential": {
"type": "boolean",
"description": "Determines if the privilege is essential for the visual. Default value is false"
},
"parameters": {
"type": "array",
"description": "Determines a list of privilege parameters if any",
"items": {
"type": "string",
"description": "The privilege parameter"
}
}
}
},
"parameters": {
"type": "array",
"description": "Determines a list of privilege parameters if any",
"items": {
"type": "string",
"description": "The privilege parameter"
{
"properties": {
"name": {
"type": "string",
"description": "The internal name of the privilege",
"const": "AADAuthentication"
},
"essential": {
"type": "boolean",
"description": "Determines if the privilege is essential for the visual. Default value is false"
},
"parameters": {
"type": "object",
"description": "Defines a mapping between cloud name and its respective target audience",
"properties": {
"COM": {
"type": "string",
"description": "Target audience for Commercial Cloud"
},
"CN": {
"type": "string",
"description": "Target audience for China Cloud"
},
"GCC": {
"type": "string",
"description": "Target audience for US Government Community Cloud"
},
"GCCHIGH": {
"type": "string",
"description": "Target audience for US Government Community Cloud High"
},
"DOD": {
"type": "string",
"description": "Target audience for US Department of Defense Cloud"
}
},
"required": [
"COM"
],
"additionalProperties": false
}
}
}
},
],
"required": [
"name"
]
Expand Down
22 changes: 20 additions & 2 deletions src/visuals-api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1533,6 +1533,16 @@ declare module powerbi.extensibility {
}

declare module powerbi.extensibility {
/**
* Enum representing the various clouds supported by the Authentication API.
*/
export const enum CloudName {
COM = "COM", // Commercial Cloud
CN = "CN", // China Cloud
GCC = "GCC", // US Government Community Cloud
GCCHIGH = "GCCHIGH", // US Government Community Cloud High
DOD = "DOD", // US Department of Defense Cloud
}

/**
* Interface representing information about the user associated with the token.
Expand All @@ -1542,13 +1552,21 @@ declare module powerbi.extensibility {
tenantId?: string; // Unique identifier for the tenant
}

/**
* Interface representing information about the fabric environment.
*/
export interface AcquireAADTokenFabricInfo {
cloudName?: CloudName; // Name of the cloud environment
}

/**
* Interface representing the result of acquiring a Microsoft Entra ID token.
*/
export interface AcquireAADTokenResult {
accessToken?: string; // Access token issued by Microsoft Entra ID
expiresOn?: number; // Expiration time of the access token
userInfo?: AcquireAADTokenUserInfo; // Information about the user associated with the token
fabricInfo?: AcquireAADTokenFabricInfo; // Information about the fabric environment
}

/**
Expand All @@ -1558,8 +1576,8 @@ declare module powerbi.extensibility {
/**
* Retrieves an authentication token payload.
*
* The audience is determined by the visual's `AADAuthentication` privilege parameter.
* The scope is formed by concatenating the visual's GUID with "_CV_ForPBI".
* The audience is determined by the visual's `AADAuthentication` privilege configuration for
* the current cloud. The scope is formed by concatenating the visual's GUID with "_CV_ForPBI".
*
* @returns A promise that resolves to the authentication token payload.
*/
Expand Down

0 comments on commit 69a0205

Please sign in to comment.