Skip to content

Commit 499e177

Browse files
authored
Add audit log query API (#101)
* Add audit log query API * descope account * add openapi tag * fix comment * bump version * fix description
1 parent 8459253 commit 499e177

File tree

3 files changed

+37
-1
lines changed

3 files changed

+37
-1
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v0.10.0
1+
v0.10.1

temporal/api/cloud/cloudservice/v1/request_response.proto

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import "temporal/api/cloud/region/v1/message.proto";
1919
import "temporal/api/cloud/account/v1/message.proto";
2020
import "temporal/api/cloud/usage/v1/message.proto";
2121
import "temporal/api/cloud/connectivityrule/v1/message.proto";
22+
import "temporal/api/cloud/auditlog/v1/message.proto";
2223

2324
message GetUsersRequest {
2425
// The requested size of the page to retrieve - optional.
@@ -949,6 +950,25 @@ message DeleteConnectivityRuleResponse {
949950
temporal.api.cloud.operation.v1.AsyncOperation async_operation = 1;
950951
}
951952

953+
message GetAuditLogsRequest {
954+
// The requested size of the page to retrieve - optional.
955+
// Cannot exceed 1000. Defaults to 100.
956+
int32 page_size = 1;
957+
// The page token if this is continuing from another response - optional.
958+
string page_token = 2;
959+
// Filter for UTC time >= (defaults to 30 days ago) - optional.
960+
google.protobuf.Timestamp start_time_inclusive = 3;
961+
// Filter for UTC time < (defaults to current time) - optional.
962+
google.protobuf.Timestamp end_time_exclusive = 4;
963+
}
964+
965+
message GetAuditLogsResponse {
966+
// The list of audit logs ordered by emit time, log_id
967+
repeated temporal.api.cloud.auditlog.v1.LogRecord logs = 1;
968+
// The next page's token.
969+
string next_page_token = 2;
970+
}
971+
952972
message ValidateAccountAuditLogSinkRequest {
953973
// The audit log sink spec that will be validated
954974
temporal.api.cloud.account.v1.AuditLogSinkSpec spec = 1;

temporal/api/cloud/cloudservice/v1/service.proto

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -976,6 +976,22 @@ service CloudService {
976976
};
977977
}
978978

979+
// Get audit logs
980+
rpc GetAuditLogs(GetAuditLogsRequest) returns (GetAuditLogsResponse) {
981+
option (google.api.http) = {
982+
get: "/cloud/audit-logs",
983+
};
984+
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
985+
tags: ["Account"];
986+
summary: "Get audit logs"
987+
description: "Returns a paginated list of audit logs for the account, optionally filtered by time range"
988+
external_docs: {
989+
url: "https://docs.temporal.io/cloud/audit-logging";
990+
description: "Audit logging documentation";
991+
};
992+
};
993+
}
994+
979995
// Validate customer audit log sink is accessible from Temporal's workflow by delivering an empty file to the specified sink.
980996
// The operation verifies that the sink is correctly configured, accessible and ready to receive audit logs.
981997
rpc ValidateAccountAuditLogSink(ValidateAccountAuditLogSinkRequest) returns (ValidateAccountAuditLogSinkResponse) {

0 commit comments

Comments
 (0)