mirror of
https://github.com/bitwarden/browser
synced 2025-12-06 00:13:28 +00:00
[SM-1274] Add Project Events to the Log List in Admin Console (#15442)
* Adding enums for additional event logs for secrets * updating messages * Updating messages to be consistent for logs * Displaying project logs, and fixing search query param searching in projects list, having deleted log for secrets and projects not show as a link * Viewing secret and project event logs in event modal, adding to the context menu for secrets and projects the ability to view the logs if user has permission. Restricting logs to SM projs and Secs if the logged in user has event log access but not SM access. * lint * Lint Fixes * fix to messages file * fixing lint * Bug fix, make sure event logs related to service accounts are still links that take you to the object * removing unused import
This commit is contained in:
@@ -388,19 +388,23 @@ export abstract class ApiService {
|
||||
id: string,
|
||||
request: ProviderUserAcceptRequest,
|
||||
): Promise<any>;
|
||||
|
||||
abstract postProviderUserConfirm(
|
||||
providerId: string,
|
||||
id: string,
|
||||
request: ProviderUserConfirmRequest,
|
||||
): Promise<any>;
|
||||
|
||||
abstract postProviderUsersPublicKey(
|
||||
providerId: string,
|
||||
request: ProviderUserBulkRequest,
|
||||
): Promise<ListResponse<ProviderUserBulkPublicKeyResponse>>;
|
||||
|
||||
abstract postProviderUserBulkConfirm(
|
||||
providerId: string,
|
||||
request: ProviderUserBulkConfirmRequest,
|
||||
): Promise<ListResponse<ProviderUserBulkResponse>>;
|
||||
|
||||
abstract putProviderUser(
|
||||
providerId: string,
|
||||
id: string,
|
||||
@@ -435,6 +439,21 @@ export abstract class ApiService {
|
||||
end: string,
|
||||
token: string,
|
||||
): Promise<ListResponse<EventResponse>>;
|
||||
|
||||
abstract getEventsSecret(
|
||||
orgId: string,
|
||||
id: string,
|
||||
start: string,
|
||||
end: string,
|
||||
token: string,
|
||||
): Promise<ListResponse<EventResponse>>;
|
||||
abstract getEventsProject(
|
||||
orgId: string,
|
||||
id: string,
|
||||
start: string,
|
||||
end: string,
|
||||
token: string,
|
||||
): Promise<ListResponse<EventResponse>>;
|
||||
abstract getEventsOrganization(
|
||||
id: string,
|
||||
start: string,
|
||||
|
||||
@@ -93,4 +93,11 @@ export enum EventType {
|
||||
Secret_Created = 2101,
|
||||
Secret_Edited = 2102,
|
||||
Secret_Deleted = 2103,
|
||||
Secret_Permanently_Deleted = 2104,
|
||||
Secret_Restored = 2105,
|
||||
|
||||
Project_Retrieved = 2200,
|
||||
Project_Created = 2201,
|
||||
Project_Edited = 2202,
|
||||
Project_Deleted = 2203,
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ export class EventResponse extends BaseResponse {
|
||||
systemUser: EventSystemUser;
|
||||
domainName: string;
|
||||
secretId: string;
|
||||
projectId: string;
|
||||
serviceAccountId: string;
|
||||
|
||||
constructor(response: any) {
|
||||
@@ -45,6 +46,7 @@ export class EventResponse extends BaseResponse {
|
||||
this.systemUser = this.getResponseProperty("SystemUser");
|
||||
this.domainName = this.getResponseProperty("DomainName");
|
||||
this.secretId = this.getResponseProperty("SecretId");
|
||||
this.projectId = this.getResponseProperty("ProjectId");
|
||||
this.serviceAccountId = this.getResponseProperty("ServiceAccountId");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1267,6 +1267,50 @@ export class ApiService implements ApiServiceAbstraction {
|
||||
return new ListResponse(r, EventResponse);
|
||||
}
|
||||
|
||||
async getEventsSecret(
|
||||
orgId: string,
|
||||
id: string,
|
||||
start: string,
|
||||
end: string,
|
||||
token: string,
|
||||
): Promise<ListResponse<EventResponse>> {
|
||||
const r = await this.send(
|
||||
"GET",
|
||||
this.addEventParameters(
|
||||
"/organization/" + orgId + "/secrets/" + id + "/events",
|
||||
start,
|
||||
end,
|
||||
token,
|
||||
),
|
||||
null,
|
||||
true,
|
||||
true,
|
||||
);
|
||||
return new ListResponse(r, EventResponse);
|
||||
}
|
||||
|
||||
async getEventsProject(
|
||||
orgId: string,
|
||||
id: string,
|
||||
start: string,
|
||||
end: string,
|
||||
token: string,
|
||||
): Promise<ListResponse<EventResponse>> {
|
||||
const r = await this.send(
|
||||
"GET",
|
||||
this.addEventParameters(
|
||||
"/organization/" + orgId + "/projects/" + id + "/events",
|
||||
start,
|
||||
end,
|
||||
token,
|
||||
),
|
||||
null,
|
||||
true,
|
||||
true,
|
||||
);
|
||||
return new ListResponse(r, EventResponse);
|
||||
}
|
||||
|
||||
async getEventsOrganization(
|
||||
id: string,
|
||||
start: string,
|
||||
|
||||
Reference in New Issue
Block a user