Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

feat(api): request metadata for audit logs (#13106)

Azusain39d02b24fad7
diff --git a/frontend/src/types/proto/store/audit_log.ts b/frontend/src/types/proto/store/audit_log.ts
index 474ff7c204..d7b58cb184 100644
--- a/frontend/src/types/proto/store/audit_log.ts
+++ b/frontend/src/types/proto/store/audit_log.ts
@@ -35,7 +35,11 @@ export interface AuditLog {
| Status
| undefined;
/** service-specific data about the request, response, and other activities. */
- serviceData: Any | undefined;
+ serviceData:
+ | Any
+ | undefined;
+ /** Metadata about the operation. */
+ requestMetadata: RequestMetadata | undefined;
}
export enum AuditLog_Severity {
@@ -139,6 +143,17 @@ export function auditLog_SeverityToNumber(object: AuditLog_Severity): number {
}
}
+/** Metadata about the request. */
+export interface RequestMetadata {
+ /** The IP address of the caller. */
+ callerIp: string;
+ /**
+ * The user agent of the caller.
+ * This information is not authenticated and should be treated accordingly.
+ */
+ callerSuppliedUserAgent: string;
+}
+
function createBaseAuditLog(): AuditLog {
return {
parent: "",
@@ -150,6 +165,7 @@ function createBaseAuditLog(): AuditLog {
response: "",
status: undefined,
serviceData: undefined,
+ requestMetadata: undefined,
};
}
@@ -182,6 +198,9 @@ export const AuditLog = {
if (message.serviceData !== undefined) {
Any.encode(message.serviceData, writer.uint32(82).fork()).ldelim();
}
+ if (message.requestMetadata !== undefined) {
+ RequestMetadata.encode(message.requestMetadata, writer.uint32(90).fork()).ldelim();
+ }
return writer;
},
@@ -255,6 +274,13 @@ export const AuditLog = {
message.serviceData = Any.decode(reader, reader.uint32());
continue;
+ case 11:
+ if (tag !== 90) {
+ break;
+ }
+
+ message.requestMetadata = RequestMetadata.decode(reader, reader.uint32());
+ continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
@@ -275,6 +301,7 @@ export const AuditLog = {
response: isSet(object.response) ? globalThis.String(object.response) : "",
status: isSet(object.status) ? Status.fromJSON(object.status) : undefined,
serviceData: isSet(object.serviceData) ? Any.fromJSON(object.serviceData) : undefined,
+ requestMetadata: isSet(object.requestMetadata) ? RequestMetadata.fromJSON(object.requestMetadata) : undefined,
};
},
@@ -307,6 +334,9 @@ export const AuditLog = {
if (message.serviceData !== undefined) {
obj.serviceData = Any.toJSON(message.serviceData);
}
+ if (message.requestMetadata !== undefined) {
+ obj.requestMetadata = RequestMetadata.toJSON(message.requestMetadata);
+ }
return obj;
},
@@ -328,6 +358,85 @@ export const AuditLog = {
message.serviceData = (object.serviceData !== undefined && object.serviceData !== null)
? Any.fromPartial(object.serviceData)
: undefined;
+ message.requestMetadata = (object.requestMetadata !== undefined && object.requestMetadata !== null)
+ ? RequestMetadata.fromPartial(object.requestMetadata)
+ : undefined;
+ return message;
+ },
+};
+
+function createBaseRequestMetadata(): RequestMetadata {
+ return { callerIp: "", callerSuppliedUserAgent: "" };
+}
+
+export const RequestMetadata = {
+ encode(message: RequestMetadata, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.callerIp !== "") {
+ writer.uint32(10).string(message.callerIp);
+ }
+ if (message.callerSuppliedUserAgent !== "") {
+ writer.uint32(18).string(message.callerSuppliedUserAgent);
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): RequestMetadata {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseRequestMetadata();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.callerIp = reader.string();
+ continue;
+ case 2:
+ if (tag !== 18) {
+ break;
+ }
+
+ message.callerSuppliedUserAgent = reader.string();
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(object: any): RequestMetadata {
+ return {
+ callerIp: isSet(object.callerIp) ? globalThis.String(object.callerIp) : "",
+ callerSuppliedUserAgent: isSet(object.callerSuppliedUserAgent)
+ ? globalThis.String(object.callerSuppliedUserAgent)
+ : "",
+ };
+ },
+
+ toJSON(message: RequestMetadata): unknown {
+ const obj: any = {};
+ if (message.callerIp !== "") {
+ obj.callerIp = message.callerIp;
+ }
+ if (message.callerSuppliedUserAgent !== "") {
+ obj.callerSuppliedUserAgent = message.callerSuppliedUserAgent;
+ }
+ return obj;
+ },
+
+ create(base?: DeepPartial<RequestMetadata>): RequestMetadata {
+ return RequestMetadata.fromPartial(base ?? {});
+ },
+ fromPartial(object: DeepPartial<RequestMetadata>): RequestMetadata {
+ const message = createBaseRequestMetadata();
+ message.callerIp = object.callerIp ?? "";
+ message.callerSuppliedUserAgent = object.callerSuppliedUserAgent ?? "";
return message;
},
};
diff --git a/frontend/src/types/proto/v1/audit_log_service.ts b/frontend/src/types/proto/v1/audit_log_service.ts
index e2187860d9..ad04ee249c 100644
--- a/frontend/src/types/proto/v1/audit_log_service.ts
+++ b/frontend/src/types/proto/v1/audit_log_service.ts
@@ -108,7 +108,11 @@ export interface AuditLog {
| Status
| undefined;
/** service-specific data about the request, response, and other activities. */
- serviceData: Any | undefined;
+ serviceData:
+ | Any
+ | undefined;
+ /** Metadata about the operation. */
+ requestMetadata: RequestMetadata | undefined;
}
export enum AuditLog_Severity {
@@ -216,6 +220,17 @@ export interface AuditData {
policyDelta: PolicyDelta | undefined;
}
+/** Metadata about the request. */
+export interface RequestMetadata {
+ /** The IP address of the caller. */
+ callerIp: string;
+ /**
+ * The user agent of the caller.
+ * This information is not authenticated and should be treated accordingly.
+ */
+ callerSuppliedUserAgent: string;
+}
+
function createBaseSearchAuditLogsRequest(): SearchAuditLogsRequest {
return { parent: "", filter: "", orderBy: "", pageSize: 0, pageToken: "" };
}
@@ -584,6 +599,7 @@ function createBaseAuditLog(): AuditLog {
response: "",
status: undefined,
serviceData: undefined,
+ requestMetadata: undefined,
};
}
@@ -619,6 +635,9 @@ export const AuditLog = {
if (message.serviceData !== undefined) {
Any.encode(message.serviceData, writer.uint32(82).fork()).ldelim();
}
+ if (message.requestMetadata !== undefined) {
+ RequestMetadata.encode(message.requestMetadata, writer.uint32(90).fork()).ldelim();
+ }
return writer;
},
@@ -699,6 +718,13 @@ export const AuditLog = {
message.serviceData = Any.decode(reader, reader.uint32());
continue;
+ case 11:
+ if (tag !== 90) {
+ break;
+ }
+
+ message.requestMetadata = RequestMetadata.decode(reader, reader.uint32());
+ continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
@@ -720,6 +746,7 @@ export const AuditLog = {
response: isSet(object.response) ? globalThis.String(object.response) : "",
status: isSet(object.status) ? Status.fromJSON(object.status) : undefined,
serviceData: isSet(object.serviceData) ? Any.fromJSON(object.serviceData) : undefined,
+ requestMetadata: isSet(object.requestMetadata) ? RequestMetadata.fromJSON(object.requestMetadata) : undefined,
};
},
@@ -755,6 +782,9 @@ export const AuditLog = {
if (message.serviceData !== undefined) {
obj.serviceData = Any.toJSON(message.serviceData);
}
+ if (message.requestMetadata !== undefined) {
+ obj.requestMetadata = RequestMetadata.toJSON(message.requestMetadata);
+ }
return obj;
},
@@ -777,6 +807,9 @@ export const AuditLog = {
message.serviceData = (object.serviceData !== undefined && object.serviceData !== null)
? Any.fromPartial(object.serviceData)
: undefined;
+ message.requestMetadata = (object.requestMetadata !== undefined && object.requestMetadata !== null)
+ ? RequestMetadata.fromPartial(object.requestMetadata)
+ : undefined;
return message;
},
};
@@ -840,6 +873,82 @@ export const AuditData = {
},
};
+function createBaseRequestMetadata(): RequestMetadata {
+ return { callerIp: "", callerSuppliedUserAgent: "" };
+}
+
+export const RequestMetadata = {
+ encode(message: RequestMetadata, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.callerIp !== "") {
+ writer.uint32(10).string(message.callerIp);
+ }
+ if (message.callerSuppliedUserAgent !== "") {
+ writer.uint32(18).string(message.callerSuppliedUserAgent);
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): RequestMetadata {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseRequestMetadata();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.callerIp = reader.string();
+ continue;
+ case 2:
+ if (tag !== 18) {
+ break;
+ }
+
+ message.callerSuppliedUserAgent = reader.string();
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(object: any): RequestMetadata {
+ return {
+ callerIp: isSet(object.callerIp) ? globalThis.String(object.callerIp) : "",
+ callerSuppliedUserAgent: isSet(object.callerSuppliedUserAgent)
+ ? globalThis.String(object.callerSuppliedUserAgent)
+ : "",
+ };
+ },
+
+ toJSON(message: RequestMetadata): unknown {
+ const obj: any = {};
+ if (message.callerIp !== "") {
+ obj.callerIp = message.callerIp;
+ }
+ if (message.callerSuppliedUserAgent !== "") {
+ obj.callerSuppliedUserAgent = message.callerSuppliedUserAgent;
+ }
+ return obj;
+ },
+
+ create(base?: DeepPartial<RequestMetadata>): RequestMetadata {
+ return RequestMetadata.fromPartial(base ?? {});
+ },
+ fromPartial(object: DeepPartial<RequestMetadata>): RequestMetadata {
+ const message = createBaseRequestMetadata();
+ message.callerIp = object.callerIp ?? "";
+ message.callerSuppliedUserAgent = object.callerSuppliedUserAgent ?? "";
+ return message;
+ },
+};
+
export type AuditLogServiceDefinition = typeof AuditLogServiceDefinition;
export const AuditLogServiceDefinition = {
name: "AuditLogService",
diff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yaml
index d6b0e0f1cd..7c02f8d2aa 100644
--- a/proto/gen/grpc-doc/openapi.yaml
+++ b/proto/gen/grpc-doc/openapi.yaml
@@ -8736,6 +8736,10 @@ components:
allOf:
- $ref: '#/components/schemas/GoogleProtobufAny'
description: service-specific data about the request, response, and other activities.
+ requestMetadata:
+ allOf:
+ - $ref: '#/components/schemas/RequestMetadata'
+ description: Metadata about the operation.
BatchCancelPlanCheckRunsRequest:
required:
- parent
@@ -12295,6 +12299,18 @@ components:
Format: projects/{project}/issues/{issue}
comment:
type: string
+ RequestMetadata:
+ type: object
+ properties:
+ callerIp:
+ type: string
+ description: The IP address of the caller.
+ callerSuppliedUserAgent:
+ type: string
+ description: |-
+ The user agent of the caller.
+ This information is not authenticated and should be treated accordingly.
+ description: Metadata about the request.
ResourcePackage:
type: object
properties:
diff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.md
index f16bc5eea4..1317b75882 100644
--- a/proto/gen/grpc-doc/store/README.md
+++ b/proto/gen/grpc-doc/store/README.md
@@ -38,6 +38,7 @@
- [store/audit_log.proto](#store_audit_log-proto)
- [AuditLog](#bytebase-store-AuditLog)
+ - [RequestMetadata](#bytebase-store-RequestMetadata)
- [AuditLog.Severity](#bytebase-store-AuditLog-Severity)
@@ -776,6 +777,23 @@ ANY means approving any node will proceed.
| response | [string](#string) | | Marshalled response. Some fields are omitted because they are too large or contain sensitive information. |
| status | [google.rpc.Status](#google-rpc-Status) | | |
| service_data | [google.protobuf.Any](#google-protobuf-Any) | | service-specific data about the request, response, and other activities. |
+| request_metadata | [RequestMetadata](#bytebase-store-RequestMetadata) | | Metadata about the operation. |
+
+
+
+
+
+
+<a name="bytebase-store-RequestMetadata"></a>
+
+### RequestMetadata
+Metadata about the request.
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| caller_ip | [string](#string) | | The IP address of the caller. |
+| caller_supplied_user_agent | [string](#string) | | The user agent of the caller. This information is not authenticated and should be treated accordingly. |
diff --git a/proto/gen/grpc-doc/store/index.html b/proto/gen/grpc-doc/store/index.html
index 4d5fe4750d..796fd4daf3 100644
--- a/proto/gen/grpc-doc/store/index.html
+++ b/proto/gen/grpc-doc/store/index.html
@@ -314,6 +314,10 @@
<a href="#bytebase.store.AuditLog"><span class="badge">M</span>AuditLog</a>
</li>
+ <li>
+ <a href="#bytebase.store.RequestMetadata"><span class="badge">M</span>RequestMetadata</a>
+ </li>
+
<li>
<a href="#bytebase.store.AuditLog.Severity"><span class="badge">E</span>AuditLog.Severity</a>
@@ -2512,6 +2516,45 @@ Some fields are omitted because they are too large or contain sensitive informat
<td><p>service-specific data about the request, response, and other activities. </p></td>
</tr>
+ <tr>
+ <td>request_metadata</td>
+ <td><a href="#bytebase.store.RequestMetadata">RequestMetadata</a></td>
+ <td></td>
+ <td><p>Metadata about the operation. </p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+
+
+
+
+ <h3 id="bytebase.store.RequestMetadata">RequestMetadata</h3>
+ <p>Metadata about the request.</p>
+
+
+ <table class="field-table">
+ <thead>
+ <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
+ </thead>
+ <tbody>
+
+ <tr>
+ <td>caller_ip</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>The IP address of the caller. </p></td>
+ </tr>
+
+ <tr>
+ <td>caller_supplied_user_agent</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>The user agent of the caller.
+This information is not authenticated and should be treated accordingly. </p></td>
+ </tr>
+
</tbody>
</table>
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index 1895a1f98f..78140356d9 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -58,6 +58,7 @@
- [AuditLog](#bytebase-v1-AuditLog)
- [ExportAuditLogsRequest](#bytebase-v1-ExportAuditLogsRequest)
- [ExportAuditLogsResponse](#bytebase-v1-ExportAuditLogsResponse)
+ - [RequestMetadata](#bytebase-v1-RequestMetadata)
- [SearchAuditLogsRequest](#bytebase-v1-SearchAuditLogsRequest)
- [SearchAuditLogsResponse](#bytebase-v1-SearchAuditLogsResponse)
@@ -1340,6 +1341,7 @@ The type of action performed on a Binding in a policy.
| response | [string](#string) | | JSON-encoded response. Some fields are omitted because they are too large or contain sensitive information. |
| status | [google.rpc.Status](#google-rpc-Status) | | |
| service_data | [google.protobuf.Any](#google-protobuf-Any) | | service-specific data about the request, response, and other activities. |
+| request_metadata | [RequestMetadata](#bytebase-v1-RequestMetadata) | | Metadata about the operation. |
@@ -1379,6 +1381,22 @@ The type of action performed on a Binding in a policy.
+<a name="bytebase-v1-RequestMetadata"></a>
+
+### RequestMetadata
+Metadata about the request.
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| caller_ip | [string](#string) | | The IP address of the caller. |
+| caller_supplied_user_agent | [string](#string) | | The user agent of the caller. This information is not authenticated and should be treated accordingly. |
+
+
+
+
+
+
<a name="bytebase-v1-SearchAuditLogsRequest"></a>
### SearchAuditLogsRequest
diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.html
index 2c55bbc130..1a3ddbc4d5 100644
--- a/proto/gen/grpc-doc/v1/index.html
+++ b/proto/gen/grpc-doc/v1/index.html
@@ -385,6 +385,10 @@
<a href="#bytebase.v1.ExportAuditLogsResponse"><span class="badge">M</span>ExportAuditLogsResponse</a>
</li>
+ <li>
+ <a href="#bytebase.v1.RequestMetadata"><span class="badge">M</span>RequestMetadata</a>
+ </li>
+
<li>
<a href="#bytebase.v1.SearchAuditLogsRequest"><span class="badge">M</span>SearchAuditLogsRequest</a>
</li>
@@ -4440,6 +4444,13 @@ Some fields are omitted because they are too large or contain sensitive informat
<td><p>service-specific data about the request, response, and other activities. </p></td>
</tr>
+ <tr>
+ <td>request_metadata</td>
+ <td><a href="#bytebase.v1.RequestMetadata">RequestMetadata</a></td>
+ <td></td>
+ <td><p>Metadata about the operation. </p></td>
+ </tr>
+
</tbody>
</table>
@@ -4525,6 +4536,38 @@ For example:
+ <h3 id="bytebase.v1.RequestMetadata">RequestMetadata</h3>
+ <p>Metadata about the request.</p>
+
+
+ <table class="field-table">
+ <thead>
+ <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
+ </thead>
+ <tbody>
+
+ <tr>
+ <td>caller_ip</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>The IP address of the caller. </p></td>
+ </tr>
+
+ <tr>
+ <td>caller_supplied_user_agent</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>The user agent of the caller.
+This information is not authenticated and should be treated accordingly. </p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+
+
+
+
<h3 id="bytebase.v1.SearchAuditLogsRequest">SearchAuditLogsRequest</h3>
<p></p>
diff --git a/proto/generated-go/store/audit_log.pb.go b/proto/generated-go/store/audit_log.pb.go
index 170ebe7a7f..1de1f1372b 100644
--- a/proto/generated-go/store/audit_log.pb.go
+++ b/proto/generated-go/store/audit_log.pb.go
@@ -115,6 +115,8 @@ type AuditLog struct {
Status *status.Status `protobuf:"bytes,8,opt,name=status,proto3" json:"status,omitempty"`
// service-specific data about the request, response, and other activities.
ServiceData *anypb.Any `protobuf:"bytes,10,opt,name=service_data,json=serviceData,proto3" json:"service_data,omitempty"`
+ // Metadata about the operation.
+ RequestMetadata *RequestMetadata `protobuf:"bytes,11,opt,name=request_metadata,json=requestMetadata,proto3" json:"request_metadata,omitempty"`
}
func (x *AuditLog) Reset() {
@@ -212,6 +214,72 @@ func (x *AuditLog) GetServiceData() *anypb.Any {
return nil
}
+func (x *AuditLog) GetRequestMetadata() *RequestMetadata {
+ if x != nil {
+ return x.RequestMetadata
+ }
+ return nil
+}
+
+// Metadata about the request.
+type RequestMetadata struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // The IP address of the caller.
+ CallerIp string `protobuf:"bytes,1,opt,name=caller_ip,json=callerIp,proto3" json:"caller_ip,omitempty"`
+ // The user agent of the caller.
+ // This information is not authenticated and should be treated accordingly.
+ CallerSuppliedUserAgent string `protobuf:"bytes,2,opt,name=caller_supplied_user_agent,json=callerSuppliedUserAgent,proto3" json:"caller_supplied_user_agent,omitempty"`
+}
+
+func (x *RequestMetadata) Reset() {
+ *x = RequestMetadata{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_store_audit_log_proto_msgTypes[1]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *RequestMetadata) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*RequestMetadata) ProtoMessage() {}
+
+func (x *RequestMetadata) ProtoReflect() protoreflect.Message {
+ mi := &file_store_audit_log_proto_msgTypes[1]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use RequestMetadata.ProtoReflect.Descriptor instead.
+func (*RequestMetadata) Descriptor() ([]byte, []int) {
+ return file_store_audit_log_proto_rawDescGZIP(), []int{1}
+}
+
+func (x *RequestMetadata) GetCallerIp() string {
+ if x != nil {
+ return x.CallerIp
+ }
+ return ""
+}
+
+func (x *RequestMetadata) GetCallerSuppliedUserAgent() string {
+ if x != nil {
+ return x.CallerSuppliedUserAgent
+ }
+ return ""
+}
+
var File_store_audit_log_proto protoreflect.FileDescriptor
var file_store_audit_log_proto_rawDesc = []byte{
@@ -220,7 +288,7 @@ var file_store_audit_log_proto_rawDesc = []byte{
0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x1a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x73,
- 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbe, 0x03, 0x0a, 0x08,
+ 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8a, 0x04, 0x0a, 0x08,
0x41, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65,
0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74,
0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
@@ -241,16 +309,28 @@ var file_store_audit_log_proto_rawDesc = []byte{
0x76, 0x69, 0x63, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x44, 0x61,
- 0x74, 0x61, 0x22, 0x78, 0x0a, 0x08, 0x53, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, 0x12, 0x0b,
- 0x0a, 0x07, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x44,
- 0x45, 0x42, 0x55, 0x47, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0x02,
- 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x4f, 0x54, 0x49, 0x43, 0x45, 0x10, 0x03, 0x12, 0x0b, 0x0a, 0x07,
- 0x57, 0x41, 0x52, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x04, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x52, 0x52,
- 0x4f, 0x52, 0x10, 0x05, 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x52, 0x49, 0x54, 0x49, 0x43, 0x41, 0x4c,
- 0x10, 0x06, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x4c, 0x45, 0x52, 0x54, 0x10, 0x07, 0x12, 0x0d, 0x0a,
- 0x09, 0x45, 0x4d, 0x45, 0x52, 0x47, 0x45, 0x4e, 0x43, 0x59, 0x10, 0x08, 0x42, 0x14, 0x5a, 0x12,
- 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x73, 0x74, 0x6f,
- 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+ 0x74, 0x61, 0x12, 0x4a, 0x0a, 0x10, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x6d, 0x65,
+ 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x62,
+ 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x52, 0x65,
+ 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x0f, 0x72,
+ 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x78,
+ 0x0a, 0x08, 0x53, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45,
+ 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x44, 0x45, 0x42, 0x55, 0x47,
+ 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06,
+ 0x4e, 0x4f, 0x54, 0x49, 0x43, 0x45, 0x10, 0x03, 0x12, 0x0b, 0x0a, 0x07, 0x57, 0x41, 0x52, 0x4e,
+ 0x49, 0x4e, 0x47, 0x10, 0x04, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x05,
+ 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x52, 0x49, 0x54, 0x49, 0x43, 0x41, 0x4c, 0x10, 0x06, 0x12, 0x09,
+ 0x0a, 0x05, 0x41, 0x4c, 0x45, 0x52, 0x54, 0x10, 0x07, 0x12, 0x0d, 0x0a, 0x09, 0x45, 0x4d, 0x45,
+ 0x52, 0x47, 0x45, 0x4e, 0x43, 0x59, 0x10, 0x08, 0x22, 0x6b, 0x0a, 0x0f, 0x52, 0x65, 0x71, 0x75,
+ 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1b, 0x0a, 0x09, 0x63,
+ 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08,
+ 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x70, 0x12, 0x3b, 0x0a, 0x1a, 0x63, 0x61, 0x6c, 0x6c,
+ 0x65, 0x72, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x64, 0x5f, 0x75, 0x73, 0x65, 0x72,
+ 0x5f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x17, 0x63, 0x61,
+ 0x6c, 0x6c, 0x65, 0x72, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72,
+ 0x41, 0x67, 0x65, 0x6e, 0x74, 0x42, 0x14, 0x5a, 0x12, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,
+ 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f,
+ 0x74, 0x6f, 0x33,
}
var (
@@ -266,22 +346,24 @@ func file_store_audit_log_proto_rawDescGZIP() []byte {
}
var file_store_audit_log_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
-var file_store_audit_log_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
+var file_store_audit_log_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_store_audit_log_proto_goTypes = []any{
- (AuditLog_Severity)(0), // 0: bytebase.store.AuditLog.Severity
- (*AuditLog)(nil), // 1: bytebase.store.AuditLog
- (*status.Status)(nil), // 2: google.rpc.Status
- (*anypb.Any)(nil), // 3: google.protobuf.Any
+ (AuditLog_Severity)(0), // 0: bytebase.store.AuditLog.Severity
+ (*AuditLog)(nil), // 1: bytebase.store.AuditLog
+ (*RequestMetadata)(nil), // 2: bytebase.store.RequestMetadata
+ (*status.Status)(nil), // 3: google.rpc.Status
+ (*anypb.Any)(nil), // 4: google.protobuf.Any
}
var file_store_audit_log_proto_depIdxs = []int32{
0, // 0: bytebase.store.AuditLog.severity:type_name -> bytebase.store.AuditLog.Severity
- 2, // 1: bytebase.store.AuditLog.status:type_name -> google.rpc.Status
- 3, // 2: bytebase.store.AuditLog.service_data:type_name -> google.protobuf.Any
- 3, // [3:3] is the sub-list for method output_type
- 3, // [3:3] is the sub-list for method input_type
- 3, // [3:3] is the sub-list for extension type_name
- 3, // [3:3] is the sub-list for extension extendee
- 0, // [0:3] is the sub-list for field type_name
+ 3, // 1: bytebase.store.AuditLog.status:type_name -> google.rpc.Status
+ 4, // 2: bytebase.store.AuditLog.service_data:type_name -> google.protobuf.Any
+ 2, // 3: bytebase.store.AuditLog.request_metadata:type_name -> bytebase.store.RequestMetadata
+ 4, // [4:4] is the sub-list for method output_type
+ 4, // [4:4] is the sub-list for method input_type
+ 4, // [4:4] is the sub-list for extension type_name
+ 4, // [4:4] is the sub-list for extension extendee
+ 0, // [0:4] is the sub-list for field type_name
}
func init() { file_store_audit_log_proto_init() }
@@ -302,6 +384,18 @@ func file_store_audit_log_proto_init() {
return nil
}
}
+ file_store_audit_log_proto_msgTypes[1].Exporter = func(v any, i int) any {
+ switch v := v.(*RequestMetadata); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
}
type x struct{}
out := protoimpl.TypeBuilder{
@@ -309,7 +403,7 @@ func file_store_audit_log_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_store_audit_log_proto_rawDesc,
NumEnums: 1,
- NumMessages: 1,
+ NumMessages: 2,
NumExtensions: 0,
NumServices: 0,
},
diff --git a/proto/generated-go/v1/audit_log_service.pb.go b/proto/generated-go/v1/audit_log_service.pb.go
index a344d0f006..272c6955b4 100644
--- a/proto/generated-go/v1/audit_log_service.pb.go
+++ b/proto/generated-go/v1/audit_log_service.pb.go
@@ -401,6 +401,8 @@ type AuditLog struct {
Status *status.Status `protobuf:"bytes,9,opt,name=status,proto3" json:"status,omitempty"`
// service-specific data about the request, response, and other activities.
ServiceData *anypb.Any `protobuf:"bytes,10,opt,name=service_data,json=serviceData,proto3" json:"service_data,omitempty"`
+ // Metadata about the operation.
+ RequestMetadata *RequestMetadata `protobuf:"bytes,11,opt,name=request_metadata,json=requestMetadata,proto3" json:"request_metadata,omitempty"`
}
func (x *AuditLog) Reset() {
@@ -505,6 +507,13 @@ func (x *AuditLog) GetServiceData() *anypb.Any {
return nil
}
+func (x *AuditLog) GetRequestMetadata() *RequestMetadata {
+ if x != nil {
+ return x.RequestMetadata
+ }
+ return nil
+}
+
type AuditData struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -552,6 +561,65 @@ func (x *AuditData) GetPolicyDelta() *PolicyDelta {
return nil
}
+// Metadata about the request.
+type RequestMetadata struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // The IP address of the caller.
+ CallerIp string `protobuf:"bytes,1,opt,name=caller_ip,json=callerIp,proto3" json:"caller_ip,omitempty"`
+ // The user agent of the caller.
+ // This information is not authenticated and should be treated accordingly.
+ CallerSuppliedUserAgent string `protobuf:"bytes,2,opt,name=caller_supplied_user_agent,json=callerSuppliedUserAgent,proto3" json:"caller_supplied_user_agent,omitempty"`
+}
+
+func (x *RequestMetadata) Reset() {
+ *x = RequestMetadata{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_v1_audit_log_service_proto_msgTypes[6]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *RequestMetadata) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*RequestMetadata) ProtoMessage() {}
+
+func (x *RequestMetadata) ProtoReflect() protoreflect.Message {
+ mi := &file_v1_audit_log_service_proto_msgTypes[6]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use RequestMetadata.ProtoReflect.Descriptor instead.
+func (*RequestMetadata) Descriptor() ([]byte, []int) {
+ return file_v1_audit_log_service_proto_rawDescGZIP(), []int{6}
+}
+
+func (x *RequestMetadata) GetCallerIp() string {
+ if x != nil {
+ return x.CallerIp
+ }
+ return ""
+}
+
+func (x *RequestMetadata) GetCallerSuppliedUserAgent() string {
+ if x != nil {
+ return x.CallerSuppliedUserAgent
+ }
+ return ""
+}
+
var File_v1_audit_log_service_proto protoreflect.FileDescriptor
var file_v1_audit_log_service_proto_rawDesc = []byte{
@@ -606,7 +674,7 @@ var file_v1_audit_log_service_proto_rawDesc = []byte{
0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x22, 0x33, 0x0a, 0x17, 0x45, 0x78, 0x70, 0x6f, 0x72,
0x74, 0x41, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20,
- 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x80, 0x04, 0x0a,
+ 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0xc9, 0x04, 0x0a,
0x08, 0x41, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x12, 0x18, 0x0a, 0x04, 0x6e, 0x61, 0x6d,
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x03, 0x52, 0x04, 0x6e,
0x61, 0x6d, 0x65, 0x12, 0x41, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69,
@@ -631,47 +699,58 @@ var file_v1_audit_log_service_proto_rawDesc = []byte{
0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0a, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63,
- 0x65, 0x44, 0x61, 0x74, 0x61, 0x22, 0x78, 0x0a, 0x08, 0x53, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74,
- 0x79, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0x00, 0x12, 0x09,
- 0x0a, 0x05, 0x44, 0x45, 0x42, 0x55, 0x47, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x4e, 0x46,
- 0x4f, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x4f, 0x54, 0x49, 0x43, 0x45, 0x10, 0x03, 0x12,
- 0x0b, 0x0a, 0x07, 0x57, 0x41, 0x52, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x04, 0x12, 0x09, 0x0a, 0x05,
- 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x05, 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x52, 0x49, 0x54, 0x49,
- 0x43, 0x41, 0x4c, 0x10, 0x06, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x4c, 0x45, 0x52, 0x54, 0x10, 0x07,
- 0x12, 0x0d, 0x0a, 0x09, 0x45, 0x4d, 0x45, 0x52, 0x47, 0x45, 0x4e, 0x43, 0x59, 0x10, 0x08, 0x22,
- 0x48, 0x0a, 0x09, 0x41, 0x75, 0x64, 0x69, 0x74, 0x44, 0x61, 0x74, 0x61, 0x12, 0x3b, 0x0a, 0x0c,
- 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x64, 0x65, 0x6c, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01,
- 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,
- 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x44, 0x65, 0x6c, 0x74, 0x61, 0x52, 0x0b, 0x70, 0x6f,
- 0x6c, 0x69, 0x63, 0x79, 0x44, 0x65, 0x6c, 0x74, 0x61, 0x32, 0x9c, 0x03, 0x0a, 0x0f, 0x41, 0x75,
- 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xc1, 0x01,
- 0x0a, 0x0f, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67,
- 0x73, 0x12, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
- 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x52,
- 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
- 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x75, 0x64, 0x69, 0x74,
- 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x63, 0x8a, 0xea,
- 0x30, 0x13, 0x62, 0x62, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x2e, 0x73,
- 0x65, 0x61, 0x72, 0x63, 0x68, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x42, 0x5a,
- 0x16, 0x12, 0x14, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x73,
- 0x3a, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x28, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61,
- 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d,
- 0x2f, 0x61, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x3a, 0x73, 0x65, 0x61, 0x72, 0x63,
- 0x68, 0x12, 0xc4, 0x01, 0x0a, 0x0f, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x41, 0x75, 0x64, 0x69,
- 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x12, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
- 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x41, 0x75, 0x64, 0x69, 0x74, 0x4c,
- 0x6f, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x62, 0x79, 0x74,
- 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x41,
- 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
- 0x22, 0x66, 0x8a, 0xea, 0x30, 0x13, 0x62, 0x62, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f,
- 0x67, 0x73, 0x2e, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4,
- 0x93, 0x02, 0x45, 0x3a, 0x01, 0x2a, 0x5a, 0x16, 0x22, 0x14, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75,
- 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x3a, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x22, 0x28,
- 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a,
- 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x61, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67,
- 0x73, 0x3a, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x42, 0x11, 0x5a, 0x0f, 0x67, 0x65, 0x6e, 0x65,
- 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f,
- 0x74, 0x6f, 0x33,
+ 0x65, 0x44, 0x61, 0x74, 0x61, 0x12, 0x47, 0x0a, 0x10, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
+ 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32,
+ 0x1c, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65,
+ 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x0f, 0x72,
+ 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x78,
+ 0x0a, 0x08, 0x53, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45,
+ 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x44, 0x45, 0x42, 0x55, 0x47,
+ 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06,
+ 0x4e, 0x4f, 0x54, 0x49, 0x43, 0x45, 0x10, 0x03, 0x12, 0x0b, 0x0a, 0x07, 0x57, 0x41, 0x52, 0x4e,
+ 0x49, 0x4e, 0x47, 0x10, 0x04, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x05,
+ 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x52, 0x49, 0x54, 0x49, 0x43, 0x41, 0x4c, 0x10, 0x06, 0x12, 0x09,
+ 0x0a, 0x05, 0x41, 0x4c, 0x45, 0x52, 0x54, 0x10, 0x07, 0x12, 0x0d, 0x0a, 0x09, 0x45, 0x4d, 0x45,
+ 0x52, 0x47, 0x45, 0x4e, 0x43, 0x59, 0x10, 0x08, 0x22, 0x48, 0x0a, 0x09, 0x41, 0x75, 0x64, 0x69,
+ 0x74, 0x44, 0x61, 0x74, 0x61, 0x12, 0x3b, 0x0a, 0x0c, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f,
+ 0x64, 0x65, 0x6c, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x62, 0x79,
+ 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79,
+ 0x44, 0x65, 0x6c, 0x74, 0x61, 0x52, 0x0b, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x44, 0x65, 0x6c,
+ 0x74, 0x61, 0x22, 0x6b, 0x0a, 0x0f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74,
+ 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f,
+ 0x69, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72,
+ 0x49, 0x70, 0x12, 0x3b, 0x0a, 0x1a, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x73, 0x75, 0x70,
+ 0x70, 0x6c, 0x69, 0x65, 0x64, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x61, 0x67, 0x65, 0x6e, 0x74,
+ 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x17, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x53, 0x75,
+ 0x70, 0x70, 0x6c, 0x69, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x32,
+ 0x9c, 0x03, 0x0a, 0x0f, 0x41, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x53, 0x65, 0x72, 0x76,
+ 0x69, 0x63, 0x65, 0x12, 0xc1, 0x01, 0x0a, 0x0f, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x75,
+ 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x12, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
+ 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x75, 0x64, 0x69,
+ 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x62,
+ 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63,
+ 0x68, 0x41, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
+ 0x73, 0x65, 0x22, 0x63, 0x8a, 0xea, 0x30, 0x13, 0x62, 0x62, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74,
+ 0x4c, 0x6f, 0x67, 0x73, 0x2e, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x90, 0xea, 0x30, 0x01, 0x82,
+ 0xd3, 0xe4, 0x93, 0x02, 0x42, 0x5a, 0x16, 0x12, 0x14, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x64,
+ 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x3a, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x28, 0x2f,
+ 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65,
+ 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x61, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x73,
+ 0x3a, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0xc4, 0x01, 0x0a, 0x0f, 0x45, 0x78, 0x70, 0x6f,
+ 0x72, 0x74, 0x41, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x12, 0x23, 0x2e, 0x62, 0x79,
+ 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74,
+ 0x41, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
+ 0x1a, 0x24, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45,
+ 0x78, 0x70, 0x6f, 0x72, 0x74, 0x41, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65,
+ 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x66, 0x8a, 0xea, 0x30, 0x13, 0x62, 0x62, 0x2e, 0x61,
+ 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x2e, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x90,
+ 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x45, 0x3a, 0x01, 0x2a, 0x5a, 0x16, 0x22, 0x14,
+ 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x3a, 0x65, 0x78,
+ 0x70, 0x6f, 0x72, 0x74, 0x22, 0x28, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e,
+ 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x61, 0x75,
+ 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x3a, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x42, 0x11,
+ 0x5a, 0x0f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x76,
+ 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -687,7 +766,7 @@ func file_v1_audit_log_service_proto_rawDescGZIP() []byte {
}
var file_v1_audit_log_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
-var file_v1_audit_log_service_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
+var file_v1_audit_log_service_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
var file_v1_audit_log_service_proto_goTypes = []any{
(AuditLog_Severity)(0), // 0: bytebase.v1.AuditLog.Severity
(*SearchAuditLogsRequest)(nil), // 1: bytebase.v1.SearchAuditLogsRequest
@@ -696,29 +775,31 @@ var file_v1_audit_log_service_proto_goTypes = []any{
(*ExportAuditLogsResponse)(nil), // 4: bytebase.v1.ExportAuditLogsResponse
(*AuditLog)(nil), // 5: bytebase.v1.AuditLog
(*AuditData)(nil), // 6: bytebase.v1.AuditData
- (ExportFormat)(0), // 7: bytebase.v1.ExportFormat
- (*timestamppb.Timestamp)(nil), // 8: google.protobuf.Timestamp
- (*status.Status)(nil), // 9: google.rpc.Status
- (*anypb.Any)(nil), // 10: google.protobuf.Any
- (*PolicyDelta)(nil), // 11: bytebase.v1.PolicyDelta
+ (*RequestMetadata)(nil), // 7: bytebase.v1.RequestMetadata
+ (ExportFormat)(0), // 8: bytebase.v1.ExportFormat
+ (*timestamppb.Timestamp)(nil), // 9: google.protobuf.Timestamp
+ (*status.Status)(nil), // 10: google.rpc.Status
+ (*anypb.Any)(nil), // 11: google.protobuf.Any
+ (*PolicyDelta)(nil), // 12: bytebase.v1.PolicyDelta
}
var file_v1_audit_log_service_proto_depIdxs = []int32{
5, // 0: bytebase.v1.SearchAuditLogsResponse.audit_logs:type_name -> bytebase.v1.AuditLog
- 7, // 1: bytebase.v1.ExportAuditLogsRequest.format:type_name -> bytebase.v1.ExportFormat
- 8, // 2: bytebase.v1.AuditLog.create_time:type_name -> google.protobuf.Timestamp
+ 8, // 1: bytebase.v1.ExportAuditLogsRequest.format:type_name -> bytebase.v1.ExportFormat
+ 9, // 2: bytebase.v1.AuditLog.create_time:type_name -> google.protobuf.Timestamp
0, // 3: bytebase.v1.AuditLog.severity:type_name -> bytebase.v1.AuditLog.Severity
- 9, // 4: bytebase.v1.AuditLog.status:type_name -> google.rpc.Status
- 10, // 5: bytebase.v1.AuditLog.service_data:type_name -> google.protobuf.Any
- 11, // 6: bytebase.v1.AuditData.policy_delta:type_name -> bytebase.v1.PolicyDelta
- 1, // 7: bytebase.v1.AuditLogService.SearchAuditLogs:input_type -> bytebase.v1.SearchAuditLogsRequest
- 3, // 8: bytebase.v1.AuditLogService.ExportAuditLogs:input_type -> bytebase.v1.ExportAuditLogsRequest
- 2, // 9: bytebase.v1.AuditLogService.SearchAuditLogs:output_type -> bytebase.v1.SearchAuditLogsResponse
- 4, // 10: bytebase.v1.AuditLogService.ExportAuditLogs:output_type -> bytebase.v1.ExportAuditLogsResponse
- 9, // [9:11] is the sub-list for method output_type
- 7, // [7:9] is the sub-list for method input_type
- 7, // [7:7] is the sub-list for extension type_name
- 7, // [7:7] is the sub-list for extension extendee
- 0, // [0:7] is the sub-list for field type_name
+ 10, // 4: bytebase.v1.AuditLog.status:type_name -> google.rpc.Status
+ 11, // 5: bytebase.v1.AuditLog.service_data:type_name -> google.protobuf.Any
+ 7, // 6: bytebase.v1.AuditLog.request_metadata:type_name -> bytebase.v1.RequestMetadata
+ 12, // 7: bytebase.v1.AuditData.policy_delta:type_name -> bytebase.v1.PolicyDelta
+ 1, // 8: bytebase.v1.AuditLogService.SearchAuditLogs:input_type -> bytebase.v1.SearchAuditLogsRequest
+ 3, // 9: bytebase.v1.AuditLogService.ExportAuditLogs:input_type -> bytebase.v1.ExportAuditLogsRequest
+ 2, // 10: bytebase.v1.AuditLogService.SearchAuditLogs:output_type -> bytebase.v1.SearchAuditLogsResponse
+ 4, // 11: bytebase.v1.AuditLogService.ExportAuditLogs:output_type -> bytebase.v1.ExportAuditLogsResponse
+ 10, // [10:12] is the sub-list for method output_type
+ 8, // [8:10] is the sub-list for method input_type
+ 8, // [8:8] is the sub-list for extension type_name
+ 8, // [8:8] is the sub-list for extension extendee
+ 0, // [0:8] is the sub-list for field type_name
}
func init() { file_v1_audit_log_service_proto_init() }
@@ -802,6 +883,18 @@ func file_v1_audit_log_service_proto_init() {
return nil
}
}
+ file_v1_audit_log_service_proto_msgTypes[6].Exporter = func(v any, i int) any {
+ switch v := v.(*RequestMetadata); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
}
type x struct{}
out := protoimpl.TypeBuilder{
@@ -809,7 +902,7 @@ func file_v1_audit_log_service_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_v1_audit_log_service_proto_rawDesc,
NumEnums: 1,
- NumMessages: 6,
+ NumMessages: 7,
NumExtensions: 0,
NumServices: 1,
},
diff --git a/proto/store/audit_log.proto b/proto/store/audit_log.proto
index 97fce03a6c..5ef6b8bdb3 100644
--- a/proto/store/audit_log.proto
+++ b/proto/store/audit_log.proto
@@ -38,6 +38,9 @@ message AuditLog {
// service-specific data about the request, response, and other activities.
google.protobuf.Any service_data = 10;
+ // Metadata about the operation.
+ RequestMetadata request_metadata = 11;
+
enum Severity {
DEFAULT = 0;
DEBUG = 1;
@@ -50,3 +53,13 @@ message AuditLog {
EMERGENCY = 8;
}
}
+
+// Metadata about the request.
+message RequestMetadata {
+ // The IP address of the caller.
+ string caller_ip = 1;
+
+ // The user agent of the caller.
+ // This information is not authenticated and should be treated accordingly.
+ string caller_supplied_user_agent = 2;
+}
diff --git a/proto/v1/audit_log_service.proto b/proto/v1/audit_log_service.proto
index ab51834a2e..08db8d7964 100644
--- a/proto/v1/audit_log_service.proto
+++ b/proto/v1/audit_log_service.proto
@@ -136,6 +136,9 @@ message AuditLog {
// service-specific data about the request, response, and other activities.
google.protobuf.Any service_data = 10;
+ // Metadata about the operation.
+ RequestMetadata request_metadata = 11;
+
enum Severity {
DEFAULT = 0;
DEBUG = 1;
@@ -152,3 +155,13 @@ message AuditLog {
message AuditData {
PolicyDelta policy_delta = 1;
}
+
+// Metadata about the request.
+message RequestMetadata {
+ // The IP address of the caller.
+ string caller_ip = 1;
+
+ // The user agent of the caller.
+ // This information is not authenticated and should be treated accordingly.
+ string caller_supplied_user_agent = 2;
+}