Skip to content
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

feature/enable cae #1315

Merged
merged 2 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31,927 changes: 15,963 additions & 15,964 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/abstractions/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@microsoft/kiota-abstractions",
"version": "1.0.0-preview.58",
"version": "1.0.0-preview.59",
"description": "Core abstractions for kiota generated libraries in TypeScript and JavaScript",
"main": "dist/es/src/index.js",
"module": "dist/es/src/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/authentication/azure/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@microsoft/kiota-authentication-azure",
"version": "1.0.0-preview.53",
"version": "1.0.0-preview.54",
"description": "Authentication provider for Kiota using Azure Identity",
"main": "dist/es/src/index.js",
"module": "dist/es/src/index.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,16 @@ export class AzureIdentityAccessTokenProvider implements AccessTokenProvider {
*@param scopes The scopes to use for authentication.
*@param options The options to use for authentication.
*@param allowedHosts The allowed hosts to use for authentication.
*@param observabilityOptions The observability options to use for authentication.
*@param isCaeEnabled A flag to determine if Continuous Access Evaluation is enabled.
*/
public constructor(
private readonly credentials: TokenCredential,
private readonly scopes: string[] = [],
private readonly options?: GetTokenOptions,
allowedHosts: Set<string> = new Set<string>(),
private readonly observabilityOptions: ObservabilityOptions = new ObservabilityOptionsImpl(),
private readonly isCaeEnabled = true,
) {
if (!credentials) {
throw new Error("parameter credentials cannot be null");
Expand Down Expand Up @@ -66,8 +69,9 @@ export class AzureIdentityAccessTokenProvider implements AccessTokenProvider {
}
span?.setAttribute("com.microsoft.kiota.authentication.additional_claims_provided", decodedClaims !== "");
const localOptions = { ...this.options };
localOptions.enableCae = this.isCaeEnabled;
if (decodedClaims) {
(localOptions as any).claims = decodedClaims; // the field is defined in a derived interface for some reason https://github.com/Azure/azure-sdk-for-js/blob/4498fecbede71563fee5daae2ad537ff57de3640/sdk/identity/identity/src/msal/credentials.ts#L29
localOptions.claims = decodedClaims;
}
if (this.scopes.length === 0) {
const [scheme, host] = this.getSchemeAndHostFromUrl(url);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ export class AzureIdentityAuthenticationProvider extends BaseBearerTokenAuthenti
*@param scopes The scopes to use for authentication.
*@param options The options to use for authentication.
*@param allowedHosts The allowed hosts to use for authentication.
*@param observabilityOptions The observability options to use for authentication.
*@param isCaeEnabled A flag to determine if Continuous Access Evaluation is enabled
*/
public constructor(credentials: TokenCredential, scopes: string[] = ["https://graph.microsoft.com/.default"], options?: GetTokenOptions, allowedHosts: Set<string> = new Set<string>(["graph.microsoft.com", "graph.microsoft.us", "dod-graph.microsoft.us", "graph.microsoft.de", "microsoftgraph.chinacloudapi.cn", "canary.graph.microsoft.com"]), observabilityOptions: ObservabilityOptions = new ObservabilityOptionsImpl()) {
super(new AzureIdentityAccessTokenProvider(credentials, scopes, options, allowedHosts, observabilityOptions));
public constructor(credentials: TokenCredential, scopes: string[] = ["https://graph.microsoft.com/.default"], options?: GetTokenOptions, allowedHosts: Set<string> = new Set<string>(["graph.microsoft.com", "graph.microsoft.us", "dod-graph.microsoft.us", "graph.microsoft.de", "microsoftgraph.chinacloudapi.cn", "canary.graph.microsoft.com"]), observabilityOptions: ObservabilityOptions = new ObservabilityOptionsImpl(), isCaeEnabled = true) {
super(new AzureIdentityAccessTokenProvider(credentials, scopes, options, allowedHosts, observabilityOptions, isCaeEnabled));
}
}
2 changes: 1 addition & 1 deletion packages/authentication/spfx/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@microsoft/kiota-authentication-spfx",
"version": "1.0.0-preview.47",
"version": "1.0.0-preview.48",
"description": "Authentication provider for using Kiota in SPFx solutions",
"main": "dist/es/src/index.js",
"module": "dist/es/src/index.js",
Expand Down
16 changes: 7 additions & 9 deletions packages/bundle/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@microsoft/kiota-bundle",
"version": "1.0.0-preview.1",
"version": "1.0.0-preview.2",
"description": "Kiota Bundle package providing default implementations for client setup for kiota generated libraries in TypeScript and JavaScript",
"main": "dist/es/src/index.js",
"module": "dist/es/src/index.js",
Expand Down Expand Up @@ -29,15 +29,13 @@
"url": "https://github.com/microsoft/kiota-typescript/issues"
},
"homepage": "https://github.com/microsoft/kiota#readme",
"devDependencies": {
},
"dependencies": {
"@microsoft/kiota-abstractions": "*",
"@microsoft/kiota-http-fetchlibrary": "*",
"@microsoft/kiota-serialization-form": "*",
"@microsoft/kiota-serialization-json": "*",
"@microsoft/kiota-serialization-text": "*",
"@microsoft/kiota-serialization-multipart": "*"
"@microsoft/kiota-abstractions": "*",
"@microsoft/kiota-http-fetchlibrary": "*",
"@microsoft/kiota-serialization-form": "*",
"@microsoft/kiota-serialization-json": "*",
"@microsoft/kiota-serialization-multipart": "*",
"@microsoft/kiota-serialization-text": "*"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/http/fetch/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@microsoft/kiota-http-fetchlibrary",
"version": "1.0.0-preview.57",
"version": "1.0.0-preview.58",
"description": "Kiota request adapter implementation with fetch",
"keywords": [
"Kiota",
Expand Down
2 changes: 1 addition & 1 deletion packages/serialization/form/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@microsoft/kiota-serialization-form",
"version": "1.0.0-preview.47",
"version": "1.0.0-preview.48",
"description": "Implementation of Kiota Serialization interfaces for URI from encoded",
"main": "dist/es/src/index.js",
"browser": {
Expand Down
2 changes: 1 addition & 1 deletion packages/serialization/json/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@microsoft/kiota-serialization-json",
"version": "1.0.0-preview.58",
"version": "1.0.0-preview.59",
"description": "Implementation of Kiota Serialization interfaces for JSON",
"main": "dist/es/src/index.js",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/serialization/multipart/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@microsoft/kiota-serialization-multipart",
"version": "1.0.0-preview.36",
"version": "1.0.0-preview.37",
"description": "Implementation of Kiota Serialization interfaces for multipart form data",
"main": "dist/es/src/index.js",
"module": "dist/es/src/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/serialization/text/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@microsoft/kiota-serialization-text",
"version": "1.0.0-preview.55",
"version": "1.0.0-preview.56",
"description": "Implementation of Kiota Serialization interfaces for text",
"main": "dist/es/src/index.js",
"browser": {
Expand Down
42 changes: 21 additions & 21 deletions packages/test/package.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{
"name": "test-kiota-typescript-libraries",
"description": "Sample Project",
"version": "0.0.1-preview.7",
"main": "index.js",
"private": true,
"scripts": {
"test:integrated": "vitest run"
},
"dependencies": {
"@azure/identity": "^4.0.1",
"@microsoft/kiota-abstractions": "*",
"@microsoft/kiota-authentication-azure": "*",
"@microsoft/kiota-http-fetchlibrary": "*",
"@microsoft/kiota-serialization-form": "*",
"@microsoft/kiota-serialization-json": "*",
"@microsoft/kiota-serialization-text": "*",
"@microsoft/kiota-serialization-multipart": "*"
},
"files": [
"lib/"
]
"name": "test-kiota-typescript-libraries",
"description": "Sample Project",
"version": "0.0.1-preview.8",
"main": "index.js",
"private": true,
"scripts": {
"test:integrated": "vitest run"
},
"dependencies": {
"@azure/identity": "^4.0.1",
"@microsoft/kiota-abstractions": "*",
"@microsoft/kiota-authentication-azure": "*",
"@microsoft/kiota-http-fetchlibrary": "*",
"@microsoft/kiota-serialization-form": "*",
"@microsoft/kiota-serialization-json": "*",
"@microsoft/kiota-serialization-multipart": "*",
"@microsoft/kiota-serialization-text": "*"
},
"files": [
"lib/"
]
}
Loading