1
0
mirror of https://github.com/bitwarden/browser synced 2026-01-09 03:53:53 +00:00

[PM 2164] api-key component migration (#8562)

* api-key component migration

* api-key component migration

* api-key component migration

* api-key component migration
This commit is contained in:
vinith-kovan
2024-06-05 22:44:33 +05:30
committed by GitHub
parent 24fb3f71f1
commit 1cec69e377
4 changed files with 126 additions and 138 deletions

View File

@@ -216,31 +216,33 @@ export class AccountComponent {
};
async viewApiKey() {
await this.modalService.openViewRef(ApiKeyComponent, this.apiKeyModalRef, (comp) => {
comp.keyType = "organization";
comp.entityId = this.organizationId;
comp.postKey = this.organizationApiService.getOrCreateApiKey.bind(
this.organizationApiService,
);
comp.scope = "api.organization";
comp.grantType = "client_credentials";
comp.apiKeyTitle = "apiKey";
comp.apiKeyWarning = "apiKeyWarning";
comp.apiKeyDescription = "apiKeyDesc";
await ApiKeyComponent.open(this.dialogService, {
data: {
keyType: "organization",
entityId: this.organizationId,
postKey: this.organizationApiService.getOrCreateApiKey.bind(this.organizationApiService),
scope: "api.organization",
grantType: "client_credentials",
apiKeyTitle: "apiKey",
apiKeyWarning: "apiKeyWarning",
apiKeyDescription: "apiKeyDesc",
},
});
}
async rotateApiKey() {
await this.modalService.openViewRef(ApiKeyComponent, this.rotateApiKeyModalRef, (comp) => {
comp.keyType = "organization";
comp.isRotation = true;
comp.entityId = this.organizationId;
comp.postKey = this.organizationApiService.rotateApiKey.bind(this.organizationApiService);
comp.scope = "api.organization";
comp.grantType = "client_credentials";
comp.apiKeyTitle = "apiKey";
comp.apiKeyWarning = "apiKeyWarning";
comp.apiKeyDescription = "apiKeyRotateDesc";
await ApiKeyComponent.open(this.dialogService, {
data: {
keyType: "organization",
isRotation: true,
entityId: this.organizationId,
postKey: this.organizationApiService.rotateApiKey.bind(this.organizationApiService),
scope: "api.organization",
grantType: "client_credentials",
apiKeyTitle: "apiKey",
apiKeyWarning: "apiKeyWarning",
apiKeyDescription: "apiKeyRotateDesc",
},
});
}
}