1
0
mirror of https://github.com/bitwarden/web synced 2025-12-06 00:03:28 +00:00

Disable key connector when org doesn't have the feature (#1301)

This commit is contained in:
Oscar Hinton
2021-11-17 12:11:20 +01:00
committed by GitHub
parent f740d8b057
commit d6c419bad8
6 changed files with 31 additions and 14 deletions

View File

@@ -12,6 +12,8 @@
{{'ssoPolicyHelpStart' | i18n}}
<a routerLink="../policies">{{'ssoPolicyHelpLink' | i18n}}</a>
{{'ssoPolicyHelpEnd' | i18n}}
<br>
{{'ssoPolicyHelpKeyConnector' | i18n}}
</p>
<div class="form-group">
@@ -25,22 +27,27 @@
<div class="form-group">
<label>{{'memberDecryptionOption' | i18n}}</label>
<div class="form-check form-check-block">
<input class="form-check-input" type="radio" id="memberDecryptionPass" [value]="false" formControlName="useKeyConnector">
<input class="form-check-input" type="radio" id="memberDecryptionPass" [value]="false" formControlName="keyConnectorEnabled">
<label class="form-check-label" for="memberDecryptionPass">
{{'masterPass' | i18n}}
<small>{{'memberDecryptionPassDesc' | i18n}}</small>
</label>
</div>
<div class="form-check mt-2 form-check-block">
<input class="form-check-input" type="radio" id="memberDecryptionKey" [value]="true" formControlName="useKeyConnector">
<input class="form-check-input" type="radio" id="memberDecryptionKey" [value]="true" formControlName="keyConnectorEnabled"
[attr.disabled]="!organization.useKeyConnector || null">
<label class="form-check-label" for="memberDecryptionKey">
{{'keyConnector' | i18n}}
<a target="_blank" rel="noopener" appA11yTitle="{{'learnMore' | i18n}}"
href="https://bitwarden.com/help/article/about-key-connector/">
<i class="fa fa-question-circle-o" aria-hidden="true"></i>
</a>
<small>{{'memberDecryptionKeyConnectorDesc' | i18n}}</small>
</label>
</div>
</div>
<ng-container *ngIf="data.value.useKeyConnector">
<ng-container *ngIf="data.value.keyConnectorEnabled">
<app-callout type="warning" [useAlertRole]="true">
{{'keyConnectorWarning' | i18n}}
</app-callout>

View File

@@ -8,6 +8,10 @@ import { ActivatedRoute } from '@angular/router';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { UserService } from 'jslib-common/abstractions/user.service';
import { Organization } from 'jslib-common/models/domain/organization';
import { OrganizationSsoRequest } from 'jslib-common/models/request/organization/organizationSsoRequest';
@Component({
@@ -25,6 +29,7 @@ export class SsoComponent implements OnInit {
loading = true;
organizationId: string;
organization: Organization;
formPromise: Promise<any>;
callbackPath: string;
@@ -37,7 +42,7 @@ export class SsoComponent implements OnInit {
data = this.fb.group({
configType: [],
useKeyConnector: [],
keyConnectorEnabled: [],
keyConnectorUrl: [],
// OpenId
@@ -75,7 +80,8 @@ export class SsoComponent implements OnInit {
});
constructor(private fb: FormBuilder, private route: ActivatedRoute, private apiService: ApiService,
private platformUtilsService: PlatformUtilsService, private i18nService: I18nService) { }
private platformUtilsService: PlatformUtilsService, private i18nService: I18nService,
private userService: UserService) { }
async ngOnInit() {
this.route.parent.parent.params.subscribe(async params => {
@@ -85,6 +91,7 @@ export class SsoComponent implements OnInit {
}
async load() {
this.organization = await this.userService.getOrganization(this.organizationId);
const ssoSettings = await this.apiService.getOrganizationSso(this.organizationId);
this.data.patchValue(ssoSettings.data);