Skip to content

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

feat(api): add policy delta to storepb (#12936)

Azusainb2514146d0b1
diff --git a/frontend/src/types/proto/store/audit_log.ts b/frontend/src/types/proto/store/audit_log.ts
index fdebe0b8dd..474ff7c204 100644
--- a/frontend/src/types/proto/store/audit_log.ts
+++ b/frontend/src/types/proto/store/audit_log.ts
@@ -1,6 +1,7 @@
/* eslint-disable */
import Long from "long";
import _m0 from "protobufjs/minimal";
+import { Any } from "../google/protobuf/any";
import { Status } from "../google/rpc/status";
export const protobufPackage = "bytebase.store";
@@ -30,7 +31,11 @@ export interface AuditLog {
* Some fields are omitted because they are too large or contain sensitive information.
*/
response: string;
- status: Status | undefined;
+ status:
+ | Status
+ | undefined;
+ /** service-specific data about the request, response, and other activities. */
+ serviceData: Any | undefined;
}
export enum AuditLog_Severity {
@@ -144,6 +149,7 @@ function createBaseAuditLog(): AuditLog {
request: "",
response: "",
status: undefined,
+ serviceData: undefined,
};
}
@@ -173,6 +179,9 @@ export const AuditLog = {
if (message.status !== undefined) {
Status.encode(message.status, writer.uint32(66).fork()).ldelim();
}
+ if (message.serviceData !== undefined) {
+ Any.encode(message.serviceData, writer.uint32(82).fork()).ldelim();
+ }
return writer;
},
@@ -239,6 +248,13 @@ export const AuditLog = {
message.status = Status.decode(reader, reader.uint32());
continue;
+ case 10:
+ if (tag !== 82) {
+ break;
+ }
+
+ message.serviceData = Any.decode(reader, reader.uint32());
+ continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
@@ -258,6 +274,7 @@ export const AuditLog = {
request: isSet(object.request) ? globalThis.String(object.request) : "",
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,
};
},
@@ -287,6 +304,9 @@ export const AuditLog = {
if (message.status !== undefined) {
obj.status = Status.toJSON(message.status);
}
+ if (message.serviceData !== undefined) {
+ obj.serviceData = Any.toJSON(message.serviceData);
+ }
return obj;
},
@@ -305,6 +325,9 @@ export const AuditLog = {
message.status = (object.status !== undefined && object.status !== null)
? Status.fromPartial(object.status)
: undefined;
+ message.serviceData = (object.serviceData !== undefined && object.serviceData !== null)
+ ? Any.fromPartial(object.serviceData)
+ : undefined;
return message;
},
};
diff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.md
index dbb51b5854..f6bca575d0 100644
--- a/proto/gen/grpc-doc/store/README.md
+++ b/proto/gen/grpc-doc/store/README.md
@@ -767,6 +767,7 @@ ANY means approving any node will proceed.
| request | [string](#string) | | Marshalled request. |
| 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. |
diff --git a/proto/gen/grpc-doc/store/index.html b/proto/gen/grpc-doc/store/index.html
index d796f87dec..4c8cad6987 100644
--- a/proto/gen/grpc-doc/store/index.html
+++ b/proto/gen/grpc-doc/store/index.html
@@ -2473,6 +2473,13 @@ Some fields are omitted because they are too large or contain sensitive informat
<td><p> </p></td>
</tr>
+ <tr>
+ <td>service_data</td>
+ <td><a href="#google.protobuf.Any">google.protobuf.Any</a></td>
+ <td></td>
+ <td><p>service-specific data about the request, response, and other activities. </p></td>
+ </tr>
+
</tbody>
</table>
diff --git a/proto/generated-go/store/audit_log.pb.go b/proto/generated-go/store/audit_log.pb.go
index 984322a76b..170ebe7a7f 100644
--- a/proto/generated-go/store/audit_log.pb.go
+++ b/proto/generated-go/store/audit_log.pb.go
@@ -10,6 +10,7 @@ import (
status "google.golang.org/genproto/googleapis/rpc/status"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+ anypb "google.golang.org/protobuf/types/known/anypb"
reflect "reflect"
sync "sync"
)
@@ -112,6 +113,8 @@ type AuditLog struct {
// Some fields are omitted because they are too large or contain sensitive information.
Response string `protobuf:"bytes,7,opt,name=response,proto3" json:"response,omitempty"`
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"`
}
func (x *AuditLog) Reset() {
@@ -202,40 +205,52 @@ func (x *AuditLog) GetStatus() *status.Status {
return nil
}
+func (x *AuditLog) GetServiceData() *anypb.Any {
+ if x != nil {
+ return x.ServiceData
+ }
+ return nil
+}
+
var File_store_audit_log_proto protoreflect.FileDescriptor
var file_store_audit_log_proto_rawDesc = []byte{
0x0a, 0x15, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x75, 0x64, 0x69, 0x74, 0x5f, 0x6c, 0x6f,
0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
- 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 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, 0x85, 0x03, 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, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x1a, 0x0a,
- 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
- 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x73, 0x65,
- 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x3d, 0x0a,
- 0x08, 0x73, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32,
- 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65,
- 0x2e, 0x41, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x2e, 0x53, 0x65, 0x76, 0x65, 0x72, 0x69,
- 0x74, 0x79, 0x52, 0x08, 0x73, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, 0x12, 0x18, 0x0a, 0x07,
- 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x72,
- 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e,
- 0x73, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e,
- 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x08, 0x20, 0x01,
- 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, 0x2e,
- 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 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,
+ 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,
+ 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,
+ 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f,
+ 0x75, 0x72, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f,
+ 0x75, 0x72, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01,
+ 0x28, 0x09, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x3d, 0x0a, 0x08, 0x73, 0x65, 0x76, 0x65,
+ 0x72, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x62, 0x79, 0x74,
+ 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x41, 0x75, 0x64, 0x69,
+ 0x74, 0x4c, 0x6f, 0x67, 0x2e, 0x53, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, 0x52, 0x08, 0x73,
+ 0x65, 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65,
+ 0x73, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73,
+ 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x07, 0x20,
+ 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a,
+ 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e,
+ 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75,
+ 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x37, 0x0a, 0x0c, 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, 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 (
@@ -256,15 +271,17 @@ 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
}
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
- 2, // [2:2] is the sub-list for method output_type
- 2, // [2:2] is the sub-list for method input_type
- 2, // [2:2] is the sub-list for extension type_name
- 2, // [2:2] is the sub-list for extension extendee
- 0, // [0:2] is the sub-list for field type_name
+ 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
}
func init() { file_store_audit_log_proto_init() }
diff --git a/proto/store/audit_log.proto b/proto/store/audit_log.proto
index e21d385b43..97fce03a6c 100644
--- a/proto/store/audit_log.proto
+++ b/proto/store/audit_log.proto
@@ -2,6 +2,7 @@ syntax = "proto3";
package bytebase.store;
+import "google/protobuf/any.proto";
import "google/rpc/status.proto";
option go_package = "generated-go/store";
@@ -34,6 +35,9 @@ message AuditLog {
google.rpc.Status status = 8;
+ // service-specific data about the request, response, and other activities.
+ google.protobuf.Any service_data = 10;
+
enum Severity {
DEFAULT = 0;
DEBUG = 1;