1
0
mirror of https://github.com/bitwarden/directory-connector synced 2025-12-05 23:53:21 +00:00

Compare commits

...

33 Commits

Author SHA1 Message Date
Jimmy Vo
30c34d4fd6 Merge branch 'main' into renovate/lock-file-maintenance 2025-06-26 10:28:29 -04:00
renovate[bot]
570bcf1581 [deps]: Update ts-jest to v29.4.0 (#759)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-26 14:49:56 +01:00
renovate[bot]
fc06bf401a [deps]: Update electron-log to v5.4.1 (#751)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-26 14:41:01 +01:00
Andy Pixley
61d7c996c1 [BRE-848] Adding Workflow Permissions (#798) 2025-06-23 11:14:00 -05:00
renovate[bot]
71a19fecaa [deps]: Update sass-loader to v16.0.5 (#747)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-23 14:51:51 +01:00
renovate[bot]
ae37cea276 [deps]: Update form-data to v4.0.3 (#744)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-23 14:47:48 +01:00
renovate[bot]
09f1f6981c [deps]: Update @electron/rebuild to v3.7.2 (#741)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-23 14:43:57 +01:00
Vince Grassia
ceff0559f2 Remove checksum assets from releases (#795) 2025-06-12 12:06:11 -04:00
Matt Andreko
4d55bf0527 Added explicit permissions to check-run (#794) 2025-06-09 14:55:48 -04:00
renovate[bot]
7347c1992f [deps]: Update sonarsource/sonarqube-scan-action action to v5 (#790)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-03 14:29:32 -04:00
Brandon Treston
46d2797d8c Lock file maintenance (#791)
* [deps]: Lock file maintenance

* wip deps

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-03 10:04:15 -04:00
Vincent Salucci
ed58d7c758 chore: bump verstion to v2025.6.0 (#793) 2025-06-02 11:17:31 -05:00
renovate[bot]
cd6bbd792a [deps]: Update node-abi to v3.75.0 (#779)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-02 09:52:51 -05:00
Rui Tomé
3b3ea8ac47 [PM-15456] Update AzureDirectoryService to dynamically select Graph API endpoint based on identity authority (public or government) (#777)
Co-authored-by: bnagawiecki <107435978+bnagawiecki@users.noreply.github.com>
2025-06-02 14:00:07 +01:00
Matt Andreko
5f9adf9ab7 fix: update scan workflow (#792) 2025-06-02 08:28:33 -04:00
Brandon
05aaf6d9ba wip testing error 2025-05-29 12:34:20 -04:00
Brandon
773015ba74 npm ci 2025-05-29 12:13:47 -04:00
Brandon
bfb09194e9 cleanup 2025-05-29 12:12:05 -04:00
Brandon
19e74d11ac clean up 2025-05-29 12:10:56 -04:00
Brandon
4628b280b6 pin parse5 to <7.3.0 2025-05-29 11:49:01 -04:00
renovate[bot]
1deb22a446 [deps]: Update eslint-config-prettier to v10.1.5 (#753)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-23 11:29:23 -05:00
renovate[bot]
115a60316d [deps]: Update lint-staged to v15.5.2 (#757)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-23 11:11:09 -05:00
renovate[bot]
e11225b2ce [deps]: Update typescript-eslint monorepo to v8.32.1 (#761)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-22 14:51:42 -05:00
renovate[bot]
4909d306ba [deps]: Update dotenv to v16.5.0 (#749)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-22 10:53:01 -05:00
renovate[bot]
caa8c4d070 [deps]: Update core-js to v3.42.0 (#748)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-21 09:36:15 -04:00
Brandon Treston
ed1d941282 remove dependency (#783) 2025-05-21 09:31:45 -04:00
renovate[bot]
f6f874360f [deps]: Update electron-updater to v6.6.2 (#752)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-19 16:54:54 -04:00
renovate[bot]
18b110e70d [deps]: Update ldapts to v7.4.0 (#756)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-19 12:54:17 -04:00
renovate[bot]
83c42cec73 [deps]: Update type-fest to v4.41.0 (#760)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Brandon Treston <btreston@bitwarden.com>
2025-05-19 11:46:23 -04:00
renovate[bot]
2d80fceb8c [deps]: Update jest-preset-angular to v14.5.5 (#745)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Brandon Treston <btreston@bitwarden.com>
2025-05-19 11:02:43 -04:00
renovate[bot]
86f117927a [deps]: Lock file maintenance 2025-05-19 14:25:07 +00:00
renovate[bot]
0489f0cbe9 [deps]: Update angular-cli monorepo to v17.3.17 (#742)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Brandon Treston <btreston@bitwarden.com>
2025-05-19 10:19:53 -04:00
Brandon Treston
c5d4cb9fb6 fix null error (#782) 2025-05-14 11:12:01 -04:00
9 changed files with 1181 additions and 1173 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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,

View File

@@ -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:

2231
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -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",
@@ -73,15 +73,15 @@
"test:types": "npx tsc --noEmit"
},
"devDependencies": {
"@angular-devkit/build-angular": "17.3.11",
"@angular-devkit/build-angular": "17.3.17",
"@angular-eslint/eslint-plugin-template": "17.5.3",
"@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.11",
"@ngtools/webpack": "17.3.17",
"@types/inquirer": "8.2.10",
"@types/jest": "29.5.14",
"@types/lowdb": "1.0.15",
@@ -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,21 +156,22 @@
"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",
"proper-lockfile": "4.1.2",
"rxjs": "7.8.2",
"tldjs": "2.3.1",
"zone.js": "0.14.10"
"zone.js": "0.14.10",
"parse5": "7.2.1"
},
"engines": {
"node": "~22.13.0",

View File

@@ -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;
}
}

View File

@@ -26,7 +26,7 @@ export class BatchRequestBuilder implements RequestBuilder {
const requests: OrganizationImportRequest[] = [];
if (users.length > 0) {
if (users?.length > 0) {
const usersRequest = users.map((u) => {
return {
email: u.email,
@@ -48,7 +48,7 @@ export class BatchRequestBuilder implements RequestBuilder {
}
}
if (groups.length > 0) {
if (groups?.length > 0) {
const groupRequest = groups.map((g) => {
return {
name: g.name,

View File

@@ -215,7 +215,7 @@ export class SyncService {
users: UserEntry[],
syncConfig: SyncConfiguration,
): OrganizationImportRequest[] {
if (syncConfig.largeImport && groups.length + users.length > batchSize) {
if (syncConfig.largeImport && (groups?.length ?? 0) + (users?.length ?? 0) > batchSize) {
return this.batchRequestBuilder.buildRequest(groups, users, syncConfig);
} else {
return this.singleRequestBuilder.buildRequest(groups, users, syncConfig);