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:
@@ -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",
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user