mirror of
https://github.com/bitwarden/web
synced 2025-12-06 00:03:28 +00:00
Compare commits
2 Commits
bug/ps-136
...
feature/ap
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1258989f8a | ||
|
|
58d9ac5ebc |
@@ -25,7 +25,7 @@ export class VaultFilterComponent extends BaseVaultFilterComponent {
|
||||
}
|
||||
|
||||
searchTextChanged() {
|
||||
this.onSearchTextChanged.emit(this.searchText);
|
||||
this.onSearchTextChanged.emit(this.searchText.normalize("NFD").replace(/[\u0300-\u036f]/g, ""));
|
||||
}
|
||||
|
||||
async initCollections() {
|
||||
|
||||
@@ -35,6 +35,10 @@
|
||||
icon="bwi bwi-key"
|
||||
*ngIf="clientSecret"
|
||||
>
|
||||
<p class="mb-1">
|
||||
<strong>combined:</strong>
|
||||
<code>{{ combinedApiKey }}</code>
|
||||
</p>
|
||||
<p class="mb-1">
|
||||
<strong>client_id:</strong><br />
|
||||
<code>{{ clientId }}</code>
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import { Component } from "@angular/core";
|
||||
import { Component, OnInit } from "@angular/core";
|
||||
|
||||
import { CryptoService } from "jslib-common/abstractions/crypto.service";
|
||||
import { LogService } from "jslib-common/abstractions/log.service";
|
||||
import { UserVerificationService } from "jslib-common/abstractions/userVerification.service";
|
||||
import { Utils } from "jslib-common/misc/utils";
|
||||
import { SecretVerificationRequest } from "jslib-common/models/request/secretVerificationRequest";
|
||||
import { ApiKeyResponse } from "jslib-common/models/response/apiKeyResponse";
|
||||
import { Verification } from "jslib-common/types/verification";
|
||||
@@ -10,7 +12,7 @@ import { Verification } from "jslib-common/types/verification";
|
||||
selector: "app-api-key",
|
||||
templateUrl: "api-key.component.html",
|
||||
})
|
||||
export class ApiKeyComponent {
|
||||
export class ApiKeyComponent implements OnInit {
|
||||
keyType: string;
|
||||
isRotation: boolean;
|
||||
postKey: (entityId: string, request: SecretVerificationRequest) => Promise<ApiKeyResponse>;
|
||||
@@ -25,12 +27,20 @@ export class ApiKeyComponent {
|
||||
formPromise: Promise<ApiKeyResponse>;
|
||||
clientId: string;
|
||||
clientSecret: string;
|
||||
clientKey: string;
|
||||
clientLocalKeyHash: string;
|
||||
|
||||
constructor(
|
||||
private cryptoService: CryptoService,
|
||||
private userVerificationService: UserVerificationService,
|
||||
private logService: LogService
|
||||
) {}
|
||||
|
||||
async ngOnInit(): Promise<void> {
|
||||
this.clientKey = Utils.fromBufferToB64((await this.cryptoService.getKey()).key);
|
||||
this.clientLocalKeyHash = await this.cryptoService.getKeyHash();
|
||||
}
|
||||
|
||||
async submit() {
|
||||
try {
|
||||
this.formPromise = this.userVerificationService
|
||||
@@ -43,4 +53,17 @@ export class ApiKeyComponent {
|
||||
this.logService.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
get combinedApiKey() {
|
||||
return Utils.fromUtf8ToB64(
|
||||
JSON.stringify({
|
||||
clientId: this.clientId,
|
||||
clientSecret: this.clientSecret,
|
||||
encClientEncInfo: JSON.stringify({
|
||||
clientEncKey: this.clientKey,
|
||||
clientLocalKeyHash: this.clientLocalKeyHash,
|
||||
}),
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ import { Component } from "@angular/core";
|
||||
import { ApiService } from "jslib-common/abstractions/api.service";
|
||||
import { LogService } from "jslib-common/abstractions/log.service";
|
||||
import { OrganizationConnectionType } from "jslib-common/enums/organizationConnectionType";
|
||||
import { Utils } from "jslib-common/misc/utils";
|
||||
import { BillingSyncConfigApi } from "jslib-common/models/api/billingSyncConfigApi";
|
||||
import { BillingSyncConfigRequest } from "jslib-common/models/request/billingSyncConfigRequest";
|
||||
import { OrganizationConnectionRequest } from "jslib-common/models/request/organizationConnectionRequest";
|
||||
|
||||
Reference in New Issue
Block a user