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

Compare commits

..

2 Commits

Author SHA1 Message Date
Matt Gibson
1258989f8a POC
TODO:
* encrypt key information with symm key
* store symm key with server next to api key
* Add toggle for enc access yes/no
* build out storing multiple API keys
* Add quick copy button to api key field
* See about a more user-friendly api key encoding
2022-05-20 12:41:50 -04:00
Gbubemi Smith
58d9ac5ebc [ps-136] Igonre accented characters in vault search (#1690)
* removed accented character from serach input field

* updated jslib
2022-05-20 15:22:44 +01:00
4 changed files with 30 additions and 4 deletions

View File

@@ -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() {

View File

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

View File

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

View File

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