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

Compare commits

...

17 Commits

Author SHA1 Message Date
Kyle Spearrin
dca69a5428 assign BitwardenToasterService global 2018-05-31 14:41:30 -04:00
Kyle Spearrin
6b1fa0f50c intall for package lock file 2018-05-31 09:22:17 -04:00
Kyle Spearrin
3ab35dc4e0 add lowdb typings 2018-05-31 09:16:34 -04:00
Kyle Spearrin
2aa1fc1acb replace electron store with lowdb 2018-05-31 09:09:05 -04:00
Kyle Spearrin
e6643fa4cb update to electron 2.x 2018-05-31 08:12:35 -04:00
Kyle Spearrin
4848dd8502 update jslib 2018-05-24 09:01:53 -04:00
Kyle Spearrin
4b08d7b4b2 exclude export service 2018-05-17 16:22:37 -04:00
Kyle Spearrin
839189c772 update jslib 2018-05-17 16:01:08 -04:00
Kyle Spearrin
a06ff45c21 update jslib 2018-05-17 10:58:05 -04:00
Kyle Spearrin
c598efcb9f update jslib 2018-05-16 15:30:57 -04:00
Kyle Spearrin
878476d195 make logout async 2018-05-15 23:48:20 -04:00
Kyle Spearrin
82e599fc13 version bump 2018-05-14 08:49:08 -04:00
Kyle Spearrin
79b76687a0 allow settings for user and groups path on ad 2018-05-14 08:46:57 -04:00
Kyle Spearrin
af5349c4cb Merge branch 'master' of github.com:bitwarden/directory-connector 2018-05-09 16:10:42 -04:00
Kyle Spearrin
3de35b481e no need to store response variable 2018-05-09 16:10:40 -04:00
Kyle Spearrin
008bb308e7 Update README.md 2018-05-08 22:54:49 -04:00
Kyle Spearrin
9b44fc4a35 Update README.md 2018-05-08 22:52:03 -04:00
12 changed files with 137 additions and 105 deletions

View File

@@ -14,7 +14,9 @@ Supported directories:
The application is written using Electron with Angular and installs on Windows, macOS, and Linux distributions.
<a href="https://bitwarden.com/#download"><img src="https://imgur.com/SLv9paA.png" width="500" height="113"></a>
<a href="https://help.bitwarden.com/article/directory-sync/#download-and-install"><img src="https://imgur.com/SLv9paA.png" width="500" height="113"></a>
![Directory Connector](http://imgur.com/I6FjN4j.png "Dashboard")
# Build/Run

2
jslib

Submodule jslib updated: 9de9c1655c...e0d5a4d8b7

147
package-lock.json generated
View File

@@ -249,6 +249,21 @@
"@types/node": "8.0.19"
}
},
"@types/lodash": {
"version": "4.14.109",
"resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.109.tgz",
"integrity": "sha512-hop8SdPUEzbcJm6aTsmuwjIYQo1tqLseKCM+s2bBqTU2gErwI4fE+aqUVOlscPSQbKHKgtMMPoC+h4AIGOJYvw==",
"dev": true
},
"@types/lowdb": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@types/lowdb/-/lowdb-1.0.2.tgz",
"integrity": "sha512-0lS8jOba45tcXne01LXkw06x8uqpIKuh8LTwTOo2zmIXCVoXXmIxAemAGoLJvzNc8Q0qBG+fJT0xJMx7N0FLtA==",
"dev": true,
"requires": {
"@types/lodash": "4.14.109"
}
},
"@types/lunr": {
"version": "2.1.5",
"resolved": "https://registry.npmjs.org/@types/lunr/-/lunr-2.1.5.tgz",
@@ -1718,18 +1733,6 @@
}
}
},
"conf": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/conf/-/conf-1.4.0.tgz",
"integrity": "sha512-bzlVWS2THbMetHqXKB8ypsXN4DQ/1qopGwNJi1eYbpwesJcd86FBjFciCQX/YwAhp9bM7NVnPFqZ5LpV7gP0Dg==",
"requires": {
"dot-prop": "4.2.0",
"env-paths": "1.0.0",
"make-dir": "1.2.0",
"pkg-up": "2.0.0",
"write-file-atomic": "2.3.0"
}
},
"configstore": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/configstore/-/configstore-3.1.2.tgz",
@@ -2324,6 +2327,7 @@
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz",
"integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==",
"dev": true,
"requires": {
"is-obj": "1.0.1"
}
@@ -2393,20 +2397,20 @@
"dev": true
},
"electron": {
"version": "1.8.4",
"resolved": "https://registry.npmjs.org/electron/-/electron-1.8.4.tgz",
"integrity": "sha512-2f1cx0G3riMFODXFftF5AHXy+oHfhpntZHTDN66Hxtl09gmEr42B3piNEod9MEmw72f75LX2JfeYceqq1PF8cA==",
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/electron/-/electron-2.0.2.tgz",
"integrity": "sha512-XmkGVoHLOqmjZ2nU/0zEzMl3TZEz452Q1fTJFKjylg4pLYaq7na7V2uxzydVQNQukZGbERoA7ayjxXzTsXbtdA==",
"dev": true,
"requires": {
"@types/node": "8.10.8",
"@types/node": "8.10.17",
"electron-download": "3.3.0",
"extract-zip": "1.6.6"
"extract-zip": "1.6.7"
},
"dependencies": {
"@types/node": {
"version": "8.10.8",
"resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.8.tgz",
"integrity": "sha512-BvcUxNZe9JgiiUVivtiQt3NrPVu9OAQzkxR1Ko9ESftCYU7V6Np5kpDzQwxd+34lsop7SNRdL292Flv52OvCaw==",
"version": "8.10.17",
"resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.17.tgz",
"integrity": "sha512-3N3FRd/rA1v5glXjb90YdYUa+sOB7WrkU2rAhKZnF4TKD86Cym9swtulGuH0p9nxo7fP5woRNa8b0oFTpCO1bg==",
"dev": true
}
}
@@ -2555,7 +2559,7 @@
"requires": {
"debug": "2.6.9",
"fs-extra": "0.30.0",
"home-path": "1.0.5",
"home-path": "1.0.6",
"minimist": "1.2.0",
"nugget": "2.0.1",
"path-exists": "2.1.0",
@@ -2833,14 +2837,6 @@
"chokidar": "1.7.0"
}
},
"electron-store": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/electron-store/-/electron-store-1.3.0.tgz",
"integrity": "sha512-r1Pdl5MwpiCxgbsl0qnwv/GABO5+J/JTO16+KyqL+bOITIk9o3cq3Sw69uO9NgPkpfcKeEwxtJFbtbiBlGTiDA==",
"requires": {
"conf": "1.4.0"
}
},
"electron-to-chromium": {
"version": "1.3.42",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.42.tgz",
@@ -2922,7 +2918,8 @@
"env-paths": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/env-paths/-/env-paths-1.0.0.tgz",
"integrity": "sha1-QWgTO0K7BcOKNbGuQ5fIKYqzaeA="
"integrity": "sha1-QWgTO0K7BcOKNbGuQ5fIKYqzaeA=",
"dev": true
},
"errno": {
"version": "0.1.7",
@@ -3179,28 +3176,17 @@
}
},
"extract-zip": {
"version": "1.6.6",
"resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.6.6.tgz",
"integrity": "sha1-EpDt6NINCHK0Kf0/NRyhKOxe+Fw=",
"version": "1.6.7",
"resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.6.7.tgz",
"integrity": "sha1-qEC0uK9kAyZMjbV/Txp0Mz74H+k=",
"dev": true,
"requires": {
"concat-stream": "1.6.0",
"concat-stream": "1.6.2",
"debug": "2.6.9",
"mkdirp": "0.5.0",
"mkdirp": "0.5.1",
"yauzl": "2.4.1"
},
"dependencies": {
"concat-stream": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.0.tgz",
"integrity": "sha1-CqxmL9Ur54lk1VMvaUeE5wEQrPc=",
"dev": true,
"requires": {
"inherits": "2.0.3",
"readable-stream": "2.3.6",
"typedarray": "0.0.6"
}
},
"debug": {
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
@@ -3209,15 +3195,6 @@
"requires": {
"ms": "2.0.0"
}
},
"mkdirp": {
"version": "0.5.0",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.0.tgz",
"integrity": "sha1-HXMHam35hs2TROFecfzAWkyavxI=",
"dev": true,
"requires": {
"minimist": "0.0.8"
}
}
}
},
@@ -3321,6 +3298,7 @@
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz",
"integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=",
"dev": true,
"requires": {
"locate-path": "2.0.0"
}
@@ -4921,9 +4899,9 @@
"dev": true
},
"home-path": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/home-path/-/home-path-1.0.5.tgz",
"integrity": "sha1-eIspgVsS1Tus9XVkhHbm+QQdEz8=",
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/home-path/-/home-path-1.0.6.tgz",
"integrity": "sha512-wo+yjrdAtoXt43Vy92a+0IPCYViiyLAHyp0QVS4xL/tfvVz5sXIW1ubLZk3nhVkD92fQpUMKX+fzMjr5F489vw==",
"dev": true
},
"hosted-git-info": {
@@ -5147,7 +5125,8 @@
"imurmurhash": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
"integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o="
"integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=",
"dev": true
},
"in-publish": {
"version": "2.0.0",
@@ -5390,7 +5369,8 @@
"is-obj": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz",
"integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8="
"integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=",
"dev": true
},
"is-odd": {
"version": "2.0.0",
@@ -5453,6 +5433,11 @@
"integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=",
"dev": true
},
"is-promise": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz",
"integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o="
},
"is-property": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz",
@@ -5803,6 +5788,7 @@
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz",
"integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=",
"dev": true,
"requires": {
"p-locate": "2.0.0",
"path-exists": "3.0.0"
@@ -5889,6 +5875,18 @@
"signal-exit": "3.0.2"
}
},
"lowdb": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/lowdb/-/lowdb-1.0.0.tgz",
"integrity": "sha512-2+x8esE/Wb9SQ1F9IHaYWfsC9FIecLOPrK4g17FGEayjUWH172H6nwicRovGvSE2CPZouc2MCIqCI7h9d+GftQ==",
"requires": {
"graceful-fs": "4.1.11",
"is-promise": "2.1.0",
"lodash": "4.17.5",
"pify": "3.0.0",
"steno": "0.4.4"
}
},
"lower-case": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/lower-case/-/lower-case-1.1.4.tgz",
@@ -5934,6 +5932,7 @@
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.2.0.tgz",
"integrity": "sha512-aNUAa4UMg/UougV25bbrU4ZaaKNjJ/3/xnvg/twpmKROPdKZPZ9wGgI0opdZzO8q/zUFawoUuixuOv33eZ61Iw==",
"dev": true,
"requires": {
"pify": "3.0.0"
}
@@ -6906,6 +6905,7 @@
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.2.0.tgz",
"integrity": "sha512-Y/OtIaXtUPr4/YpMv1pCL5L5ed0rumAaAeBSj12F+bSlMdys7i8oQF/GUJmfpTS/QoaRrS/k6pma29haJpsMng==",
"dev": true,
"requires": {
"p-try": "1.0.0"
}
@@ -6914,6 +6914,7 @@
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz",
"integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=",
"dev": true,
"requires": {
"p-limit": "1.2.0"
}
@@ -6921,7 +6922,8 @@
"p-try": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz",
"integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M="
"integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=",
"dev": true
},
"package-json": {
"version": "4.0.1",
@@ -7041,7 +7043,8 @@
"path-exists": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
"integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU="
"integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=",
"dev": true
},
"path-is-absolute": {
"version": "1.0.1",
@@ -7129,14 +7132,6 @@
"find-up": "2.1.0"
}
},
"pkg-up": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-2.0.0.tgz",
"integrity": "sha1-yBmscoBZpGHKscOImivjxJoATX8=",
"requires": {
"find-up": "2.1.0"
}
},
"plist": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/plist/-/plist-3.0.1.tgz",
@@ -8748,7 +8743,8 @@
"signal-exit": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
"integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0="
"integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=",
"dev": true
},
"single-line-log": {
"version": "1.1.2",
@@ -9085,6 +9081,14 @@
"readable-stream": "2.3.6"
}
},
"steno": {
"version": "0.4.4",
"resolved": "https://registry.npmjs.org/steno/-/steno-0.4.4.tgz",
"integrity": "sha1-BxEFvfwobmYVwEA8J+nXtdy4Vcs=",
"requires": {
"graceful-fs": "4.1.11"
}
},
"stream-browserify": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz",
@@ -11047,6 +11051,7 @@
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.3.0.tgz",
"integrity": "sha512-xuPeK4OdjWqtfi59ylvVL0Yn35SF3zgcAcv7rBPFHVaEapaDr4GdGgm3j7ckTwH9wHL7fGmgfAnb0+THrHb8tA==",
"dev": true,
"requires": {
"graceful-fs": "4.1.11",
"imurmurhash": "0.1.4",

View File

@@ -112,6 +112,7 @@
"@ngtools/webpack": "1.10.2",
"@types/keytar": "^4.0.1",
"@types/ldapjs": "^1.0.3",
"@types/lowdb": "^1.0.1",
"@types/lunr": "2.1.5",
"@types/node": "8.0.19",
"@types/node-forge": "0.7.1",
@@ -120,7 +121,7 @@
"concurrently": "3.5.1",
"copy-webpack-plugin": "^4.2.0",
"css-loader": "^0.28.7",
"electron": "1.8.4",
"electron": "2.0.2",
"electron-builder": "^20.8.1",
"electron-rebuild": "1.7.3",
"electron-reload": "1.2.2",
@@ -160,11 +161,11 @@
"bootstrap": "4.1.0",
"core-js": "2.4.1",
"electron-log": "2.2.14",
"electron-store": "1.3.0",
"electron-updater": "2.21.4",
"googleapis": "29.0.0",
"keytar": "4.1.0",
"ldapjs": "1.0.2",
"lowdb": "1.0.0",
"lunr": "2.1.6",
"node-forge": "0.7.1",
"rxjs": "5.5.6",

View File

@@ -69,7 +69,9 @@ export class AppComponent implements OnInit {
private platformUtilsService: PlatformUtilsService, private ngZone: NgZone,
private componentFactoryResolver: ComponentFactoryResolver, private messagingService: MessagingService,
private configurationService: ConfigurationService, private syncService: SyncService,
private stateService: StateService, private apiService: ApiService) { }
private stateService: StateService, private apiService: ApiService) {
(window as any).BitwardenToasterService = toasterService;
}
ngOnInit() {
this.broadcasterService.subscribe(BroadcasterSubscriptionId, async (message: any) => {

View File

@@ -1,3 +1,5 @@
import { remote } from 'electron';
import {
APP_INITIALIZER,
NgModule,
@@ -9,7 +11,6 @@ import { ElectronLogService } from 'jslib/electron/services/electronLog.service'
import { ElectronPlatformUtilsService } from 'jslib/electron/services/electronPlatformUtils.service';
import { ElectronRendererMessagingService } from 'jslib/electron/services/electronRendererMessaging.service';
import { ElectronRendererSecureStorageService } from 'jslib/electron/services/electronRendererSecureStorage.service';
import { ElectronStorageService } from 'jslib/electron/services/electronStorage.service';
import { isDev } from 'jslib/electron/utils';
import { AuthGuardService } from './auth-guard.service';
@@ -31,6 +32,7 @@ import { ConstantsService } from 'jslib/services/constants.service';
import { ContainerService } from 'jslib/services/container.service';
import { CryptoService } from 'jslib/services/crypto.service';
import { EnvironmentService } from 'jslib/services/environment.service';
import { LowdbStorageService } from 'jslib/services/lowdbStorage.service';
import { NodeCryptoFunctionService } from 'jslib/services/nodeCryptoFunction.service';
import { StateService } from 'jslib/services/state.service';
import { TokenService } from 'jslib/services/token.service';
@@ -57,21 +59,21 @@ const stateService = new StateService();
const platformUtilsService = new ElectronPlatformUtilsService(i18nService, true);
const broadcasterService = new BroadcasterService();
const messagingService = new ElectronRendererMessagingService(broadcasterService);
const storageService: StorageServiceAbstraction = new ElectronStorageService();
const storageService: StorageServiceAbstraction = new LowdbStorageService(null, remote.app.getPath('userData'));
const secureStorageService: StorageServiceAbstraction = new ElectronRendererSecureStorageService();
const cryptoFunctionService: CryptoFunctionServiceAbstraction = new NodeCryptoFunctionService();
const cryptoService = new CryptoService(storageService, secureStorageService, cryptoFunctionService);
const appIdService = new AppIdService(storageService);
const tokenService = new TokenService(storageService);
const apiService = new ApiService(tokenService, platformUtilsService,
(expired: boolean) => messagingService.send('logout', { expired: expired }));
async (expired: boolean) => messagingService.send('logout', { expired: expired }));
const environmentService = new EnvironmentService(apiService, storageService);
const userService = new UserService(tokenService, storageService);
const containerService = new ContainerService(cryptoService, platformUtilsService);
const authService = new AuthService(cryptoService, apiService, userService, tokenService, appIdService,
i18nService, platformUtilsService, messagingService, false);
const configurationService = new ConfigurationService(storageService, secureStorageService);
const syncSevrice = new SyncService(configurationService, logService, cryptoFunctionService, apiService,
const syncService = new SyncService(configurationService, logService, cryptoFunctionService, apiService,
messagingService, i18nService);
const analytics = new Analytics(window, () => true, platformUtilsService, storageService, appIdService);
@@ -134,7 +136,7 @@ export function initFactory(): Function {
{ provide: StateServiceAbstraction, useValue: stateService },
{ provide: LogServiceAbstraction, useValue: logService },
{ provide: ConfigurationService, useValue: configurationService },
{ provide: SyncService, useValue: syncSevrice },
{ provide: SyncService, useValue: syncService },
{
provide: APP_INITIALIZER,
useFactory: initFactory,

View File

@@ -197,17 +197,17 @@
<small class="text-muted form-text" *ngIf="directory === directoryType.Okta">{{'ex' | i18n}} exclude:joe@company.com | profile.firstName eq "John"</small>
<small class="text-muted form-text" *ngIf="directory === directoryType.GSuite">{{'ex' | i18n}} exclude:joe@company.com | orgName=Engineering</small>
</div>
<div class="form-group" [hidden]="directory != directoryType.Ldap">
<label for="userPath">{{'userPath' | i18n}}</label>
<input type="text" class="form-control" id="userPath" name="UserPath" [(ngModel)]="sync.userPath">
<small class="text-muted form-text">{{'ex' | i18n}} CN=Users</small>
</div>
<div [hidden]="directory != directoryType.Ldap || ldap.ad">
<div class="form-group">
<label for="userObjectClass">{{'userObjectClass' | i18n}}</label>
<input type="text" class="form-control" id="userObjectClass" name="UserObjectClass" [(ngModel)]="sync.userObjectClass">
<small class="text-muted form-text">{{'ex' | i18n}} inetOrgPerson</small>
</div>
<div class="form-group">
<label for="userPath">{{'userPath' | i18n}}</label>
<input type="text" class="form-control" id="userPath" name="UserPath" [(ngModel)]="sync.userPath">
<small class="text-muted form-text">{{'ex' | i18n}} CN=Users</small>
</div>
<div class="form-group">
<label for="userEmailAttribute">{{'userEmailAttribute' | i18n}}</label>
<input type="text" class="form-control" id="userEmailAttribute" name="UserEmailAttribute" [(ngModel)]="sync.userEmailAttribute">
@@ -231,17 +231,18 @@
<small class="text-muted form-text" *ngIf="directory === directoryType.Okta">{{'ex' | i18n}} include:Sales,IT | type eq "APP_GROUP"</small>
<small class="text-muted form-text" *ngIf="directory === directoryType.GSuite">{{'ex' | i18n}} include:Sales,IT</small>
</div>
<div class="form-group" [hidden]="directory != directoryType.Ldap">
<label for="groupPath">{{'groupPath' | i18n}}</label>
<input type="text" class="form-control" id="groupPath" name="GroupPath" [(ngModel)]="sync.groupPath">
<small class="text-muted form-text" *ngIf="!ldap.ad">{{'ex' | i18n}} CN=Groups</small>
<small class="text-muted form-text" *ngIf="ldap.ad">{{'ex' | i18n}} CN=Users</small>
</div>
<div [hidden]="directory != directoryType.Ldap || ldap.ad">
<div class="form-group">
<label for="groupObjectClass">{{'groupObjectClass' | i18n}}</label>
<input type="text" class="form-control" id="groupObjectClass" name="GroupObjectClass" [(ngModel)]="sync.groupObjectClass">
<small class="text-muted form-text">{{'ex' | i18n}} groupOfUniqueNames</small>
</div>
<div class="form-group">
<label for="groupPath">{{'groupPath' | i18n}}</label>
<input type="text" class="form-control" id="groupPath" name="GroupPath" [(ngModel)]="sync.groupPath">
<small class="text-muted form-text">{{'ex' | i18n}} CN=Groups</small>
</div>
<div class="form-group">
<label for="groupNameAttribute">{{'groupNameAttribute' | i18n}}</label>
<input type="text" class="form-control" id="groupNameAttribute" name="GroupNameAttribute" [(ngModel)]="sync.groupNameAttribute">

View File

@@ -80,13 +80,18 @@ export class SettingsComponent implements OnInit, OnDestroy {
this.sync.creationDateAttribute = 'whenCreated';
this.sync.revisionDateAttribute = 'whenChanged';
this.sync.emailPrefixAttribute = 'sAMAccountName';
this.sync.groupPath = 'CN=Users';
this.sync.userPath = 'CN=Users';
this.sync.memberAttribute = 'member';
this.sync.userObjectClass = 'person';
this.sync.groupObjectClass = 'group';
this.sync.userEmailAttribute = 'mail';
this.sync.groupNameAttribute = 'name';
if (this.sync.groupPath == null) {
this.sync.groupPath = 'CN=Users';
}
if (this.sync.userPath == null) {
this.sync.userPath = 'CN=Users';
}
}
if (this.sync.interval != null) {

View File

@@ -5,10 +5,11 @@ import { MenuMain } from './main/menu.main';
import { MessagingMain } from './main/messaging.main';
import { I18nService } from './services/i18n.service';
import { LowdbStorageService } from 'jslib/services/lowdbStorage.service';
import { KeytarStorageListener } from 'jslib/electron/keytarStorageListener';
import { ElectronLogService } from 'jslib/electron/services/electronLog.service';
import { ElectronMainMessagingService } from 'jslib/electron/services/electronMainMessaging.service';
import { ElectronStorageService } from 'jslib/electron/services/electronStorage.service';
import { TrayMain } from 'jslib/electron/tray.main';
import { UpdaterMain } from 'jslib/electron/updater.main';
import { WindowMain } from 'jslib/electron/window.main';
@@ -16,7 +17,7 @@ import { WindowMain } from 'jslib/electron/window.main';
export class Main {
logService: ElectronLogService;
i18nService: I18nService;
storageService: ElectronStorageService;
storageService: LowdbStorageService;
messagingService: ElectronMainMessagingService;
keytarStorageListener: KeytarStorageListener;
@@ -50,7 +51,7 @@ export class Main {
this.logService = new ElectronLogService(null, app.getPath('userData'));
this.i18nService = new I18nService('en', './locales/');
this.storageService = new ElectronStorageService();
this.storageService = new LowdbStorageService(null, app.getPath('userData'));
this.windowMain = new WindowMain(this.storageService, 800, 600);
this.menuMain = new MenuMain(this);
@@ -71,6 +72,7 @@ export class Main {
}
bootstrap() {
this.storageService.init();
this.keytarStorageListener.init();
this.windowMain.init().then(async () => {
await this.i18nService.init(app.getLocale());

View File

@@ -2,7 +2,7 @@
"name": "bitwarden-directory-connector",
"productName": "Bitwarden Directory Connector",
"description": "Sync your user directory to your Bitwarden organization.",
"version": "2.0.1",
"version": "2.0.2",
"author": "8bit Solutions LLC <hello@bitwarden.com> (https://bitwarden.com)",
"homepage": "https://bitwarden.com",
"license": "GPL-3.0",
@@ -13,8 +13,8 @@
},
"dependencies": {
"electron-log": "2.2.14",
"electron-store": "1.3.0",
"electron-updater": "2.21.4",
"keytar": "4.1.0"
"keytar": "4.1.0",
"lowdb": "1.0.0"
}
}

View File

@@ -85,7 +85,7 @@ export class SyncService {
throw new Error('Organization not set.');
}
const res = await this.apiService.postImportDirectory(orgId, req);
await this.apiService.postImportDirectory(orgId, req);
await this.configurationService.saveLastSyncHash(hash);
} else {
groups = null;

View File

@@ -11,11 +11,21 @@
"types": [],
"baseUrl": ".",
"paths": {
"jslib/*": [ "jslib/src/*" ],
"@angular/*": [ "node_modules/@angular/*" ],
"angular2-toaster": [ "node_modules/angular2-toaster" ],
"angulartics2": [ "node_modules/angulartics2" ],
"electron": [ "node_modules/electron" ]
"jslib/*": [
"jslib/src/*"
],
"@angular/*": [
"node_modules/@angular/*"
],
"angular2-toaster": [
"node_modules/angular2-toaster"
],
"angulartics2": [
"node_modules/angulartics2"
],
"electron": [
"node_modules/electron"
]
}
},
"exclude": [
@@ -23,6 +33,8 @@
"jslib/node_modules",
"jslib/src/services/webCryptoFunction.service.ts",
"jslib/src/services/search.service.ts",
"jslib/src/services/nodeApi.service.ts",
"jslib/src/services/export.service.ts",
"jslib/src/angular/components/export.component.ts",
"dist",
"jslib/dist",