Skip to content

Commit

Permalink
chore(admin): add audit log rpc
Browse files Browse the repository at this point in the history
  • Loading branch information
SnhrK committed Dec 8, 2023
1 parent 0f915df commit 5068ad8
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
22 changes: 22 additions & 0 deletions admin/v1/admin.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package blueapi.admin.v1;

import "api/accountgroup.proto";
import "api/notification.proto";
import "api/audit.proto";
import "protos/operation.proto";
import "google/api/annotations.proto";
import "google/protobuf/empty.proto";
Expand Down Expand Up @@ -200,6 +201,14 @@ service Admin {
};
}

// WORK-IN-PROGRESS: Exports audit logs for login user's organization.
rpc ExportAuditLogs(ExportAuditLogsRequest) returns (api.AuditExport) {
option (google.api.http) = {
post: "/admin/v1/auditlogs:export"
body: "*"
};
}

}

// Request message for the Admin.ListAccountGroups rpc.
Expand Down Expand Up @@ -557,4 +566,17 @@ message ProformaCur {

string timeCreated = 7;

}


// Request message for the ExportAuditLogs rpc.
message ExportAuditLogsRequest {
// Required. At the moment, `CSV`,`JSON` is supported.
string format = 1;

// Required. The UTC date to start data from. If not set, the first day of the current year will be used. Format: `yyyymmdd`.
string startTime = 2;

// Required. The UTC date to end data from. If not set, the first day of the current year will be used. Format: `yyyymmdd`.
string endTime = 3;
}
22 changes: 22 additions & 0 deletions api/audit.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
syntax = "proto3";

package blueapi.api;

option go_package = "github.com/alphauslabs/blue-sdk-go/api";
option java_package = "cloud.alphaus.blueapi.api";
option java_outer_classname = "ApiAuditProto";

// AuditExport resource definition.
message AuditExport {
AuditExportData data = 1;
}

// AuditExportData resource definition.
message AuditExportData {
// Encoded value
string content = 1;
// Downloaded content lines.
int64 downloadedRows = 2;
// Total of content lines.
int64 totalRows = 3;
}

0 comments on commit 5068ad8

Please sign in to comment.