feat(webapp): add Active Directory web client#1849
feat(webapp): add Active Directory web client#1849Krista House (kristahouse) wants to merge 2 commits into
Conversation
Adds Active Directory web-client support for LDAP and LDAPS sessions, including the connection form, session lifecycle integration, LDAP WASM data adapter, and WebTerminal Active Directory composite wiring. Integrates the Active Directory UI with the Gateway theme using scoped bridge tokens and the published Active Directory GUI package. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Implementation notes:
|
Let maintainers know that an action is required on their side
|
There was a problem hiding this comment.
Pull request overview
Adds an Active Directory (LDAP/LDAPS) web client experience to the standalone Gateway UI, integrating Devolutions’ published AD web component and wiring it into the existing web-client session/tab architecture.
Changes:
- Introduces a new Active Directory web-client session component (token fetch, WASM LDAP initialization, connect/error handling, tab icon updates).
- Adds an Active Directory connection form (domain override, port, LDAPS toggle, OU) and integrates it into the existing connect flow.
- Updates webapp dependencies/styles to include the AD UI package, LDAP WASM package, and theme bridging.
Reviewed changes
Copilot reviewed 23 out of 24 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| webapp/pnpm-lock.yaml | Adds lockfile entries for AD/LDAP packages and updates PrimeUIX versions. |
| webapp/apps/gateway-ui/src/client/app/styles/ad-theme-bridge.gateway.scss | Introduces CSS variable bridging to align AD component theming with Gateway themes. |
| webapp/apps/gateway-ui/src/client/app/shared/services/web-client.service.ts | Adds AD token generation support and protocol mapping (ldap/ldaps). |
| webapp/apps/gateway-ui/src/client/app/shared/models/web-session.model.ts | Extends session type mappings to include the AD web-client component and form input type. |
| webapp/apps/gateway-ui/src/client/app/shared/interfaces/forms.interfaces.ts | Adds ActiveDirectoryFormDataInput and includes it in the form union. |
| webapp/apps/gateway-ui/src/client/app/shared/interfaces/connection-params.interfaces.ts | Adds ActiveDirectoryConnectionParameters and a type guard helper. |
| webapp/apps/gateway-ui/src/client/app/shared/enums/web-client-protocol.enum.ts | Adds Protocol.ActiveDirectory, label mapping, and protocol helper. |
| webapp/apps/gateway-ui/src/client/app/modules/web-client/web-client.module.ts | Registers the AD web component and new Gateway AD session/form components. |
| webapp/apps/gateway-ui/src/client/app/modules/web-client/form/web-client-form.component.ts | Adds AD-specific hostname labeling and protocol selection helper. |
| webapp/apps/gateway-ui/src/client/app/modules/web-client/form/web-client-form.component.html | Renders the AD-specific form when the AD protocol is selected and updates hostname label rendering. |
| webapp/apps/gateway-ui/src/client/app/modules/web-client/form/form-components/active-directory/active-directory-form.component.ts | New AD form component adding port/LDAPS/OU controls and validators. |
| webapp/apps/gateway-ui/src/client/app/modules/web-client/form/form-components/active-directory/active-directory-form.component.html | New AD form UI (domain override, port validation message, LDAPS checkbox, OU input). |
| webapp/apps/gateway-ui/src/client/app/modules/web-client/form/form-components/active-directory/active-directory-form.component.scss | Styling for the AD form layout. |
| webapp/apps/gateway-ui/src/client/app/modules/web-client/active-directory/web-client-active-directory.component.ts | New AD session component: token flow, WASM init, connect, event handling, session metadata. |
| webapp/apps/gateway-ui/src/client/app/modules/web-client/active-directory/web-client-active-directory.component.html | Hosts <web-active-directory> and PrimeNG confirm/toast surfaces. |
| webapp/apps/gateway-ui/src/client/app/modules/web-client/active-directory/web-client-active-directory.component.scss | Styles toast/host layout for the AD session UI. |
| webapp/apps/gateway-ui/src/client/app/modules/web-client/active-directory/services/active-directory-ui.service.ts | PrimeNG-backed UI adapter (toast/confirm/loading cursor) for the AD component. |
| webapp/apps/gateway-ui/src/client/app/modules/web-client/active-directory/services/active-directory-translator.service.ts | Translator implementation and translation table for the AD component. |
| webapp/apps/gateway-ui/src/client/app/modules/web-client/active-directory/services/active-directory-session-store.service.ts | In-memory LDAP session storage for the AD data provider. |
| webapp/apps/gateway-ui/src/client/app/modules/web-client/active-directory/services/active-directory-session-manager.service.ts | In-memory AD web session config manager (per sessionId). |
| webapp/apps/gateway-ui/src/client/app/modules/web-client/active-directory/services/active-directory-data.service.ts | LDAP WASM-backed data provider implementation (connect/bind/search/modify/add/delete, paging). |
| webapp/apps/gateway-ui/src/client/app/app.constants.ts | Adds AD protocol icon constant, AD jet path constant, and protocol name mappings for ldap/ldaps. |
| webapp/apps/gateway-ui/src/assets/css/main.scss | Includes AD component styles and adds an icon-font override for PrimeIcons. |
| webapp/apps/gateway-ui/package.json | Adds AD/LDAP packages and updates PrimeUIX theme/util versions. |
Files not reviewed (1)
- webapp/pnpm-lock.yaml: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Redact invalid Active Directory connection logging, guard the AD port template control, use the LDAPS default port when needed, validate required AD connection parameters, and use the installed Active Directory icon class. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
| ldap: Protocol.ActiveDirectory, | ||
| ldaps: Protocol.ActiveDirectory, |
There was a problem hiding this comment.
Addressed locally, not pushed yet per request: NetScanEntry now preserves the scanned service protocol (ldap vs ldaps), and the form selection initializes AD useLdaps plus the default port (389/636) from that scanned transport.
| this.webClientConnectionClosed(); | ||
| } | ||
|
|
||
| this.activeDirectorySessionManager.clearWebSessionConfig(this.webSessionId); |
There was a problem hiding this comment.
Addressed locally, not pushed yet per request: the component now retains the generated forwarding session ID and clears the AD session config with that key during teardown instead of using the unrelated web session ID.
| const AD_CONFIRM_KEY = 'adc-confirm-dialog'; | ||
| const AD_TOAST_KEY = 'adc-toast'; |
| clearToast(key?: string): void { | ||
| this.messageService.clear(key); | ||
| } |
There was a problem hiding this comment.
Addressed locally, not pushed yet per request: clearToast() now defaults to the AD toast key instead of passing undefined through to the shared PrimeNG message service.
| showLoading(): void { | ||
| this.loadingCount++; | ||
| document.body.style.cursor = 'wait'; |
There was a problem hiding this comment.
Addressed locally, not pushed yet per request: AD loading cursor state is now coordinated with a static/global count, preserves the prior body cursor, and releases any outstanding count from ngOnDestroy.
| const parts = serverComputerName.split('.'); | ||
|
|
||
| return { | ||
| domain: parts.length > 1 ? parts.slice(1).join('.') : undefined, | ||
| serverComputerName, | ||
| }; |
There was a problem hiding this comment.
Addressed locally, not pushed yet per request: domain inference now detects IP literals and avoids deriving an authentication domain from dotted IPv4 addresses.
| sendTerminateSessionCmd(): void { | ||
| if (!this.activeDirectoryHandle || !this.currentStatus.isInitialized) { | ||
| return; | ||
| } | ||
|
|
||
| this.currentStatus.isInitialized = false; | ||
| this.activeDirectoryHandle.close(); | ||
| } |
There was a problem hiding this comment.
Addressed locally, not pushed yet per request: termination now closes an existing AD handle even while setup is still in progress, so closing a tab cannot leave the forward connection running before initialization completes.
| if (domain) { | ||
| return { | ||
| domain, | ||
| serverComputerName: `${serverComputerName.replace(`.${domain}`, '')}.${domain}`, | ||
| }; |
There was a problem hiding this comment.
Addressed locally, not pushed yet per request: domain/server-name resolution now keeps already-qualified hosts unchanged and only appends DNS suffix-style overrides to single-label hostnames.
Adds Active Directory support to the standalone Gateway web client, allowing users to open LDAP and LDAPS sessions from the Gateway UI.
The new experience includes an Active Directory connection form, session tab handling, LDAP-backed data operations, and theme-aligned Active Directory UI integration using the published Active Directory web component package.
Issue: N/A