diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 51ab93a4..7b5f5cc4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,6 +9,9 @@ on: - "hotfix-rc" workflow_dispatch: {} +permissions: + contents: read + jobs: cloc: name: CLOC @@ -95,11 +98,6 @@ jobs: - name: Zip run: zip -j dist-cli/bwdc-linux-$_PACKAGE_VERSION.zip dist-cli/linux/bwdc keytar/linux/build/Release/keytar.node - - name: Create checksums - run: | - shasum -a 256 dist-cli/bwdc-linux-$_PACKAGE_VERSION.zip | \ - cut -d " " -f 1 > dist-cli/bwdc-linux-sha256-$_PACKAGE_VERSION.txt - - name: Version Test run: | sudo apt-get update @@ -129,13 +127,6 @@ jobs: path: ./dist-cli/bwdc-linux-${{ env._PACKAGE_VERSION }}.zip if-no-files-found: error - - name: Upload Linux checksum to GitHub - uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 - with: - name: bwdc-linux-sha256-${{ env._PACKAGE_VERSION }}.txt - path: ./dist-cli/bwdc-linux-sha256-${{ env._PACKAGE_VERSION }}.txt - if-no-files-found: error - macos-cli: name: Build Mac CLI @@ -190,11 +181,6 @@ jobs: - name: Zip run: zip -j dist-cli/bwdc-macos-$_PACKAGE_VERSION.zip dist-cli/macos/bwdc keytar/macos/build/Release/keytar.node - - name: Create checksums - run: | - shasum -a 256 dist-cli/bwdc-macos-$_PACKAGE_VERSION.zip | \ - cut -d " " -f 1 > dist-cli/bwdc-macos-sha256-$_PACKAGE_VERSION.txt - - name: Version Test run: | mkdir -p test/macos @@ -217,12 +203,6 @@ jobs: path: ./dist-cli/bwdc-macos-${{ env._PACKAGE_VERSION }}.zip if-no-files-found: error - - name: Upload Mac checksum to GitHub - uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 - with: - name: bwdc-macos-sha256-${{ env._PACKAGE_VERSION }}.txt - path: ./dist-cli/bwdc-macos-sha256-${{ env._PACKAGE_VERSION }}.txt - if-no-files-found: error windows-cli: name: Build Windows CLI @@ -349,11 +329,6 @@ jobs: Throw "Version test failed." } - - name: Create checksums - run: | - checksum -f="./dist-cli/bwdc-windows-${env:_PACKAGE_VERSION}.zip" ` - -t sha256 | Out-File ./dist-cli/bwdc-windows-sha256-${env:_PACKAGE_VERSION}.txt - - name: Upload Windows Zip to GitHub uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 with: @@ -361,13 +336,6 @@ jobs: path: ./dist-cli/bwdc-windows-${{ env._PACKAGE_VERSION }}.zip if-no-files-found: error - - name: Upload Windows checksum to GitHub - uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 - with: - name: bwdc-windows-sha256-${{ env._PACKAGE_VERSION }}.txt - path: ./dist-cli/bwdc-windows-sha256-${{ env._PACKAGE_VERSION }}.txt - if-no-files-found: error - windows-gui: name: Build Windows GUI diff --git a/.github/workflows/enforce-labels.yml b/.github/workflows/enforce-labels.yml index 57149fad..d72f3d4a 100644 --- a/.github/workflows/enforce-labels.yml +++ b/.github/workflows/enforce-labels.yml @@ -3,6 +3,9 @@ name: Enforce PR labels on: pull_request: types: [labeled, unlabeled, opened, edited, synchronize] +permissions: + contents: read + pull-requests: read jobs: enforce-label: name: EnforceLabel diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5620e258..c5f809c3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,6 +13,9 @@ on: - Redeploy - Dry Run +permissions: + contents: read + jobs: setup: name: Setup @@ -71,9 +74,6 @@ jobs: artifacts: "./bwdc-windows-${{ env.PKG_VERSION }}.zip, ./bwdc-macos-${{ env.PKG_VERSION }}.zip, ./bwdc-linux-${{ env.PKG_VERSION }}.zip, - ./bwdc-windows-sha256-${{ env.PKG_VERSION }}.txt, - ./bwdc-macos-sha256-${{ env.PKG_VERSION }}.txt, - ./bwdc-linux-sha256-${{ env.PKG_VERSION }}.txt, ./Bitwarden-Connector-Portable-${{ env.PKG_VERSION }}.exe, ./Bitwarden-Connector-Installer-${{ env.PKG_VERSION }}.exe, ./Bitwarden-Connector-Installer-${{ env.PKG_VERSION }}.exe.blockmap, diff --git a/.github/workflows/scan.yml b/.github/workflows/scan.yml index 4fa35042..109b71fa 100644 --- a/.github/workflows/scan.yml +++ b/.github/workflows/scan.yml @@ -5,13 +5,23 @@ on: push: branches: - "main" + pull_request: + types: [opened, synchronize, reopened] + branches-ignore: + - main pull_request_target: - types: [opened, synchronize] + types: [opened, synchronize, reopened] + branches: + - "main" + +permissions: {} jobs: check-run: name: Check PR run uses: bitwarden/gh-actions/.github/workflows/check-run.yml@main + permissions: + contents: read sast: name: SAST scan @@ -66,7 +76,7 @@ jobs: ref: ${{ github.event.pull_request.head.sha }} - name: Scan with SonarCloud - uses: sonarsource/sonarqube-scan-action@bfd4e558cda28cda6b5defafb9232d191be8c203 # v4.2.1 + uses: sonarsource/sonarqube-scan-action@2500896589ef8f7247069a56136f8dc177c27ccf # v5.2.0 env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} with: diff --git a/package-lock.json b/package-lock.json index e231ee70..42181620 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@bitwarden/directory-connector", - "version": "2025.5.0", + "version": "2025.6.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@bitwarden/directory-connector", - "version": "2025.5.0", + "version": "2025.6.0", "hasInstallScript": true, "license": "GPL-3.0", "dependencies": { @@ -25,17 +25,18 @@ "browser-hrtime": "1.1.8", "chalk": "4.1.2", "commander": "13.1.0", - "core-js": "3.40.0", - "form-data": "4.0.1", + "core-js": "3.42.0", + "form-data": "4.0.3", "google-auth-library": "9.15.1", "googleapis": "144.0.0", "https-proxy-agent": "7.0.6", "inquirer": "8.2.6", "keytar": "7.9.0", - "ldapts": "7.3.1", + "ldapts": "7.4.0", "lowdb": "1.0.0", "ngx-toastr": "19.0.0", "node-fetch": "2.7.0", + "parse5": "7.2.1", "proper-lockfile": "4.1.2", "rxjs": "7.8.2", "tldjs": "2.3.1", @@ -47,7 +48,7 @@ "@angular-eslint/template-parser": "17.5.3", "@angular/compiler-cli": "17.3.12", "@electron/notarize": "2.5.0", - "@electron/rebuild": "3.7.1", + "@electron/rebuild": "3.7.2", "@fluffy-spoon/substitute": "1.208.0", "@microsoft/microsoft-graph-types": "2.40.0", "@ngtools/webpack": "17.3.17", @@ -59,38 +60,37 @@ "@types/node-forge": "1.3.11", "@types/proper-lockfile": "4.1.4", "@types/tldjs": "2.3.4", - "@typescript-eslint/eslint-plugin": "8.23.0", - "@typescript-eslint/parser": "8.23.0", + "@typescript-eslint/eslint-plugin": "8.32.1", + "@typescript-eslint/parser": "8.32.1", "clean-webpack-plugin": "4.0.0", "concurrently": "9.1.2", "copy-webpack-plugin": "12.0.2", "cross-env": "7.0.3", "css-loader": "7.1.2", - "dotenv": "16.4.7", + "dotenv": "16.5.0", "electron": "34.1.1", "electron-builder": "24.13.3", - "electron-log": "5.2.4", + "electron-log": "5.4.1", "electron-reload": "2.0.0-alpha.1", "electron-store": "8.2.0", - "electron-updater": "6.3.9", + "electron-updater": "6.6.2", "eslint": "8.57.1", - "eslint-config-prettier": "10.0.1", + "eslint-config-prettier": "10.1.5", "eslint-import-resolver-typescript": "3.7.0", "eslint-plugin-import": "2.31.0", "eslint-plugin-rxjs": "5.0.3", "eslint-plugin-rxjs-angular": "2.0.1", - "form-data": "4.0.1", + "form-data": "4.0.3", "html-loader": "5.1.0", "html-webpack-plugin": "5.6.3", "husky": "9.1.7", "jest": "29.7.0", "jest-junit": "16.0.0", "jest-mock-extended": "3.0.7", - "jest-preset-angular": "14.5.0", - "lint-staged": "15.4.1", + "jest-preset-angular": "14.5.5", + "lint-staged": "15.5.2", "mini-css-extract-plugin": "2.9.2", - "minimatch": "3.1.2", - "node-abi": "3.74.0", + "node-abi": "3.75.0", "node-forge": "1.3.1", "node-loader": "2.1.0", "pkg": "5.8.1", @@ -98,11 +98,11 @@ "rimraf": "6.0.1", "rxjs": "7.8.2", "sass": "1.79.4", - "sass-loader": "16.0.4", - "ts-jest": "29.2.5", + "sass-loader": "16.0.5", + "ts-jest": "29.4.0", "ts-loader": "9.5.2", "tsconfig-paths-webpack-plugin": "4.2.0", - "type-fest": "4.32.0", + "type-fest": "4.41.0", "typescript": "5.4.5", "webpack": "5.97.1", "webpack-cli": "6.0.1", @@ -3268,9 +3268,9 @@ } }, "node_modules/@electron/rebuild": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/@electron/rebuild/-/rebuild-3.7.1.tgz", - "integrity": "sha512-sKGD+xav4Gh25+LcLY0rjIwcCFTw+f/HU1pB48UVbwxXXRGaXEqIH0AaYKN46dgd/7+6kuiDXzoyAEvx1zCsdw==", + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/@electron/rebuild/-/rebuild-3.7.2.tgz", + "integrity": "sha512-19/KbIR/DAxbsCkiaGMXIdPnMCJLkcf8AvGnduJtWBs/CBwiAjY1apCqOLVxrXg+rtXFCngbXhBanWjxLUt1Mg==", "dev": true, "license": "MIT", "dependencies": { @@ -5715,21 +5715,21 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.23.0.tgz", - "integrity": "sha512-vBz65tJgRrA1Q5gWlRfvoH+w943dq9K1p1yDBY2pc+a1nbBLZp7fB9+Hk8DaALUbzjqlMfgaqlVPT1REJdkt/w==", + "version": "8.32.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.32.1.tgz", + "integrity": "sha512-6u6Plg9nP/J1GRpe/vcjjabo6Uc5YQPAMxsgQyGC/I0RuukiG1wIe3+Vtg3IrSCVJDmqK3j8adrtzXSENRtFgg==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.23.0", - "@typescript-eslint/type-utils": "8.23.0", - "@typescript-eslint/utils": "8.23.0", - "@typescript-eslint/visitor-keys": "8.23.0", + "@typescript-eslint/scope-manager": "8.32.1", + "@typescript-eslint/type-utils": "8.32.1", + "@typescript-eslint/utils": "8.32.1", + "@typescript-eslint/visitor-keys": "8.32.1", "graphemer": "^1.4.0", - "ignore": "^5.3.1", + "ignore": "^7.0.0", "natural-compare": "^1.4.0", - "ts-api-utils": "^2.0.1" + "ts-api-utils": "^2.1.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -5741,20 +5741,20 @@ "peerDependencies": { "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <5.8.0" + "typescript": ">=4.8.4 <5.9.0" } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/type-utils": { - "version": "8.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.23.0.tgz", - "integrity": "sha512-iIuLdYpQWZKbiH+RkCGc6iu+VwscP5rCtQ1lyQ7TYuKLrcZoeJVpcLiG8DliXVkUxirW/PWlmS+d6yD51L9jvA==", + "version": "8.32.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.32.1.tgz", + "integrity": "sha512-mv9YpQGA8iIsl5KyUPi+FGLm7+bA4fgXaeRcFKRDRwDMu4iwrSHeDPipwueNXhdIIZltwCJv+NkxftECbIZWfA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/typescript-estree": "8.23.0", - "@typescript-eslint/utils": "8.23.0", + "@typescript-eslint/typescript-estree": "8.32.1", + "@typescript-eslint/utils": "8.32.1", "debug": "^4.3.4", - "ts-api-utils": "^2.0.1" + "ts-api-utils": "^2.1.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -5765,20 +5765,20 @@ }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <5.8.0" + "typescript": ">=4.8.4 <5.9.0" } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils": { - "version": "8.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.23.0.tgz", - "integrity": "sha512-uB/+PSo6Exu02b5ZEiVtmY6RVYO7YU5xqgzTIVZwTHvvK3HsL8tZZHFaTLFtRG3CsV4A5mhOv+NZx5BlhXPyIA==", + "version": "8.32.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.32.1.tgz", + "integrity": "sha512-DsSFNIgLSrc89gpq1LJB7Hm1YpuhK086DRDJSNrewcGvYloWW1vZLHBTIvarKZDcAORIy/uWNx8Gad+4oMpkSA==", "dev": true, "license": "MIT", "dependencies": { - "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.23.0", - "@typescript-eslint/types": "8.23.0", - "@typescript-eslint/typescript-estree": "8.23.0" + "@eslint-community/eslint-utils": "^4.7.0", + "@typescript-eslint/scope-manager": "8.32.1", + "@typescript-eslint/types": "8.32.1", + "@typescript-eslint/typescript-estree": "8.32.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -5789,7 +5789,17 @@ }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <5.8.0" + "typescript": ">=4.8.4 <5.9.0" + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.4.tgz", + "integrity": "sha512-gJzzk+PQNznz8ysRrC0aOkBNVRBDtE1n53IqyqEf3PXrYwomFs5q4pGMizBMJF+ykh03insJ27hB8gSrD2Hn8A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" } }, "node_modules/@typescript-eslint/experimental-utils": { @@ -5973,16 +5983,16 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.23.0.tgz", - "integrity": "sha512-h2lUByouOXFAlMec2mILeELUbME5SZRN/7R9Cw2RD2lRQQY08MWMM+PmVVKKJNK1aIwqTo9t/0CvOxwPbRIE2Q==", + "version": "8.32.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.32.1.tgz", + "integrity": "sha512-LKMrmwCPoLhM45Z00O1ulb6jwyVr2kr3XJp+G+tSEZcbauNnScewcQwtJqXDhXeYPDEjZ8C1SjXm015CirEmGg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "8.23.0", - "@typescript-eslint/types": "8.23.0", - "@typescript-eslint/typescript-estree": "8.23.0", - "@typescript-eslint/visitor-keys": "8.23.0", + "@typescript-eslint/scope-manager": "8.32.1", + "@typescript-eslint/types": "8.32.1", + "@typescript-eslint/typescript-estree": "8.32.1", + "@typescript-eslint/visitor-keys": "8.32.1", "debug": "^4.3.4" }, "engines": { @@ -5994,18 +6004,18 @@ }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <5.8.0" + "typescript": ">=4.8.4 <5.9.0" } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.23.0.tgz", - "integrity": "sha512-OGqo7+dXHqI7Hfm+WqkZjKjsiRtFUQHPdGMXzk5mYXhJUedO7e/Y7i8AK3MyLMgZR93TX4bIzYrfyVjLC+0VSw==", + "version": "8.32.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.32.1.tgz", + "integrity": "sha512-7IsIaIDeZn7kffk7qXC3o6Z4UblZJKV3UBpkvRNpr5NSyLji7tvTcvmnMNYuYLyh26mN8W723xpo3i4MlD33vA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.23.0", - "@typescript-eslint/visitor-keys": "8.23.0" + "@typescript-eslint/types": "8.32.1", + "@typescript-eslint/visitor-keys": "8.32.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -6175,9 +6185,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.23.0.tgz", - "integrity": "sha512-1sK4ILJbCmZOTt9k4vkoulT6/y5CHJ1qUYxqpF1K/DBAd8+ZUL4LlSCxOssuH5m4rUaaN0uS0HlVPvd45zjduQ==", + "version": "8.32.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.32.1.tgz", + "integrity": "sha512-YmybwXUJcgGqgAp6bEsgpPXEg6dcCyPyCSr0CAAueacR/CCBi25G3V8gGQ2kRzQRBNol7VQknxMs9HvVa9Rvfg==", "dev": true, "license": "MIT", "engines": { @@ -6189,20 +6199,20 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.23.0.tgz", - "integrity": "sha512-LcqzfipsB8RTvH8FX24W4UUFk1bl+0yTOf9ZA08XngFwMg4Kj8A+9hwz8Cr/ZS4KwHrmo9PJiLZkOt49vPnuvQ==", + "version": "8.32.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.32.1.tgz", + "integrity": "sha512-Y3AP9EIfYwBb4kWGb+simvPaqQoT5oJuzzj9m0i6FCY6SPvlomY2Ei4UEMm7+FXtlNJbor80ximyslzaQF6xhg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.23.0", - "@typescript-eslint/visitor-keys": "8.23.0", + "@typescript-eslint/types": "8.32.1", + "@typescript-eslint/visitor-keys": "8.32.1", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", "minimatch": "^9.0.4", "semver": "^7.6.0", - "ts-api-utils": "^2.0.1" + "ts-api-utils": "^2.1.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -6212,7 +6222,7 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "typescript": ">=4.8.4 <5.8.0" + "typescript": ">=4.8.4 <5.9.0" } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { @@ -6414,13 +6424,13 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.23.0.tgz", - "integrity": "sha512-oWWhcWDLwDfu++BGTZcmXWqpwtkwb5o7fxUIGksMQQDSdPW9prsSnfIOZMlsj4vBOSrcnjIUZMiIjODgGosFhQ==", + "version": "8.32.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.32.1.tgz", + "integrity": "sha512-ar0tjQfObzhSaW3C3QNmTc5ofj0hDoNQ5XWrCy6zDyabdr0TWhCkClp+rywGNj/odAFBVzzJrK4tEq5M4Hmu4w==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.23.0", + "@typescript-eslint/types": "8.32.1", "eslint-visitor-keys": "^4.2.0" }, "engines": { @@ -9161,9 +9171,9 @@ } }, "node_modules/core-js": { - "version": "3.40.0", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.40.0.tgz", - "integrity": "sha512-7vsMc/Lty6AGnn7uFpYT56QesI5D2Y/UkgKounk87OP9Z2H9Z8kj6jzcSGAxFmUtDOS0ntK6lbQz+Nsa0Jj6mQ==", + "version": "3.42.0", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.42.0.tgz", + "integrity": "sha512-Sz4PP4ZA+Rq4II21qkNqOEDTDrCvcANId3xpIgB34NDkWc3UduWj2dqEtN9yZIq8Dk3HyPI33x9sqqU5C8sr0g==", "hasInstallScript": true, "license": "MIT", "funding": { @@ -10177,9 +10187,9 @@ } }, "node_modules/dotenv": { - "version": "16.4.7", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.7.tgz", - "integrity": "sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==", + "version": "16.5.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.5.0.tgz", + "integrity": "sha512-m/C+AwOAr9/W1UOIZUo232ejMNnJAJtYQjUbHoNTBNTJSvqzzDh7vnrei3o3r3m9blf6ZoDkvcw0VmozNRFJxg==", "dev": true, "license": "BSD-2-Clause", "engines": { @@ -10341,9 +10351,9 @@ } }, "node_modules/electron-log": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/electron-log/-/electron-log-5.2.4.tgz", - "integrity": "sha512-iX12WXc5XAaKeHg2QpiFjVwL+S1NVHPFd3V5RXtCmKhpAzXsVQnR3UEc0LovM6p6NkUQxDWnkdkaam9FNUVmCA==", + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/electron-log/-/electron-log-5.4.1.tgz", + "integrity": "sha512-QvisA18Z++8E3Th0zmhUelys9dEv7aIeXJlbFw3UrxCc8H9qSRW0j8/ooTef/EtHui8tVmbKSL+EIQzP9GoRLg==", "dev": true, "license": "MIT", "engines": { @@ -10426,13 +10436,13 @@ "license": "ISC" }, "node_modules/electron-updater": { - "version": "6.3.9", - "resolved": "https://registry.npmjs.org/electron-updater/-/electron-updater-6.3.9.tgz", - "integrity": "sha512-2PJNONi+iBidkoC5D1nzT9XqsE8Q1X28Fn6xRQhO3YX8qRRyJ3mkV4F1aQsuRnYPqq6Hw+E51y27W75WgDoofw==", + "version": "6.6.2", + "resolved": "https://registry.npmjs.org/electron-updater/-/electron-updater-6.6.2.tgz", + "integrity": "sha512-Cr4GDOkbAUqRHP5/oeOmH/L2Bn6+FQPxVLZtPbcmKZC63a1F3uu5EefYOssgZXG3u/zBlubbJ5PJdITdMVggbw==", "dev": true, "license": "MIT", "dependencies": { - "builder-util-runtime": "9.2.10", + "builder-util-runtime": "9.3.1", "fs-extra": "^10.1.0", "js-yaml": "^4.1.0", "lazy-val": "^1.0.5", @@ -10450,9 +10460,9 @@ "license": "Python-2.0" }, "node_modules/electron-updater/node_modules/builder-util-runtime": { - "version": "9.2.10", - "resolved": "https://registry.npmjs.org/builder-util-runtime/-/builder-util-runtime-9.2.10.tgz", - "integrity": "sha512-6p/gfG1RJSQeIbz8TK5aPNkoztgY1q5TgmGFMAXcY8itsGW6Y2ld1ALsZ5UJn8rog7hKF3zHx5iQbNQ8uLcRlw==", + "version": "9.3.1", + "resolved": "https://registry.npmjs.org/builder-util-runtime/-/builder-util-runtime-9.3.1.tgz", + "integrity": "sha512-2/egrNDDnRaxVwK3A+cJq6UOlqOdedGA7JPqCeJjN2Zjk1/QB/6QUi3b714ScIGS7HafFXTyzJEOr5b44I3kvQ==", "dev": true, "license": "MIT", "dependencies": { @@ -10597,7 +10607,6 @@ "version": "4.5.0", "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", - "devOptional": true, "license": "BSD-2-Clause", "engines": { "node": ">=0.12" @@ -11005,13 +11014,16 @@ } }, "node_modules/eslint-config-prettier": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.0.1.tgz", - "integrity": "sha512-lZBts941cyJyeaooiKxAtzoPHTN+GbQTJFAIdQbRhA4/8whaAraEh47Whw/ZFfrjNSnlAxqfm9i0XVAEkULjCw==", + "version": "10.1.5", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.1.5.tgz", + "integrity": "sha512-zc1UmCpNltmVY34vuLRV61r1K27sWuX39E+uyUnY8xS2Bex88VV9cugG+UZbRSRGtGyFboj+D8JODyme1plMpw==", "dev": true, "license": "MIT", "bin": { - "eslint-config-prettier": "build/bin/cli.js" + "eslint-config-prettier": "bin/cli.js" + }, + "funding": { + "url": "https://opencollective.com/eslint-config-prettier" }, "peerDependencies": { "eslint": ">=7.0.0" @@ -12116,14 +12128,16 @@ } }, "node_modules/form-data": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", - "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.3.tgz", + "integrity": "sha512-qsITQPfmvMOSAdeyZ+12I1c+CKSstAFAwu+97zrnWAbIr5u8wfsExUzCesVLC8NgHuRUqNN4Zy6UPWUTRGslcA==", "dev": true, "license": "MIT", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", "mime-types": "^2.1.12" }, "engines": { @@ -14855,9 +14869,9 @@ } }, "node_modules/jest-preset-angular": { - "version": "14.5.0", - "resolved": "https://registry.npmjs.org/jest-preset-angular/-/jest-preset-angular-14.5.0.tgz", - "integrity": "sha512-L7eScW3IX5pZi2GRi0/q6Eo58qf76bdK93ozZxOI2gSK2fE+nnSIirkl2zvZ21AiJM5f4IawwBcqBhAPDvOs+Q==", + "version": "14.5.5", + "resolved": "https://registry.npmjs.org/jest-preset-angular/-/jest-preset-angular-14.5.5.tgz", + "integrity": "sha512-PUykbixXEYSltKQE4450YuBiO8SMo2SwdGRHAdArRuV06Igq8gaLRVt9j8suj/4qtm2xRqoKnh5j52R0PfQxFw==", "dev": true, "license": "MIT", "dependencies": { @@ -14866,7 +14880,7 @@ "jest-environment-jsdom": "^29.7.0", "jest-util": "^29.7.0", "pretty-format": "^29.7.0", - "ts-jest": "^29.0.0" + "ts-jest": "^29.3.0" }, "engines": { "node": "^14.15.0 || >=16.10.0" @@ -15570,22 +15584,39 @@ } }, "node_modules/ldapts": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/ldapts/-/ldapts-7.3.1.tgz", - "integrity": "sha512-g8mxobOSeuxVkXRT9JZBGUvfDjXIpQPEHH5kYG9UjrIlWV5Rqxq+MMmqzlSh4OqSXh+3lFvzyYu+lsJldoZvvA==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/ldapts/-/ldapts-7.4.0.tgz", + "integrity": "sha512-QLgx2pLvxMXY1nCc85Fx+cwVJDvC0sQ3l4CJZSl1FJ/iV8Ypfl6m+5xz4lm1lhoXcUlvhPqxEoyIj/8LR6ut+A==", "license": "MIT", "dependencies": { "@types/asn1": ">=0.2.4", - "asn1": "~0.2.6", - "debug": "~4.4.0", - "strict-event-emitter-types": "~2.0.0", - "uuid": "~11.0.4", - "whatwg-url": "~14.1.0" + "asn1": "0.2.6", + "debug": "4.4.0", + "strict-event-emitter-types": "2.0.0", + "uuid": "11.1.0", + "whatwg-url": "14.2.0" }, "engines": { "node": ">=18" } }, + "node_modules/ldapts/node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, "node_modules/ldapts/node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", @@ -15608,9 +15639,9 @@ } }, "node_modules/ldapts/node_modules/uuid": { - "version": "11.0.5", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.0.5.tgz", - "integrity": "sha512-508e6IcKLrhxKdBbcA2b4KQZlLVp2+J5UwQ6F7Drckkc5N9ZJwFa4TgWtsww9UG8fGHbm6gbV19TdM5pQ4GaIA==", + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.1.0.tgz", + "integrity": "sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==", "funding": [ "https://github.com/sponsors/broofa", "https://github.com/sponsors/ctavan" @@ -15621,12 +15652,12 @@ } }, "node_modules/ldapts/node_modules/whatwg-url": { - "version": "14.1.1", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-14.1.1.tgz", - "integrity": "sha512-mDGf9diDad/giZ/Sm9Xi2YcyzaFpbdLpJPr+E9fSkyQ7KpQD4SdFcugkRQYzhmfI4KeV4Qpnn2sKPdo+kmsgRQ==", + "version": "14.2.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-14.2.0.tgz", + "integrity": "sha512-De72GdQZzNTUBBChsXueQUnPKDkg/5A5zp7pFDuQAj5UFoENpiACU0wlCvzpAGnTkj++ihpKwKyYewn/XNUbKw==", "license": "MIT", "dependencies": { - "tr46": "^5.0.0", + "tr46": "^5.1.0", "webidl-conversions": "^7.0.0" }, "engines": { @@ -15795,22 +15826,22 @@ "license": "MIT" }, "node_modules/lint-staged": { - "version": "15.4.1", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.4.1.tgz", - "integrity": "sha512-P8yJuVRyLrm5KxCtFx+gjI5Bil+wO7wnTl7C3bXhvtTaAFGirzeB24++D0wGoUwxrUKecNiehemgCob9YL39NA==", + "version": "15.5.2", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.5.2.tgz", + "integrity": "sha512-YUSOLq9VeRNAo/CTaVmhGDKG+LBtA8KF1X4K5+ykMSwWST1vDxJRB2kv2COgLb1fvpCo+A/y9A0G0znNVmdx4w==", "dev": true, "license": "MIT", "dependencies": { - "chalk": "~5.4.1", - "commander": "~12.1.0", - "debug": "~4.4.0", - "execa": "~8.0.1", - "lilconfig": "~3.1.3", - "listr2": "~8.2.5", - "micromatch": "~4.0.8", - "pidtree": "~0.6.0", - "string-argv": "~0.3.2", - "yaml": "~2.6.1" + "chalk": "^5.4.1", + "commander": "^13.1.0", + "debug": "^4.4.0", + "execa": "^8.0.1", + "lilconfig": "^3.1.3", + "listr2": "^8.2.5", + "micromatch": "^4.0.8", + "pidtree": "^0.6.0", + "string-argv": "^0.3.2", + "yaml": "^2.7.0" }, "bin": { "lint-staged": "bin/lint-staged.js" @@ -15835,16 +15866,6 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/lint-staged/node_modules/commander": { - "version": "12.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", - "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - } - }, "node_modules/lint-staged/node_modules/execa": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", @@ -17183,9 +17204,9 @@ } }, "node_modules/node-abi": { - "version": "3.74.0", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.74.0.tgz", - "integrity": "sha512-c5XK0MjkGBrQPGYG24GBADZud0NCbznxNx0ZkS+ebUTrmV1qTDxPxSL8zEAPURXSbLRWVexxmP4986BziahL5w==", + "version": "3.75.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.75.0.tgz", + "integrity": "sha512-OhYaY5sDsIka7H7AtijtI9jwGYLyl29eQn/W623DiN/MIv5sUqc4g7BIDThX+gb7di9f6xK02nkp8sdfFWZLTg==", "license": "MIT", "dependencies": { "semver": "^7.3.5" @@ -17843,7 +17864,6 @@ "version": "7.2.1", "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.2.1.tgz", "integrity": "sha512-BuBYQYlv1ckiPdQi/ohiivi9Sagc9JG+Ozs0r7b/0iK3sKmrb0b9FdWdBbOdx6hBCM/F9Ir82ofnBhtZOjCRPQ==", - "devOptional": true, "license": "MIT", "dependencies": { "entities": "^4.5.0" @@ -20089,9 +20109,9 @@ } }, "node_modules/sass-loader": { - "version": "16.0.4", - "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-16.0.4.tgz", - "integrity": "sha512-LavLbgbBGUt3wCiYzhuLLu65+fWXaXLmq7YxivLhEqmiupCFZ5sKUAipK3do6V80YSU0jvSxNhEdT13IXNr3rg==", + "version": "16.0.5", + "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-16.0.5.tgz", + "integrity": "sha512-oL+CMBXrj6BZ/zOq4os+UECPL+bWqt6OAC6DWS8Ln8GZRcMDjlJ4JC3FBDuHJdYaFWIdKNIBYmtZtK2MaMkNIw==", "dev": true, "license": "MIT", "dependencies": { @@ -21744,20 +21764,20 @@ } }, "node_modules/ts-jest": { - "version": "29.2.5", - "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.2.5.tgz", - "integrity": "sha512-KD8zB2aAZrcKIdGk4OwpJggeLcH1FgrICqDSROWqlnJXGCXK4Mn6FcdK2B6670Xr73lHMG1kHw8R87A0ecZ+vA==", + "version": "29.4.0", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.4.0.tgz", + "integrity": "sha512-d423TJMnJGu80/eSgfQ5w/R+0zFJvdtTxwtF9KzFFunOpSeD+79lHJQIiAhluJoyGRbvj9NZJsl9WjCUo0ND7Q==", "dev": true, "license": "MIT", "dependencies": { "bs-logger": "^0.2.6", "ejs": "^3.1.10", "fast-json-stable-stringify": "^2.1.0", - "jest-util": "^29.0.0", "json5": "^2.2.3", "lodash.memoize": "^4.1.2", "make-error": "^1.3.6", - "semver": "^7.6.3", + "semver": "^7.7.2", + "type-fest": "^4.41.0", "yargs-parser": "^21.1.1" }, "bin": { @@ -21768,10 +21788,11 @@ }, "peerDependencies": { "@babel/core": ">=7.0.0-beta.0 <8", - "@jest/transform": "^29.0.0", - "@jest/types": "^29.0.0", - "babel-jest": "^29.0.0", - "jest": "^29.0.0", + "@jest/transform": "^29.0.0 || ^30.0.0", + "@jest/types": "^29.0.0 || ^30.0.0", + "babel-jest": "^29.0.0 || ^30.0.0", + "jest": "^29.0.0 || ^30.0.0", + "jest-util": "^29.0.0 || ^30.0.0", "typescript": ">=4.3 <6" }, "peerDependenciesMeta": { @@ -21789,6 +21810,9 @@ }, "esbuild": { "optional": true + }, + "jest-util": { + "optional": true } } }, @@ -21987,9 +22011,9 @@ } }, "node_modules/type-fest": { - "version": "4.32.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.32.0.tgz", - "integrity": "sha512-rfgpoi08xagF3JSdtJlCwMq9DGNDE0IMh3Mkpc1wUypg9vPi786AiqeBBKcqvIkq42azsBM85N490fyZjeUftw==", + "version": "4.41.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", + "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", "dev": true, "license": "(MIT OR CC0-1.0)", "engines": { @@ -23704,16 +23728,16 @@ "license": "ISC" }, "node_modules/yaml": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.6.1.tgz", - "integrity": "sha512-7r0XPzioN/Q9kXBro/XPnA6kznR73DHq+GXh5ON7ZozRO6aMjbmiBuKste2wslTFkC5d1dw0GooOCepZXJ2SAg==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.0.tgz", + "integrity": "sha512-4lLa/EcQCB0cJkyts+FpIRx5G/llPxfP6VQU5KByHEhLxY3IJCH0f0Hy1MHI8sClTvsIb8qwRJ6R/ZdlDJ/leQ==", "dev": true, "license": "ISC", "bin": { "yaml": "bin.mjs" }, "engines": { - "node": ">= 14" + "node": ">= 14.6" } }, "node_modules/yargs": { diff --git a/package.json b/package.json index d43d8978..a7b0ccff 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@bitwarden/directory-connector", "productName": "Bitwarden Directory Connector", "description": "Sync your user directory to your Bitwarden organization.", - "version": "2025.5.0", + "version": "2025.6.0", "keywords": [ "bitwarden", "password", @@ -78,7 +78,7 @@ "@angular-eslint/template-parser": "17.5.3", "@angular/compiler-cli": "17.3.12", "@electron/notarize": "2.5.0", - "@electron/rebuild": "3.7.1", + "@electron/rebuild": "3.7.2", "@fluffy-spoon/substitute": "1.208.0", "@microsoft/microsoft-graph-types": "2.40.0", "@ngtools/webpack": "17.3.17", @@ -90,38 +90,37 @@ "@types/node-forge": "1.3.11", "@types/proper-lockfile": "4.1.4", "@types/tldjs": "2.3.4", - "@typescript-eslint/eslint-plugin": "8.23.0", - "@typescript-eslint/parser": "8.23.0", + "@typescript-eslint/eslint-plugin": "8.32.1", + "@typescript-eslint/parser": "8.32.1", "clean-webpack-plugin": "4.0.0", "concurrently": "9.1.2", "copy-webpack-plugin": "12.0.2", "cross-env": "7.0.3", "css-loader": "7.1.2", - "dotenv": "16.4.7", + "dotenv": "16.5.0", "electron": "34.1.1", "electron-builder": "24.13.3", - "electron-log": "5.2.4", + "electron-log": "5.4.1", "electron-reload": "2.0.0-alpha.1", "electron-store": "8.2.0", - "electron-updater": "6.3.9", + "electron-updater": "6.6.2", "eslint": "8.57.1", - "eslint-config-prettier": "10.0.1", + "eslint-config-prettier": "10.1.5", "eslint-import-resolver-typescript": "3.7.0", "eslint-plugin-import": "2.31.0", "eslint-plugin-rxjs": "5.0.3", "eslint-plugin-rxjs-angular": "2.0.1", - "form-data": "4.0.1", + "form-data": "4.0.3", "html-loader": "5.1.0", "html-webpack-plugin": "5.6.3", "husky": "9.1.7", "jest": "29.7.0", "jest-junit": "16.0.0", "jest-mock-extended": "3.0.7", - "jest-preset-angular": "14.5.0", - "lint-staged": "15.4.1", + "jest-preset-angular": "14.5.5", + "lint-staged": "15.5.2", "mini-css-extract-plugin": "2.9.2", - "minimatch": "3.1.2", - "node-abi": "3.74.0", + "node-abi": "3.75.0", "node-forge": "1.3.1", "node-loader": "2.1.0", "pkg": "5.8.1", @@ -129,11 +128,11 @@ "rimraf": "6.0.1", "rxjs": "7.8.2", "sass": "1.79.4", - "sass-loader": "16.0.4", - "ts-jest": "29.2.5", + "sass-loader": "16.0.5", + "ts-jest": "29.4.0", "ts-loader": "9.5.2", "tsconfig-paths-webpack-plugin": "4.2.0", - "type-fest": "4.32.0", + "type-fest": "4.41.0", "typescript": "5.4.5", "webpack": "5.97.1", "webpack-cli": "6.0.1", @@ -157,14 +156,14 @@ "browser-hrtime": "1.1.8", "chalk": "4.1.2", "commander": "13.1.0", - "core-js": "3.40.0", - "form-data": "4.0.1", + "core-js": "3.42.0", + "form-data": "4.0.3", "google-auth-library": "9.15.1", "googleapis": "144.0.0", "https-proxy-agent": "7.0.6", "inquirer": "8.2.6", "keytar": "7.9.0", - "ldapts": "7.3.1", + "ldapts": "7.4.0", "lowdb": "1.0.0", "ngx-toastr": "19.0.0", "node-fetch": "2.7.0", diff --git a/src/services/azure-directory.service.ts b/src/services/azure-directory.service.ts index 2f6055dc..8c332bfc 100644 --- a/src/services/azure-directory.service.ts +++ b/src/services/azure-directory.service.ts @@ -18,7 +18,9 @@ import { BaseDirectoryService } from "./baseDirectory.service"; import { IDirectoryService } from "./directory.service"; const AzurePublicIdentityAuhtority = "login.microsoftonline.com"; +const AzurePublicGraphEndpoint = "https://graph.microsoft.com"; const AzureGovermentIdentityAuhtority = "login.microsoftonline.us"; +const AzureGovernmentGraphEndpoint = "https://graph.microsoft.us"; const NextLink = "@odata.nextLink"; const DeltaLink = "@odata.deltaLink"; @@ -207,7 +209,7 @@ export class AzureDirectoryService extends BaseDirectoryService implements IDire if (keyword === "excludeadministrativeunit" || keyword === "includeadministrativeunit") { for (const p of pieces) { let auMembers = await this.client - .api(`https://graph.microsoft.com/v1.0/directory/administrativeUnits/${p}/members`) + .api(`${this.getGraphApiEndpoint()}/v1.0/directory/administrativeUnits/${p}/members`) .get(); // eslint-disable-next-line while (true) { @@ -478,7 +480,7 @@ export class AzureDirectoryService extends BaseDirectoryService implements IDire client_id: this.dirConfig.applicationId, client_secret: this.dirConfig.key, grant_type: "client_credentials", - scope: "https://graph.microsoft.com/.default", + scope: `${this.getGraphApiEndpoint()}/.default`, }); const req = https @@ -542,4 +544,10 @@ export class AzureDirectoryService extends BaseDirectoryService implements IDire exp.setSeconds(exp.getSeconds() + expSeconds); this.accessTokenExpiration = exp; } + + private getGraphApiEndpoint(): string { + return this.dirConfig.identityAuthority === AzureGovermentIdentityAuhtority + ? AzureGovernmentGraphEndpoint + : AzurePublicGraphEndpoint; + } }