Skip to content

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

feat(proto): audit log service (#11754)

p0nya724ffdd1eea
diff --git a/frontend/src/types/proto/google/protobuf/any.ts b/frontend/src/types/proto/google/protobuf/any.ts
index 1c425c789d..afc5514bd2 100644
--- a/frontend/src/types/proto/google/protobuf/any.ts
+++ b/frontend/src/types/proto/google/protobuf/any.ts
@@ -34,7 +34,7 @@ export const protobufPackage = "google.protobuf";
* foo = any.unpack(Foo.getDefaultInstance());
* }
*
- * Example 3: Pack and unpack a message in Python.
+ * Example 3: Pack and unpack a message in Python.
*
* foo = Foo(...)
* any = Any()
@@ -44,7 +44,7 @@ export const protobufPackage = "google.protobuf";
* any.Unpack(foo)
* ...
*
- * Example 4: Pack and unpack a message in Go
+ * Example 4: Pack and unpack a message in Go
*
* foo := &pb.Foo{...}
* any, err := anypb.New(foo)
@@ -64,7 +64,7 @@ export const protobufPackage = "google.protobuf";
* name "y.z".
*
* JSON
- * ====
+ *
* The JSON representation of an `Any` value uses the regular
* representation of the deserialized, embedded message, with an
* additional field `@type` which contains the type URL. Example:
@@ -116,8 +116,7 @@ export interface Any {
*
* Note: this functionality is not currently available in the official
* protobuf release, and it is not used for type URLs beginning with
- * type.googleapis.com. As of May 2023, there are no widely used type server
- * implementations and no plans to implement one.
+ * type.googleapis.com.
*
* Schemes other than `http`, `https` (or the empty scheme) might be
* used with implementation specific semantics.
diff --git a/frontend/src/types/proto/google/protobuf/descriptor.ts b/frontend/src/types/proto/google/protobuf/descriptor.ts
index 824c1150fd..e5804c3efe 100644
--- a/frontend/src/types/proto/google/protobuf/descriptor.ts
+++ b/frontend/src/types/proto/google/protobuf/descriptor.ts
@@ -4,98 +4,6 @@ import _m0 from "protobufjs/minimal";
export const protobufPackage = "google.protobuf";
-/** The full set of known editions. */
-export enum Edition {
- /** EDITION_UNKNOWN - A placeholder for an unknown edition value. */
- EDITION_UNKNOWN = 0,
- /**
- * EDITION_PROTO2 - Legacy syntax "editions". These pre-date editions, but behave much like
- * distinct editions. These can't be used to specify the edition of proto
- * files, but feature definitions must supply proto2/proto3 defaults for
- * backwards compatibility.
- */
- EDITION_PROTO2 = 998,
- EDITION_PROTO3 = 999,
- /**
- * EDITION_2023 - Editions that have been released. The specific values are arbitrary and
- * should not be depended on, but they will always be time-ordered for easy
- * comparison.
- */
- EDITION_2023 = 1000,
- /**
- * EDITION_1_TEST_ONLY - Placeholder editions for testing feature resolution. These should not be
- * used or relyed on outside of tests.
- */
- EDITION_1_TEST_ONLY = 1,
- EDITION_2_TEST_ONLY = 2,
- EDITION_99997_TEST_ONLY = 99997,
- EDITION_99998_TEST_ONLY = 99998,
- EDITION_99999_TEST_ONLY = 99999,
- UNRECOGNIZED = -1,
-}
-
-export function editionFromJSON(object: any): Edition {
- switch (object) {
- case 0:
- case "EDITION_UNKNOWN":
- return Edition.EDITION_UNKNOWN;
- case 998:
- case "EDITION_PROTO2":
- return Edition.EDITION_PROTO2;
- case 999:
- case "EDITION_PROTO3":
- return Edition.EDITION_PROTO3;
- case 1000:
- case "EDITION_2023":
- return Edition.EDITION_2023;
- case 1:
- case "EDITION_1_TEST_ONLY":
- return Edition.EDITION_1_TEST_ONLY;
- case 2:
- case "EDITION_2_TEST_ONLY":
- return Edition.EDITION_2_TEST_ONLY;
- case 99997:
- case "EDITION_99997_TEST_ONLY":
- return Edition.EDITION_99997_TEST_ONLY;
- case 99998:
- case "EDITION_99998_TEST_ONLY":
- return Edition.EDITION_99998_TEST_ONLY;
- case 99999:
- case "EDITION_99999_TEST_ONLY":
- return Edition.EDITION_99999_TEST_ONLY;
- case -1:
- case "UNRECOGNIZED":
- default:
- return Edition.UNRECOGNIZED;
- }
-}
-
-export function editionToJSON(object: Edition): string {
- switch (object) {
- case Edition.EDITION_UNKNOWN:
- return "EDITION_UNKNOWN";
- case Edition.EDITION_PROTO2:
- return "EDITION_PROTO2";
- case Edition.EDITION_PROTO3:
- return "EDITION_PROTO3";
- case Edition.EDITION_2023:
- return "EDITION_2023";
- case Edition.EDITION_1_TEST_ONLY:
- return "EDITION_1_TEST_ONLY";
- case Edition.EDITION_2_TEST_ONLY:
- return "EDITION_2_TEST_ONLY";
- case Edition.EDITION_99997_TEST_ONLY:
- return "EDITION_99997_TEST_ONLY";
- case Edition.EDITION_99998_TEST_ONLY:
- return "EDITION_99998_TEST_ONLY";
- case Edition.EDITION_99999_TEST_ONLY:
- return "EDITION_99999_TEST_ONLY";
- case Edition.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
/**
* The protocol compiler can output a FileDescriptorSet containing the .proto
* files it parses.
@@ -143,8 +51,8 @@ export interface FileDescriptorProto {
* If `edition` is present, this value must be "editions".
*/
syntax: string;
- /** The edition of the proto file. */
- edition: Edition;
+ /** The edition of the proto file, which is an opaque string. */
+ edition: string;
}
/** Describes a message type. */
@@ -188,84 +96,6 @@ export interface DescriptorProto_ReservedRange {
export interface ExtensionRangeOptions {
/** The parser stores options it doesn't recognize here. See above. */
uninterpretedOption: UninterpretedOption[];
- /**
- * For external users: DO NOT USE. We are in the process of open sourcing
- * extension declaration and executing internal cleanups before it can be
- * used externally.
- */
- declaration: ExtensionRangeOptions_Declaration[];
- /** Any features defined in the specific edition. */
- features:
- | FeatureSet
- | undefined;
- /**
- * The verification state of the range.
- * TODO: flip the default to DECLARATION once all empty ranges
- * are marked as UNVERIFIED.
- */
- verification: ExtensionRangeOptions_VerificationState;
-}
-
-/** The verification state of the extension range. */
-export enum ExtensionRangeOptions_VerificationState {
- /** DECLARATION - All the extensions of the range must be declared. */
- DECLARATION = 0,
- UNVERIFIED = 1,
- UNRECOGNIZED = -1,
-}
-
-export function extensionRangeOptions_VerificationStateFromJSON(object: any): ExtensionRangeOptions_VerificationState {
- switch (object) {
- case 0:
- case "DECLARATION":
- return ExtensionRangeOptions_VerificationState.DECLARATION;
- case 1:
- case "UNVERIFIED":
- return ExtensionRangeOptions_VerificationState.UNVERIFIED;
- case -1:
- case "UNRECOGNIZED":
- default:
- return ExtensionRangeOptions_VerificationState.UNRECOGNIZED;
- }
-}
-
-export function extensionRangeOptions_VerificationStateToJSON(object: ExtensionRangeOptions_VerificationState): string {
- switch (object) {
- case ExtensionRangeOptions_VerificationState.DECLARATION:
- return "DECLARATION";
- case ExtensionRangeOptions_VerificationState.UNVERIFIED:
- return "UNVERIFIED";
- case ExtensionRangeOptions_VerificationState.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export interface ExtensionRangeOptions_Declaration {
- /** The extension number declared within the extension range. */
- number: number;
- /**
- * The fully-qualified name of the extension field. There must be a leading
- * dot in front of the full name.
- */
- fullName: string;
- /**
- * The fully-qualified type name of the extension field. Unlike
- * Metadata.type, Declaration.type must have a leading dot for messages
- * and enums.
- */
- type: string;
- /**
- * If true, indicates that the number is reserved in the extension range,
- * and any extension field with the number will fail to compile. Set this
- * when a declared extension field is deleted.
- */
- reserved: boolean;
- /**
- * If true, indicates that the extension must be defined as repeated.
- * Otherwise the extension must be defined as optional.
- */
- repeated: boolean;
}
/** Describes a field within a message. */
@@ -363,10 +193,9 @@ export enum FieldDescriptorProto_Type {
TYPE_STRING = 9,
/**
* TYPE_GROUP - Tag-delimited aggregate.
- * Group type is deprecated and not supported after google.protobuf. However, Proto3
+ * Group type is deprecated and not supported in proto3. However, Proto3
* implementations should still be able to parse the group wire format and
- * treat group fields as unknown fields. In Editions, the group wire format
- * can be enabled via the `message_encoding` feature.
+ * treat group fields as unknown fields.
*/
TYPE_GROUP = 10,
/** TYPE_MESSAGE - Length-delimited aggregate. */
@@ -494,13 +323,8 @@ export function fieldDescriptorProto_TypeToJSON(object: FieldDescriptorProto_Typ
export enum FieldDescriptorProto_Label {
/** LABEL_OPTIONAL - 0 is reserved for errors */
LABEL_OPTIONAL = 1,
- LABEL_REPEATED = 3,
- /**
- * LABEL_REQUIRED - The required label is only allowed in google.protobuf. In proto3 and Editions
- * it's explicitly prohibited. In Editions, the `field_presence` feature
- * can be used to get this behavior.
- */
LABEL_REQUIRED = 2,
+ LABEL_REPEATED = 3,
UNRECOGNIZED = -1,
}
@@ -509,12 +333,12 @@ export function fieldDescriptorProto_LabelFromJSON(object: any): FieldDescriptor
case 1:
case "LABEL_OPTIONAL":
return FieldDescriptorProto_Label.LABEL_OPTIONAL;
- case 3:
- case "LABEL_REPEATED":
- return FieldDescriptorProto_Label.LABEL_REPEATED;
case 2:
case "LABEL_REQUIRED":
return FieldDescriptorProto_Label.LABEL_REQUIRED;
+ case 3:
+ case "LABEL_REPEATED":
+ return FieldDescriptorProto_Label.LABEL_REPEATED;
case -1:
case "UNRECOGNIZED":
default:
@@ -526,10 +350,10 @@ export function fieldDescriptorProto_LabelToJSON(object: FieldDescriptorProto_La
switch (object) {
case FieldDescriptorProto_Label.LABEL_OPTIONAL:
return "LABEL_OPTIONAL";
- case FieldDescriptorProto_Label.LABEL_REPEATED:
- return "LABEL_REPEATED";
case FieldDescriptorProto_Label.LABEL_REQUIRED:
return "LABEL_REQUIRED";
+ case FieldDescriptorProto_Label.LABEL_REPEATED:
+ return "LABEL_REPEATED";
case FieldDescriptorProto_Label.UNRECOGNIZED:
default:
return "UNRECOGNIZED";
@@ -723,10 +547,6 @@ export interface FileOptions {
* determining the ruby package.
*/
rubyPackage: string;
- /** Any features defined in the specific edition. */
- features:
- | FeatureSet
- | undefined;
/**
* The parser stores options it doesn't recognize here.
* See the documentation for the "Options" section above.
@@ -845,16 +665,12 @@ export interface MessageOptions {
* This should only be used as a temporary measure against broken builds due
* to the change in behavior for JSON field name conflicts.
*
- * TODO This is legacy behavior we plan to remove once downstream
+ * TODO(b/261750190) This is legacy behavior we plan to remove once downstream
* teams have had time to migrate.
*
* @deprecated
*/
deprecatedLegacyJsonFieldConflicts: boolean;
- /** Any features defined in the specific edition. */
- features:
- | FeatureSet
- | undefined;
/** The parser stores options it doesn't recognize here. See above. */
uninterpretedOption: UninterpretedOption[];
}
@@ -863,10 +679,8 @@ export interface FieldOptions {
/**
* The ctype option instructs the C++ code generator to use a different
* representation of the field than it normally would. See the specific
- * options below. This option is only implemented to support use of
- * [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of
- * type "bytes" in the open source release -- sorry, we'll try to include
- * other types in a future version!
+ * options below. This option is not yet implemented in the open source
+ * release -- sorry, we'll try to include it in a future version!
*/
ctype: FieldOptions_CType;
/**
@@ -874,9 +688,7 @@ export interface FieldOptions {
* a more efficient representation on the wire. Rather than repeatedly
* writing the tag and type for each element, the entire array is encoded as
* a single length-delimited blob. In proto3, only explicit setting it to
- * false will avoid using packed encoding. This option is prohibited in
- * Editions, but the `repeated_field_encoding` feature can be used to control
- * the behavior.
+ * false will avoid using packed encoding.
*/
packed: boolean;
/**
@@ -947,12 +759,7 @@ export interface FieldOptions {
*/
debugRedact: boolean;
retention: FieldOptions_OptionRetention;
- targets: FieldOptions_OptionTargetType[];
- editionDefaults: FieldOptions_EditionDefault[];
- /** Any features defined in the specific edition. */
- features:
- | FeatureSet
- | undefined;
+ target: FieldOptions_OptionTargetType;
/** The parser stores options it doesn't recognize here. See above. */
uninterpretedOption: UninterpretedOption[];
}
@@ -960,14 +767,6 @@ export interface FieldOptions {
export enum FieldOptions_CType {
/** STRING - Default mode. */
STRING = 0,
- /**
- * CORD - The option [ctype=CORD] may be applied to a non-repeated field of type
- * "bytes". It indicates that in C++, the data should be stored in a Cord
- * instead of a string. For very large strings, this may reduce memory
- * fragmentation. It may also allow better performance when parsing from a
- * Cord, or when parsing with aliasing enabled, as the parsed Cord may then
- * alias the original buffer.
- */
CORD = 1,
STRING_PIECE = 2,
UNRECOGNIZED = -1,
@@ -1178,17 +977,7 @@ export function fieldOptions_OptionTargetTypeToJSON(object: FieldOptions_OptionT
}
}
-export interface FieldOptions_EditionDefault {
- edition: Edition;
- /** Textproto value. */
- value: string;
-}
-
export interface OneofOptions {
- /** Any features defined in the specific edition. */
- features:
- | FeatureSet
- | undefined;
/** The parser stores options it doesn't recognize here. See above. */
uninterpretedOption: UninterpretedOption[];
}
@@ -1211,16 +1000,12 @@ export interface EnumOptions {
* and strips underscored from the fields before comparison in proto3 only.
* The new behavior takes `json_name` into account and applies to proto2 as
* well.
- * TODO Remove this legacy behavior once downstream teams have
+ * TODO(b/261750190) Remove this legacy behavior once downstream teams have
* had time to migrate.
*
* @deprecated
*/
deprecatedLegacyJsonFieldConflicts: boolean;
- /** Any features defined in the specific edition. */
- features:
- | FeatureSet
- | undefined;
/** The parser stores options it doesn't recognize here. See above. */
uninterpretedOption: UninterpretedOption[];
}
@@ -1233,25 +1018,11 @@ export interface EnumValueOptions {
* this is a formalization for deprecating enum values.
*/
deprecated: boolean;
- /** Any features defined in the specific edition. */
- features:
- | FeatureSet
- | undefined;
- /**
- * Indicate that fields annotated with this enum value should not be printed
- * out when using debug formats, e.g. when the field contains sensitive
- * credentials.
- */
- debugRedact: boolean;
/** The parser stores options it doesn't recognize here. See above. */
uninterpretedOption: UninterpretedOption[];
}
export interface ServiceOptions {
- /** Any features defined in the specific edition. */
- features:
- | FeatureSet
- | undefined;
/**
* Is this service deprecated?
* Depending on the target platform, this can emit Deprecated annotations
@@ -1272,10 +1043,6 @@ export interface MethodOptions {
*/
deprecated: boolean;
idempotencyLevel: MethodOptions_IdempotencyLevel;
- /** Any features defined in the specific edition. */
- features:
- | FeatureSet
- | undefined;
/** The parser stores options it doesn't recognize here. See above. */
uninterpretedOption: UninterpretedOption[];
}
@@ -1360,294 +1127,6 @@ export interface UninterpretedOption_NamePart {
isExtension: boolean;
}
-/**
- * TODO Enums in C++ gencode (and potentially other languages) are
- * not well scoped. This means that each of the feature enums below can clash
- * with each other. The short names we've chosen maximize call-site
- * readability, but leave us very open to this scenario. A future feature will
- * be designed and implemented to handle this, hopefully before we ever hit a
- * conflict here.
- */
-export interface FeatureSet {
- fieldPresence: FeatureSet_FieldPresence;
- enumType: FeatureSet_EnumType;
- repeatedFieldEncoding: FeatureSet_RepeatedFieldEncoding;
- utf8Validation: FeatureSet_Utf8Validation;
- messageEncoding: FeatureSet_MessageEncoding;
- jsonFormat: FeatureSet_JsonFormat;
-}
-
-export enum FeatureSet_FieldPresence {
- FIELD_PRESENCE_UNKNOWN = 0,
- EXPLICIT = 1,
- IMPLICIT = 2,
- LEGACY_REQUIRED = 3,
- UNRECOGNIZED = -1,
-}
-
-export function featureSet_FieldPresenceFromJSON(object: any): FeatureSet_FieldPresence {
- switch (object) {
- case 0:
- case "FIELD_PRESENCE_UNKNOWN":
- return FeatureSet_FieldPresence.FIELD_PRESENCE_UNKNOWN;
- case 1:
- case "EXPLICIT":
- return FeatureSet_FieldPresence.EXPLICIT;
- case 2:
- case "IMPLICIT":
- return FeatureSet_FieldPresence.IMPLICIT;
- case 3:
- case "LEGACY_REQUIRED":
- return FeatureSet_FieldPresence.LEGACY_REQUIRED;
- case -1:
- case "UNRECOGNIZED":
- default:
- return FeatureSet_FieldPresence.UNRECOGNIZED;
- }
-}
-
-export function featureSet_FieldPresenceToJSON(object: FeatureSet_FieldPresence): string {
- switch (object) {
- case FeatureSet_FieldPresence.FIELD_PRESENCE_UNKNOWN:
- return "FIELD_PRESENCE_UNKNOWN";
- case FeatureSet_FieldPresence.EXPLICIT:
- return "EXPLICIT";
- case FeatureSet_FieldPresence.IMPLICIT:
- return "IMPLICIT";
- case FeatureSet_FieldPresence.LEGACY_REQUIRED:
- return "LEGACY_REQUIRED";
- case FeatureSet_FieldPresence.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export enum FeatureSet_EnumType {
- ENUM_TYPE_UNKNOWN = 0,
- OPEN = 1,
- CLOSED = 2,
- UNRECOGNIZED = -1,
-}
-
-export function featureSet_EnumTypeFromJSON(object: any): FeatureSet_EnumType {
- switch (object) {
- case 0:
- case "ENUM_TYPE_UNKNOWN":
- return FeatureSet_EnumType.ENUM_TYPE_UNKNOWN;
- case 1:
- case "OPEN":
- return FeatureSet_EnumType.OPEN;
- case 2:
- case "CLOSED":
- return FeatureSet_EnumType.CLOSED;
- case -1:
- case "UNRECOGNIZED":
- default:
- return FeatureSet_EnumType.UNRECOGNIZED;
- }
-}
-
-export function featureSet_EnumTypeToJSON(object: FeatureSet_EnumType): string {
- switch (object) {
- case FeatureSet_EnumType.ENUM_TYPE_UNKNOWN:
- return "ENUM_TYPE_UNKNOWN";
- case FeatureSet_EnumType.OPEN:
- return "OPEN";
- case FeatureSet_EnumType.CLOSED:
- return "CLOSED";
- case FeatureSet_EnumType.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export enum FeatureSet_RepeatedFieldEncoding {
- REPEATED_FIELD_ENCODING_UNKNOWN = 0,
- PACKED = 1,
- EXPANDED = 2,
- UNRECOGNIZED = -1,
-}
-
-export function featureSet_RepeatedFieldEncodingFromJSON(object: any): FeatureSet_RepeatedFieldEncoding {
- switch (object) {
- case 0:
- case "REPEATED_FIELD_ENCODING_UNKNOWN":
- return FeatureSet_RepeatedFieldEncoding.REPEATED_FIELD_ENCODING_UNKNOWN;
- case 1:
- case "PACKED":
- return FeatureSet_RepeatedFieldEncoding.PACKED;
- case 2:
- case "EXPANDED":
- return FeatureSet_RepeatedFieldEncoding.EXPANDED;
- case -1:
- case "UNRECOGNIZED":
- default:
- return FeatureSet_RepeatedFieldEncoding.UNRECOGNIZED;
- }
-}
-
-export function featureSet_RepeatedFieldEncodingToJSON(object: FeatureSet_RepeatedFieldEncoding): string {
- switch (object) {
- case FeatureSet_RepeatedFieldEncoding.REPEATED_FIELD_ENCODING_UNKNOWN:
- return "REPEATED_FIELD_ENCODING_UNKNOWN";
- case FeatureSet_RepeatedFieldEncoding.PACKED:
- return "PACKED";
- case FeatureSet_RepeatedFieldEncoding.EXPANDED:
- return "EXPANDED";
- case FeatureSet_RepeatedFieldEncoding.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export enum FeatureSet_Utf8Validation {
- UTF8_VALIDATION_UNKNOWN = 0,
- NONE = 1,
- VERIFY = 2,
- UNRECOGNIZED = -1,
-}
-
-export function featureSet_Utf8ValidationFromJSON(object: any): FeatureSet_Utf8Validation {
- switch (object) {
- case 0:
- case "UTF8_VALIDATION_UNKNOWN":
- return FeatureSet_Utf8Validation.UTF8_VALIDATION_UNKNOWN;
- case 1:
- case "NONE":
- return FeatureSet_Utf8Validation.NONE;
- case 2:
- case "VERIFY":
- return FeatureSet_Utf8Validation.VERIFY;
- case -1:
- case "UNRECOGNIZED":
- default:
- return FeatureSet_Utf8Validation.UNRECOGNIZED;
- }
-}
-
-export function featureSet_Utf8ValidationToJSON(object: FeatureSet_Utf8Validation): string {
- switch (object) {
- case FeatureSet_Utf8Validation.UTF8_VALIDATION_UNKNOWN:
- return "UTF8_VALIDATION_UNKNOWN";
- case FeatureSet_Utf8Validation.NONE:
- return "NONE";
- case FeatureSet_Utf8Validation.VERIFY:
- return "VERIFY";
- case FeatureSet_Utf8Validation.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export enum FeatureSet_MessageEncoding {
- MESSAGE_ENCODING_UNKNOWN = 0,
- LENGTH_PREFIXED = 1,
- DELIMITED = 2,
- UNRECOGNIZED = -1,
-}
-
-export function featureSet_MessageEncodingFromJSON(object: any): FeatureSet_MessageEncoding {
- switch (object) {
- case 0:
- case "MESSAGE_ENCODING_UNKNOWN":
- return FeatureSet_MessageEncoding.MESSAGE_ENCODING_UNKNOWN;
- case 1:
- case "LENGTH_PREFIXED":
- return FeatureSet_MessageEncoding.LENGTH_PREFIXED;
- case 2:
- case "DELIMITED":
- return FeatureSet_MessageEncoding.DELIMITED;
- case -1:
- case "UNRECOGNIZED":
- default:
- return FeatureSet_MessageEncoding.UNRECOGNIZED;
- }
-}
-
-export function featureSet_MessageEncodingToJSON(object: FeatureSet_MessageEncoding): string {
- switch (object) {
- case FeatureSet_MessageEncoding.MESSAGE_ENCODING_UNKNOWN:
- return "MESSAGE_ENCODING_UNKNOWN";
- case FeatureSet_MessageEncoding.LENGTH_PREFIXED:
- return "LENGTH_PREFIXED";
- case FeatureSet_MessageEncoding.DELIMITED:
- return "DELIMITED";
- case FeatureSet_MessageEncoding.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export enum FeatureSet_JsonFormat {
- JSON_FORMAT_UNKNOWN = 0,
- ALLOW = 1,
- LEGACY_BEST_EFFORT = 2,
- UNRECOGNIZED = -1,
-}
-
-export function featureSet_JsonFormatFromJSON(object: any): FeatureSet_JsonFormat {
- switch (object) {
- case 0:
- case "JSON_FORMAT_UNKNOWN":
- return FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN;
- case 1:
- case "ALLOW":
- return FeatureSet_JsonFormat.ALLOW;
- case 2:
- case "LEGACY_BEST_EFFORT":
- return FeatureSet_JsonFormat.LEGACY_BEST_EFFORT;
- case -1:
- case "UNRECOGNIZED":
- default:
- return FeatureSet_JsonFormat.UNRECOGNIZED;
- }
-}
-
-export function featureSet_JsonFormatToJSON(object: FeatureSet_JsonFormat): string {
- switch (object) {
- case FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN:
- return "JSON_FORMAT_UNKNOWN";
- case FeatureSet_JsonFormat.ALLOW:
- return "ALLOW";
- case FeatureSet_JsonFormat.LEGACY_BEST_EFFORT:
- return "LEGACY_BEST_EFFORT";
- case FeatureSet_JsonFormat.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-/**
- * A compiled specification for the defaults of a set of features. These
- * messages are generated from FeatureSet extensions and can be used to seed
- * feature resolution. The resolution with this object becomes a simple search
- * for the closest matching edition, followed by proto merges.
- */
-export interface FeatureSetDefaults {
- defaults: FeatureSetDefaults_FeatureSetEditionDefault[];
- /**
- * The minimum supported edition (inclusive) when this was constructed.
- * Editions before this will not have defaults.
- */
- minimumEdition: Edition;
- /**
- * The maximum known edition (inclusive) when this was constructed. Editions
- * after this will not have reliable defaults.
- */
- maximumEdition: Edition;
-}
-
-/**
- * A map from every known edition with a unique set of defaults to its
- * defaults. Not all editions may be contained here. For a given edition,
- * the defaults at the closest matching edition ordered at or before it should
- * be used. This field must be in strict ascending order by edition.
- */
-export interface FeatureSetDefaults_FeatureSetEditionDefault {
- edition: Edition;
- features: FeatureSet | undefined;
-}
-
/**
* Encapsulates information about the original source file from which a
* FileDescriptorProto was generated.
@@ -1944,7 +1423,7 @@ function createBaseFileDescriptorProto(): FileDescriptorProto {
options: undefined,
sourceCodeInfo: undefined,
syntax: "",
- edition: 0,
+ edition: "",
};
}
@@ -1990,8 +1469,8 @@ export const FileDescriptorProto = {
if (message.syntax !== "") {
writer.uint32(98).string(message.syntax);
}
- if (message.edition !== 0) {
- writer.uint32(112).int32(message.edition);
+ if (message.edition !== "") {
+ writer.uint32(106).string(message.edition);
}
return writer;
},
@@ -2107,12 +1586,12 @@ export const FileDescriptorProto = {
message.syntax = reader.string();
continue;
- case 14:
- if (tag !== 112) {
+ case 13:
+ if (tag !== 106) {
break;
}
- message.edition = reader.int32() as any;
+ message.edition = reader.string();
continue;
}
if ((tag & 7) === 4 || tag === 0) {
@@ -2151,7 +1630,7 @@ export const FileDescriptorProto = {
options: isSet(object.options) ? FileOptions.fromJSON(object.options) : undefined,
sourceCodeInfo: isSet(object.sourceCodeInfo) ? SourceCodeInfo.fromJSON(object.sourceCodeInfo) : undefined,
syntax: isSet(object.syntax) ? globalThis.String(object.syntax) : "",
- edition: isSet(object.edition) ? editionFromJSON(object.edition) : 0,
+ edition: isSet(object.edition) ? globalThis.String(object.edition) : "",
};
},
@@ -2193,8 +1672,8 @@ export const FileDescriptorProto = {
if (message.syntax !== "") {
obj.syntax = message.syntax;
}
- if (message.edition !== 0) {
- obj.edition = editionToJSON(message.edition);
+ if (message.edition !== "") {
+ obj.edition = message.edition;
}
return obj;
},
@@ -2220,7 +1699,7 @@ export const FileDescriptorProto = {
? SourceCodeInfo.fromPartial(object.sourceCodeInfo)
: undefined;
message.syntax = object.syntax ?? "";
- message.edition = object.edition ?? 0;
+ message.edition = object.edition ?? "";
return message;
},
};
@@ -2614,7 +2093,7 @@ export const DescriptorProto_ReservedRange = {
};
function createBaseExtensionRangeOptions(): ExtensionRangeOptions {
- return { uninterpretedOption: [], declaration: [], features: undefined, verification: 0 };
+ return { uninterpretedOption: [] };
}
export const ExtensionRangeOptions = {
@@ -2622,15 +2101,6 @@ export const ExtensionRangeOptions = {
for (const v of message.uninterpretedOption) {
UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim();
}
- for (const v of message.declaration) {
- ExtensionRangeOptions_Declaration.encode(v!, writer.uint32(18).fork()).ldelim();
- }
- if (message.features !== undefined) {
- FeatureSet.encode(message.features, writer.uint32(402).fork()).ldelim();
- }
- if (message.verification !== 0) {
- writer.uint32(24).int32(message.verification);
- }
return writer;
},
@@ -2648,27 +2118,6 @@ export const ExtensionRangeOptions = {
message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32()));
continue;
- case 2:
- if (tag !== 18) {
- break;
- }
-
- message.declaration.push(ExtensionRangeOptions_Declaration.decode(reader, reader.uint32()));
- continue;
- case 50:
- if (tag !== 402) {
- break;
- }
-
- message.features = FeatureSet.decode(reader, reader.uint32());
- continue;
- case 3:
- if (tag !== 24) {
- break;
- }
-
- message.verification = reader.int32() as any;
- continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
@@ -2683,13 +2132,6 @@ export const ExtensionRangeOptions = {
uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption)
? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e))
: [],
- declaration: globalThis.Array.isArray(object?.declaration)
- ? object.declaration.map((e: any) => ExtensionRangeOptions_Declaration.fromJSON(e))
- : [],
- features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined,
- verification: isSet(object.verification)
- ? extensionRangeOptions_VerificationStateFromJSON(object.verification)
- : 0,
};
},
@@ -2698,15 +2140,6 @@ export const ExtensionRangeOptions = {
if (message.uninterpretedOption?.length) {
obj.uninterpretedOption = message.uninterpretedOption.map((e) => UninterpretedOption.toJSON(e));
}
- if (message.declaration?.length) {
- obj.declaration = message.declaration.map((e) => ExtensionRangeOptions_Declaration.toJSON(e));
- }
- if (message.features !== undefined) {
- obj.features = FeatureSet.toJSON(message.features);
- }
- if (message.verification !== 0) {
- obj.verification = extensionRangeOptions_VerificationStateToJSON(message.verification);
- }
return obj;
},
@@ -2716,130 +2149,6 @@ export const ExtensionRangeOptions = {
fromPartial(object: DeepPartial<ExtensionRangeOptions>): ExtensionRangeOptions {
const message = createBaseExtensionRangeOptions();
message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || [];
- message.declaration = object.declaration?.map((e) => ExtensionRangeOptions_Declaration.fromPartial(e)) || [];
- message.features = (object.features !== undefined && object.features !== null)
- ? FeatureSet.fromPartial(object.features)
- : undefined;
- message.verification = object.verification ?? 0;
- return message;
- },
-};
-
-function createBaseExtensionRangeOptions_Declaration(): ExtensionRangeOptions_Declaration {
- return { number: 0, fullName: "", type: "", reserved: false, repeated: false };
-}
-
-export const ExtensionRangeOptions_Declaration = {
- encode(message: ExtensionRangeOptions_Declaration, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.number !== 0) {
- writer.uint32(8).int32(message.number);
- }
- if (message.fullName !== "") {
- writer.uint32(18).string(message.fullName);
- }
- if (message.type !== "") {
- writer.uint32(26).string(message.type);
- }
- if (message.reserved === true) {
- writer.uint32(40).bool(message.reserved);
- }
- if (message.repeated === true) {
- writer.uint32(48).bool(message.repeated);
- }
- return writer;
- },
-
- decode(input: _m0.Reader | Uint8Array, length?: number): ExtensionRangeOptions_Declaration {
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseExtensionRangeOptions_Declaration();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1:
- if (tag !== 8) {
- break;
- }
-
- message.number = reader.int32();
- continue;
- case 2:
- if (tag !== 18) {
- break;
- }
-
- message.fullName = reader.string();
- continue;
- case 3:
- if (tag !== 26) {
- break;
- }
-
- message.type = reader.string();
- continue;
- case 5:
- if (tag !== 40) {
- break;
- }
-
- message.reserved = reader.bool();
- continue;
- case 6:
- if (tag !== 48) {
- break;
- }
-
- message.repeated = reader.bool();
- continue;
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skipType(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ExtensionRangeOptions_Declaration {
- return {
- number: isSet(object.number) ? globalThis.Number(object.number) : 0,
- fullName: isSet(object.fullName) ? globalThis.String(object.fullName) : "",
- type: isSet(object.type) ? globalThis.String(object.type) : "",
- reserved: isSet(object.reserved) ? globalThis.Boolean(object.reserved) : false,
- repeated: isSet(object.repeated) ? globalThis.Boolean(object.repeated) : false,
- };
- },
-
- toJSON(message: ExtensionRangeOptions_Declaration): unknown {
- const obj: any = {};
- if (message.number !== 0) {
- obj.number = Math.round(message.number);
- }
- if (message.fullName !== "") {
- obj.fullName = message.fullName;
- }
- if (message.type !== "") {
- obj.type = message.type;
- }
- if (message.reserved === true) {
- obj.reserved = message.reserved;
- }
- if (message.repeated === true) {
- obj.repeated = message.repeated;
- }
- return obj;
- },
-
- create(base?: DeepPartial<ExtensionRangeOptions_Declaration>): ExtensionRangeOptions_Declaration {
- return ExtensionRangeOptions_Declaration.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ExtensionRangeOptions_Declaration>): ExtensionRangeOptions_Declaration {
- const message = createBaseExtensionRangeOptions_Declaration();
- message.number = object.number ?? 0;
- message.fullName = object.fullName ?? "";
- message.type = object.type ?? "";
- message.reserved = object.reserved ?? false;
- message.repeated = object.repeated ?? false;
return message;
},
};
@@ -3694,7 +3003,6 @@ function createBaseFileOptions(): FileOptions {
phpNamespace: "",
phpMetadataNamespace: "",
rubyPackage: "",
- features: undefined,
uninterpretedOption: [],
};
}
@@ -3761,9 +3069,6 @@ export const FileOptions = {
if (message.rubyPackage !== "") {
writer.uint32(362).string(message.rubyPackage);
}
- if (message.features !== undefined) {
- FeatureSet.encode(message.features, writer.uint32(402).fork()).ldelim();
- }
for (const v of message.uninterpretedOption) {
UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim();
}
@@ -3917,13 +3222,6 @@ export const FileOptions = {
message.rubyPackage = reader.string();
continue;
- case 50:
- if (tag !== 402) {
- break;
- }
-
- message.features = FeatureSet.decode(reader, reader.uint32());
- continue;
case 999:
if (tag !== 7994) {
break;
@@ -3964,7 +3262,6 @@ export const FileOptions = {
phpNamespace: isSet(object.phpNamespace) ? globalThis.String(object.phpNamespace) : "",
phpMetadataNamespace: isSet(object.phpMetadataNamespace) ? globalThis.String(object.phpMetadataNamespace) : "",
rubyPackage: isSet(object.rubyPackage) ? globalThis.String(object.rubyPackage) : "",
- features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined,
uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption)
? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e))
: [],
@@ -4033,9 +3330,6 @@ export const FileOptions = {
if (message.rubyPackage !== "") {
obj.rubyPackage = message.rubyPackage;
}
- if (message.features !== undefined) {
- obj.features = FeatureSet.toJSON(message.features);
- }
if (message.uninterpretedOption?.length) {
obj.uninterpretedOption = message.uninterpretedOption.map((e) => UninterpretedOption.toJSON(e));
}
@@ -4067,9 +3361,6 @@ export const FileOptions = {
message.phpNamespace = object.phpNamespace ?? "";
message.phpMetadataNamespace = object.phpMetadataNamespace ?? "";
message.rubyPackage = object.rubyPackage ?? "";
- message.features = (object.features !== undefined && object.features !== null)
- ? FeatureSet.fromPartial(object.features)
- : undefined;
message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || [];
return message;
},
@@ -4082,7 +3373,6 @@ function createBaseMessageOptions(): MessageOptions {
deprecated: false,
mapEntry: false,
deprecatedLegacyJsonFieldConflicts: false,
- features: undefined,
uninterpretedOption: [],
};
}
@@ -4104,9 +3394,6 @@ export const MessageOptions = {
if (message.deprecatedLegacyJsonFieldConflicts === true) {
writer.uint32(88).bool(message.deprecatedLegacyJsonFieldConflicts);
}
- if (message.features !== undefined) {
- FeatureSet.encode(message.features, writer.uint32(98).fork()).ldelim();
- }
for (const v of message.uninterpretedOption) {
UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim();
}
@@ -4155,13 +3442,6 @@ export const MessageOptions = {
message.deprecatedLegacyJsonFieldConflicts = reader.bool();
continue;
- case 12:
- if (tag !== 98) {
- break;
- }
-
- message.features = FeatureSet.decode(reader, reader.uint32());
- continue;
case 999:
if (tag !== 7994) {
break;
@@ -4191,7 +3471,6 @@ export const MessageOptions = {
deprecatedLegacyJsonFieldConflicts: isSet(object.deprecatedLegacyJsonFieldConflicts)
? globalThis.Boolean(object.deprecatedLegacyJsonFieldConflicts)
: false,
- features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined,
uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption)
? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e))
: [],
@@ -4215,9 +3494,6 @@ export const MessageOptions = {
if (message.deprecatedLegacyJsonFieldConflicts === true) {
obj.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts;
}
- if (message.features !== undefined) {
- obj.features = FeatureSet.toJSON(message.features);
- }
if (message.uninterpretedOption?.length) {
obj.uninterpretedOption = message.uninterpretedOption.map((e) => UninterpretedOption.toJSON(e));
}
@@ -4234,9 +3510,6 @@ export const MessageOptions = {
message.deprecated = object.deprecated ?? false;
message.mapEntry = object.mapEntry ?? false;
message.deprecatedLegacyJsonFieldConflicts = object.deprecatedLegacyJsonFieldConflicts ?? false;
- message.features = (object.features !== undefined && object.features !== null)
- ? FeatureSet.fromPartial(object.features)
- : undefined;
message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || [];
return message;
},
@@ -4253,9 +3526,7 @@ function createBaseFieldOptions(): FieldOptions {
weak: false,
debugRedact: false,
retention: 0,
- targets: [],
- editionDefaults: [],
- features: undefined,
+ target: 0,
uninterpretedOption: [],
};
}
@@ -4289,16 +3560,8 @@ export const FieldOptions = {
if (message.retention !== 0) {
writer.uint32(136).int32(message.retention);
}
- writer.uint32(154).fork();
- for (const v of message.targets) {
- writer.int32(v);
- }
- writer.ldelim();
- for (const v of message.editionDefaults) {
- FieldOptions_EditionDefault.encode(v!, writer.uint32(162).fork()).ldelim();
- }
- if (message.features !== undefined) {
- FeatureSet.encode(message.features, writer.uint32(170).fork()).ldelim();
+ if (message.target !== 0) {
+ writer.uint32(144).int32(message.target);
}
for (const v of message.uninterpretedOption) {
UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim();
@@ -4376,36 +3639,12 @@ export const FieldOptions = {
message.retention = reader.int32() as any;
continue;
- case 19:
- if (tag === 152) {
- message.targets.push(reader.int32() as any);
-
- continue;
- }
-
- if (tag === 154) {
- const end2 = reader.uint32() + reader.pos;
- while (reader.pos < end2) {
- message.targets.push(reader.int32() as any);
- }
-
- continue;
- }
-
- break;
- case 20:
- if (tag !== 162) {
- break;
- }
-
- message.editionDefaults.push(FieldOptions_EditionDefault.decode(reader, reader.uint32()));
- continue;
- case 21:
- if (tag !== 170) {
+ case 18:
+ if (tag !== 144) {
break;
}
- message.features = FeatureSet.decode(reader, reader.uint32());
+ message.target = reader.int32() as any;
continue;
case 999:
if (tag !== 7994) {
@@ -4434,13 +3673,7 @@ export const FieldOptions = {
weak: isSet(object.weak) ? globalThis.Boolean(object.weak) : false,
debugRedact: isSet(object.debugRedact) ? globalThis.Boolean(object.debugRedact) : false,
retention: isSet(object.retention) ? fieldOptions_OptionRetentionFromJSON(object.retention) : 0,
- targets: globalThis.Array.isArray(object?.targets)
- ? object.targets.map((e: any) => fieldOptions_OptionTargetTypeFromJSON(e))
- : [],
- editionDefaults: globalThis.Array.isArray(object?.editionDefaults)
- ? object.editionDefaults.map((e: any) => FieldOptions_EditionDefault.fromJSON(e))
- : [],
- features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined,
+ target: isSet(object.target) ? fieldOptions_OptionTargetTypeFromJSON(object.target) : 0,
uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption)
? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e))
: [],
@@ -4476,14 +3709,8 @@ export const FieldOptions = {
if (message.retention !== 0) {
obj.retention = fieldOptions_OptionRetentionToJSON(message.retention);
}
- if (message.targets?.length) {
- obj.targets = message.targets.map((e) => fieldOptions_OptionTargetTypeToJSON(e));
- }
- if (message.editionDefaults?.length) {
- obj.editionDefaults = message.editionDefaults.map((e) => FieldOptions_EditionDefault.toJSON(e));
- }
- if (message.features !== undefined) {
- obj.features = FeatureSet.toJSON(message.features);
+ if (message.target !== 0) {
+ obj.target = fieldOptions_OptionTargetTypeToJSON(message.target);
}
if (message.uninterpretedOption?.length) {
obj.uninterpretedOption = message.uninterpretedOption.map((e) => UninterpretedOption.toJSON(e));
@@ -4505,99 +3732,18 @@ export const FieldOptions = {
message.weak = object.weak ?? false;
message.debugRedact = object.debugRedact ?? false;
message.retention = object.retention ?? 0;
- message.targets = object.targets?.map((e) => e) || [];
- message.editionDefaults = object.editionDefaults?.map((e) => FieldOptions_EditionDefault.fromPartial(e)) || [];
- message.features = (object.features !== undefined && object.features !== null)
- ? FeatureSet.fromPartial(object.features)
- : undefined;
+ message.target = object.target ?? 0;
message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || [];
return message;
},
};
-function createBaseFieldOptions_EditionDefault(): FieldOptions_EditionDefault {
- return { edition: 0, value: "" };
-}
-
-export const FieldOptions_EditionDefault = {
- encode(message: FieldOptions_EditionDefault, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.edition !== 0) {
- writer.uint32(24).int32(message.edition);
- }
- if (message.value !== "") {
- writer.uint32(18).string(message.value);
- }
- return writer;
- },
-
- decode(input: _m0.Reader | Uint8Array, length?: number): FieldOptions_EditionDefault {
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseFieldOptions_EditionDefault();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 3:
- if (tag !== 24) {
- break;
- }
-
- message.edition = reader.int32() as any;
- continue;
- case 2:
- if (tag !== 18) {
- break;
- }
-
- message.value = reader.string();
- continue;
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skipType(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): FieldOptions_EditionDefault {
- return {
- edition: isSet(object.edition) ? editionFromJSON(object.edition) : 0,
- value: isSet(object.value) ? globalThis.String(object.value) : "",
- };
- },
-
- toJSON(message: FieldOptions_EditionDefault): unknown {
- const obj: any = {};
- if (message.edition !== 0) {
- obj.edition = editionToJSON(message.edition);
- }
- if (message.value !== "") {
- obj.value = message.value;
- }
- return obj;
- },
-
- create(base?: DeepPartial<FieldOptions_EditionDefault>): FieldOptions_EditionDefault {
- return FieldOptions_EditionDefault.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<FieldOptions_EditionDefault>): FieldOptions_EditionDefault {
- const message = createBaseFieldOptions_EditionDefault();
- message.edition = object.edition ?? 0;
- message.value = object.value ?? "";
- return message;
- },
-};
-
function createBaseOneofOptions(): OneofOptions {
- return { features: undefined, uninterpretedOption: [] };
+ return { uninterpretedOption: [] };
}
export const OneofOptions = {
encode(message: OneofOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.features !== undefined) {
- FeatureSet.encode(message.features, writer.uint32(10).fork()).ldelim();
- }
for (const v of message.uninterpretedOption) {
UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim();
}
@@ -4611,13 +3757,6 @@ export const OneofOptions = {
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
- case 1:
- if (tag !== 10) {
- break;
- }
-
- message.features = FeatureSet.decode(reader, reader.uint32());
- continue;
case 999:
if (tag !== 7994) {
break;
@@ -4636,7 +3775,6 @@ export const OneofOptions = {
fromJSON(object: any): OneofOptions {
return {
- features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined,
uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption)
? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e))
: [],
@@ -4645,9 +3783,6 @@ export const OneofOptions = {
toJSON(message: OneofOptions): unknown {
const obj: any = {};
- if (message.features !== undefined) {
- obj.features = FeatureSet.toJSON(message.features);
- }
if (message.uninterpretedOption?.length) {
obj.uninterpretedOption = message.uninterpretedOption.map((e) => UninterpretedOption.toJSON(e));
}
@@ -4659,22 +3794,13 @@ export const OneofOptions = {
},
fromPartial(object: DeepPartial<OneofOptions>): OneofOptions {
const message = createBaseOneofOptions();
- message.features = (object.features !== undefined && object.features !== null)
- ? FeatureSet.fromPartial(object.features)
- : undefined;
message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || [];
return message;
},
};
function createBaseEnumOptions(): EnumOptions {
- return {
- allowAlias: false,
- deprecated: false,
- deprecatedLegacyJsonFieldConflicts: false,
- features: undefined,
- uninterpretedOption: [],
- };
+ return { allowAlias: false, deprecated: false, deprecatedLegacyJsonFieldConflicts: false, uninterpretedOption: [] };
}
export const EnumOptions = {
@@ -4688,9 +3814,6 @@ export const EnumOptions = {
if (message.deprecatedLegacyJsonFieldConflicts === true) {
writer.uint32(48).bool(message.deprecatedLegacyJsonFieldConflicts);
}
- if (message.features !== undefined) {
- FeatureSet.encode(message.features, writer.uint32(58).fork()).ldelim();
- }
for (const v of message.uninterpretedOption) {
UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim();
}
@@ -4725,13 +3848,6 @@ export const EnumOptions = {
message.deprecatedLegacyJsonFieldConflicts = reader.bool();
continue;
- case 7:
- if (tag !== 58) {
- break;
- }
-
- message.features = FeatureSet.decode(reader, reader.uint32());
- continue;
case 999:
if (tag !== 7994) {
break;
@@ -4755,7 +3871,6 @@ export const EnumOptions = {
deprecatedLegacyJsonFieldConflicts: isSet(object.deprecatedLegacyJsonFieldConflicts)
? globalThis.Boolean(object.deprecatedLegacyJsonFieldConflicts)
: false,
- features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined,
uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption)
? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e))
: [],
@@ -4773,9 +3888,6 @@ export const EnumOptions = {
if (message.deprecatedLegacyJsonFieldConflicts === true) {
obj.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts;
}
- if (message.features !== undefined) {
- obj.features = FeatureSet.toJSON(message.features);
- }
if (message.uninterpretedOption?.length) {
obj.uninterpretedOption = message.uninterpretedOption.map((e) => UninterpretedOption.toJSON(e));
}
@@ -4790,16 +3902,13 @@ export const EnumOptions = {
message.allowAlias = object.allowAlias ?? false;
message.deprecated = object.deprecated ?? false;
message.deprecatedLegacyJsonFieldConflicts = object.deprecatedLegacyJsonFieldConflicts ?? false;
- message.features = (object.features !== undefined && object.features !== null)
- ? FeatureSet.fromPartial(object.features)
- : undefined;
message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || [];
return message;
},
};
function createBaseEnumValueOptions(): EnumValueOptions {
- return { deprecated: false, features: undefined, debugRedact: false, uninterpretedOption: [] };
+ return { deprecated: false, uninterpretedOption: [] };
}
export const EnumValueOptions = {
@@ -4807,12 +3916,6 @@ export const EnumValueOptions = {
if (message.deprecated === true) {
writer.uint32(8).bool(message.deprecated);
}
- if (message.features !== undefined) {
- FeatureSet.encode(message.features, writer.uint32(18).fork()).ldelim();
- }
- if (message.debugRedact === true) {
- writer.uint32(24).bool(message.debugRedact);
- }
for (const v of message.uninterpretedOption) {
UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim();
}
@@ -4833,20 +3936,6 @@ export const EnumValueOptions = {
message.deprecated = reader.bool();
continue;
- case 2:
- if (tag !== 18) {
- break;
- }
-
- message.features = FeatureSet.decode(reader, reader.uint32());
- continue;
- case 3:
- if (tag !== 24) {
- break;
- }
-
- message.debugRedact = reader.bool();
- continue;
case 999:
if (tag !== 7994) {
break;
@@ -4866,8 +3955,6 @@ export const EnumValueOptions = {
fromJSON(object: any): EnumValueOptions {
return {
deprecated: isSet(object.deprecated) ? globalThis.Boolean(object.deprecated) : false,
- features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined,
- debugRedact: isSet(object.debugRedact) ? globalThis.Boolean(object.debugRedact) : false,
uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption)
? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e))
: [],
@@ -4879,12 +3966,6 @@ export const EnumValueOptions = {
if (message.deprecated === true) {
obj.deprecated = message.deprecated;
}
- if (message.features !== undefined) {
- obj.features = FeatureSet.toJSON(message.features);
- }
- if (message.debugRedact === true) {
- obj.debugRedact = message.debugRedact;
- }
if (message.uninterpretedOption?.length) {
obj.uninterpretedOption = message.uninterpretedOption.map((e) => UninterpretedOption.toJSON(e));
}
@@ -4897,24 +3978,17 @@ export const EnumValueOptions = {
fromPartial(object: DeepPartial<EnumValueOptions>): EnumValueOptions {
const message = createBaseEnumValueOptions();
message.deprecated = object.deprecated ?? false;
- message.features = (object.features !== undefined && object.features !== null)
- ? FeatureSet.fromPartial(object.features)
- : undefined;
- message.debugRedact = object.debugRedact ?? false;
message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || [];
return message;
},
};
function createBaseServiceOptions(): ServiceOptions {
- return { features: undefined, deprecated: false, uninterpretedOption: [] };
+ return { deprecated: false, uninterpretedOption: [] };
}
export const ServiceOptions = {
encode(message: ServiceOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.features !== undefined) {
- FeatureSet.encode(message.features, writer.uint32(274).fork()).ldelim();
- }
if (message.deprecated === true) {
writer.uint32(264).bool(message.deprecated);
}
@@ -4931,13 +4005,6 @@ export const ServiceOptions = {
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
- case 34:
- if (tag !== 274) {
- break;
- }
-
- message.features = FeatureSet.decode(reader, reader.uint32());
- continue;
case 33:
if (tag !== 264) {
break;
@@ -4963,7 +4030,6 @@ export const ServiceOptions = {
fromJSON(object: any): ServiceOptions {
return {
- features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined,
deprecated: isSet(object.deprecated) ? globalThis.Boolean(object.deprecated) : false,
uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption)
? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e))
@@ -4973,9 +4039,6 @@ export const ServiceOptions = {
toJSON(message: ServiceOptions): unknown {
const obj: any = {};
- if (message.features !== undefined) {
- obj.features = FeatureSet.toJSON(message.features);
- }
if (message.deprecated === true) {
obj.deprecated = message.deprecated;
}
@@ -4990,9 +4053,6 @@ export const ServiceOptions = {
},
fromPartial(object: DeepPartial<ServiceOptions>): ServiceOptions {
const message = createBaseServiceOptions();
- message.features = (object.features !== undefined && object.features !== null)
- ? FeatureSet.fromPartial(object.features)
- : undefined;
message.deprecated = object.deprecated ?? false;
message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || [];
return message;
@@ -5000,7 +4060,7 @@ export const ServiceOptions = {
};
function createBaseMethodOptions(): MethodOptions {
- return { deprecated: false, idempotencyLevel: 0, features: undefined, uninterpretedOption: [] };
+ return { deprecated: false, idempotencyLevel: 0, uninterpretedOption: [] };
}
export const MethodOptions = {
@@ -5011,9 +4071,6 @@ export const MethodOptions = {
if (message.idempotencyLevel !== 0) {
writer.uint32(272).int32(message.idempotencyLevel);
}
- if (message.features !== undefined) {
- FeatureSet.encode(message.features, writer.uint32(282).fork()).ldelim();
- }
for (const v of message.uninterpretedOption) {
UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim();
}
@@ -5041,13 +4098,6 @@ export const MethodOptions = {
message.idempotencyLevel = reader.int32() as any;
continue;
- case 35:
- if (tag !== 282) {
- break;
- }
-
- message.features = FeatureSet.decode(reader, reader.uint32());
- continue;
case 999:
if (tag !== 7994) {
break;
@@ -5070,7 +4120,6 @@ export const MethodOptions = {
idempotencyLevel: isSet(object.idempotencyLevel)
? methodOptions_IdempotencyLevelFromJSON(object.idempotencyLevel)
: 0,
- features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined,
uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption)
? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e))
: [],
@@ -5085,9 +4134,6 @@ export const MethodOptions = {
if (message.idempotencyLevel !== 0) {
obj.idempotencyLevel = methodOptions_IdempotencyLevelToJSON(message.idempotencyLevel);
}
- if (message.features !== undefined) {
- obj.features = FeatureSet.toJSON(message.features);
- }
if (message.uninterpretedOption?.length) {
obj.uninterpretedOption = message.uninterpretedOption.map((e) => UninterpretedOption.toJSON(e));
}
@@ -5101,9 +4147,6 @@ export const MethodOptions = {
const message = createBaseMethodOptions();
message.deprecated = object.deprecated ?? false;
message.idempotencyLevel = object.idempotencyLevel ?? 0;
- message.features = (object.features !== undefined && object.features !== null)
- ? FeatureSet.fromPartial(object.features)
- : undefined;
message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || [];
return message;
},
@@ -5346,318 +4389,6 @@ export const UninterpretedOption_NamePart = {
},
};
-function createBaseFeatureSet(): FeatureSet {
- return {
- fieldPresence: 0,
- enumType: 0,
- repeatedFieldEncoding: 0,
- utf8Validation: 0,
- messageEncoding: 0,
- jsonFormat: 0,
- };
-}
-
-export const FeatureSet = {
- encode(message: FeatureSet, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.fieldPresence !== 0) {
- writer.uint32(8).int32(message.fieldPresence);
- }
- if (message.enumType !== 0) {
- writer.uint32(16).int32(message.enumType);
- }
- if (message.repeatedFieldEncoding !== 0) {
- writer.uint32(24).int32(message.repeatedFieldEncoding);
- }
- if (message.utf8Validation !== 0) {
- writer.uint32(32).int32(message.utf8Validation);
- }
- if (message.messageEncoding !== 0) {
- writer.uint32(40).int32(message.messageEncoding);
- }
- if (message.jsonFormat !== 0) {
- writer.uint32(48).int32(message.jsonFormat);
- }
- return writer;
- },
-
- decode(input: _m0.Reader | Uint8Array, length?: number): FeatureSet {
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseFeatureSet();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1:
- if (tag !== 8) {
- break;
- }
-
- message.fieldPresence = reader.int32() as any;
- continue;
- case 2:
- if (tag !== 16) {
- break;
- }
-
- message.enumType = reader.int32() as any;
- continue;
- case 3:
- if (tag !== 24) {
- break;
- }
-
- message.repeatedFieldEncoding = reader.int32() as any;
- continue;
- case 4:
- if (tag !== 32) {
- break;
- }
-
- message.utf8Validation = reader.int32() as any;
- continue;
- case 5:
- if (tag !== 40) {
- break;
- }
-
- message.messageEncoding = reader.int32() as any;
- continue;
- case 6:
- if (tag !== 48) {
- break;
- }
-
- message.jsonFormat = reader.int32() as any;
- continue;
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skipType(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): FeatureSet {
- return {
- fieldPresence: isSet(object.fieldPresence) ? featureSet_FieldPresenceFromJSON(object.fieldPresence) : 0,
- enumType: isSet(object.enumType) ? featureSet_EnumTypeFromJSON(object.enumType) : 0,
- repeatedFieldEncoding: isSet(object.repeatedFieldEncoding)
- ? featureSet_RepeatedFieldEncodingFromJSON(object.repeatedFieldEncoding)
- : 0,
- utf8Validation: isSet(object.utf8Validation) ? featureSet_Utf8ValidationFromJSON(object.utf8Validation) : 0,
- messageEncoding: isSet(object.messageEncoding) ? featureSet_MessageEncodingFromJSON(object.messageEncoding) : 0,
- jsonFormat: isSet(object.jsonFormat) ? featureSet_JsonFormatFromJSON(object.jsonFormat) : 0,
- };
- },
-
- toJSON(message: FeatureSet): unknown {
- const obj: any = {};
- if (message.fieldPresence !== 0) {
- obj.fieldPresence = featureSet_FieldPresenceToJSON(message.fieldPresence);
- }
- if (message.enumType !== 0) {
- obj.enumType = featureSet_EnumTypeToJSON(message.enumType);
- }
- if (message.repeatedFieldEncoding !== 0) {
- obj.repeatedFieldEncoding = featureSet_RepeatedFieldEncodingToJSON(message.repeatedFieldEncoding);
- }
- if (message.utf8Validation !== 0) {
- obj.utf8Validation = featureSet_Utf8ValidationToJSON(message.utf8Validation);
- }
- if (message.messageEncoding !== 0) {
- obj.messageEncoding = featureSet_MessageEncodingToJSON(message.messageEncoding);
- }
- if (message.jsonFormat !== 0) {
- obj.jsonFormat = featureSet_JsonFormatToJSON(message.jsonFormat);
- }
- return obj;
- },
-
- create(base?: DeepPartial<FeatureSet>): FeatureSet {
- return FeatureSet.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<FeatureSet>): FeatureSet {
- const message = createBaseFeatureSet();
- message.fieldPresence = object.fieldPresence ?? 0;
- message.enumType = object.enumType ?? 0;
- message.repeatedFieldEncoding = object.repeatedFieldEncoding ?? 0;
- message.utf8Validation = object.utf8Validation ?? 0;
- message.messageEncoding = object.messageEncoding ?? 0;
- message.jsonFormat = object.jsonFormat ?? 0;
- return message;
- },
-};
-
-function createBaseFeatureSetDefaults(): FeatureSetDefaults {
- return { defaults: [], minimumEdition: 0, maximumEdition: 0 };
-}
-
-export const FeatureSetDefaults = {
- encode(message: FeatureSetDefaults, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- for (const v of message.defaults) {
- FeatureSetDefaults_FeatureSetEditionDefault.encode(v!, writer.uint32(10).fork()).ldelim();
- }
- if (message.minimumEdition !== 0) {
- writer.uint32(32).int32(message.minimumEdition);
- }
- if (message.maximumEdition !== 0) {
- writer.uint32(40).int32(message.maximumEdition);
- }
- return writer;
- },
-
- decode(input: _m0.Reader | Uint8Array, length?: number): FeatureSetDefaults {
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseFeatureSetDefaults();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1:
- if (tag !== 10) {
- break;
- }
-
- message.defaults.push(FeatureSetDefaults_FeatureSetEditionDefault.decode(reader, reader.uint32()));
- continue;
- case 4:
- if (tag !== 32) {
- break;
- }
-
- message.minimumEdition = reader.int32() as any;
- continue;
- case 5:
- if (tag !== 40) {
- break;
- }
-
- message.maximumEdition = reader.int32() as any;
- continue;
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skipType(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): FeatureSetDefaults {
- return {
- defaults: globalThis.Array.isArray(object?.defaults)
- ? object.defaults.map((e: any) => FeatureSetDefaults_FeatureSetEditionDefault.fromJSON(e))
- : [],
- minimumEdition: isSet(object.minimumEdition) ? editionFromJSON(object.minimumEdition) : 0,
- maximumEdition: isSet(object.maximumEdition) ? editionFromJSON(object.maximumEdition) : 0,
- };
- },
-
- toJSON(message: FeatureSetDefaults): unknown {
- const obj: any = {};
- if (message.defaults?.length) {
- obj.defaults = message.defaults.map((e) => FeatureSetDefaults_FeatureSetEditionDefault.toJSON(e));
- }
- if (message.minimumEdition !== 0) {
- obj.minimumEdition = editionToJSON(message.minimumEdition);
- }
- if (message.maximumEdition !== 0) {
- obj.maximumEdition = editionToJSON(message.maximumEdition);
- }
- return obj;
- },
-
- create(base?: DeepPartial<FeatureSetDefaults>): FeatureSetDefaults {
- return FeatureSetDefaults.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<FeatureSetDefaults>): FeatureSetDefaults {
- const message = createBaseFeatureSetDefaults();
- message.defaults = object.defaults?.map((e) => FeatureSetDefaults_FeatureSetEditionDefault.fromPartial(e)) || [];
- message.minimumEdition = object.minimumEdition ?? 0;
- message.maximumEdition = object.maximumEdition ?? 0;
- return message;
- },
-};
-
-function createBaseFeatureSetDefaults_FeatureSetEditionDefault(): FeatureSetDefaults_FeatureSetEditionDefault {
- return { edition: 0, features: undefined };
-}
-
-export const FeatureSetDefaults_FeatureSetEditionDefault = {
- encode(message: FeatureSetDefaults_FeatureSetEditionDefault, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.edition !== 0) {
- writer.uint32(24).int32(message.edition);
- }
- if (message.features !== undefined) {
- FeatureSet.encode(message.features, writer.uint32(18).fork()).ldelim();
- }
- return writer;
- },
-
- decode(input: _m0.Reader | Uint8Array, length?: number): FeatureSetDefaults_FeatureSetEditionDefault {
- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseFeatureSetDefaults_FeatureSetEditionDefault();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 3:
- if (tag !== 24) {
- break;
- }
-
- message.edition = reader.int32() as any;
- continue;
- case 2:
- if (tag !== 18) {
- break;
- }
-
- message.features = FeatureSet.decode(reader, reader.uint32());
- continue;
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skipType(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): FeatureSetDefaults_FeatureSetEditionDefault {
- return {
- edition: isSet(object.edition) ? editionFromJSON(object.edition) : 0,
- features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined,
- };
- },
-
- toJSON(message: FeatureSetDefaults_FeatureSetEditionDefault): unknown {
- const obj: any = {};
- if (message.edition !== 0) {
- obj.edition = editionToJSON(message.edition);
- }
- if (message.features !== undefined) {
- obj.features = FeatureSet.toJSON(message.features);
- }
- return obj;
- },
-
- create(base?: DeepPartial<FeatureSetDefaults_FeatureSetEditionDefault>): FeatureSetDefaults_FeatureSetEditionDefault {
- return FeatureSetDefaults_FeatureSetEditionDefault.fromPartial(base ?? {});
- },
- fromPartial(
- object: DeepPartial<FeatureSetDefaults_FeatureSetEditionDefault>,
- ): FeatureSetDefaults_FeatureSetEditionDefault {
- const message = createBaseFeatureSetDefaults_FeatureSetEditionDefault();
- message.edition = object.edition ?? 0;
- message.features = (object.features !== undefined && object.features !== null)
- ? FeatureSet.fromPartial(object.features)
- : undefined;
- return message;
- },
-};
-
function createBaseSourceCodeInfo(): SourceCodeInfo {
return { location: [] };
}
diff --git a/frontend/src/types/proto/google/protobuf/struct.ts b/frontend/src/types/proto/google/protobuf/struct.ts
index b87dbf5bac..dbdf7a289a 100644
--- a/frontend/src/types/proto/google/protobuf/struct.ts
+++ b/frontend/src/types/proto/google/protobuf/struct.ts
@@ -8,7 +8,7 @@ export const protobufPackage = "google.protobuf";
* `NullValue` is a singleton enumeration to represent the null value for the
* `Value` type union.
*
- * The JSON representation for `NullValue` is JSON `null`.
+ * The JSON representation for `NullValue` is JSON `null`.
*/
export enum NullValue {
/** NULL_VALUE - Null value. */
diff --git a/frontend/src/types/proto/google/protobuf/timestamp.ts b/frontend/src/types/proto/google/protobuf/timestamp.ts
index 5781891bc0..51695e08d0 100644
--- a/frontend/src/types/proto/google/protobuf/timestamp.ts
+++ b/frontend/src/types/proto/google/protobuf/timestamp.ts
@@ -92,7 +92,7 @@ export const protobufPackage = "google.protobuf";
* [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
* the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
* the Joda Time's [`ISODateTimeFormat.dateTime()`](
- * http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()
+ * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
* ) to obtain a formatter capable of generating timestamps in this format.
*/
export interface Timestamp {
diff --git a/frontend/src/types/proto/v1/audit_log_service.ts b/frontend/src/types/proto/v1/audit_log_service.ts
new file mode 100644
index 0000000000..9acaf763b5
--- /dev/null
+++ b/frontend/src/types/proto/v1/audit_log_service.ts
@@ -0,0 +1,578 @@
+/* eslint-disable */
+import Long from "long";
+import _m0 from "protobufjs/minimal";
+import { Timestamp } from "../google/protobuf/timestamp";
+import { Status } from "../google/rpc/status";
+
+export const protobufPackage = "bytebase.v1";
+
+export interface SearchAuditLogsRequest {
+ filter: string;
+ /**
+ * The order by of the log.
+ * Only support order by create_time.
+ * For example:
+ * - order_by = "create_time asc"
+ * - order_by = "create_time desc"
+ */
+ orderBy: string;
+ /**
+ * The maximum number of logs to return.
+ * The service may return fewer than this value.
+ * If unspecified, at most 100 log entries will be returned.
+ * The maximum value is 1000; values above 1000 will be coerced to 1000.
+ */
+ pageSize: number;
+ /**
+ * A page token, received from a previous `SearchLogs` call.
+ * Provide this to retrieve the subsequent page.
+ */
+ pageToken: string;
+}
+
+export interface SearchAuditLogsResponse {
+ auditLogs: AuditLog[];
+ /**
+ * A token to retrieve next page of log entities.
+ * Pass this value in the page_token field in the subsequent call
+ * to retrieve the next page of log entities.
+ */
+ nextPageToken: string;
+}
+
+export interface AuditLog {
+ /**
+ * The name of the log.
+ * Format: logs/{uid}
+ */
+ name: string;
+ createTime:
+ | Date
+ | undefined;
+ /** Format: users/[email protected] */
+ user: string;
+ /** e.g. `/bytebase.v1.SQLService/Query`, `bb.project.repository.push` */
+ method: string;
+ severity: AuditLog_Severity;
+ /** The associated resource. */
+ resource: string;
+ /** JSON-encoded request. */
+ request: string;
+ /**
+ * JSON-encoded response.
+ * Some fields are omitted because they are too large or contain sensitive information.
+ */
+ response: string;
+ status: Status | undefined;
+}
+
+export enum AuditLog_Severity {
+ DEFAULT = 0,
+ DEBUG = 1,
+ INFO = 2,
+ NOTICE = 3,
+ WARNING = 4,
+ ERROR = 5,
+ CRITICAL = 6,
+ ALERT = 7,
+ EMERGENCY = 8,
+ UNRECOGNIZED = -1,
+}
+
+export function auditLog_SeverityFromJSON(object: any): AuditLog_Severity {
+ switch (object) {
+ case 0:
+ case "DEFAULT":
+ return AuditLog_Severity.DEFAULT;
+ case 1:
+ case "DEBUG":
+ return AuditLog_Severity.DEBUG;
+ case 2:
+ case "INFO":
+ return AuditLog_Severity.INFO;
+ case 3:
+ case "NOTICE":
+ return AuditLog_Severity.NOTICE;
+ case 4:
+ case "WARNING":
+ return AuditLog_Severity.WARNING;
+ case 5:
+ case "ERROR":
+ return AuditLog_Severity.ERROR;
+ case 6:
+ case "CRITICAL":
+ return AuditLog_Severity.CRITICAL;
+ case 7:
+ case "ALERT":
+ return AuditLog_Severity.ALERT;
+ case 8:
+ case "EMERGENCY":
+ return AuditLog_Severity.EMERGENCY;
+ case -1:
+ case "UNRECOGNIZED":
+ default:
+ return AuditLog_Severity.UNRECOGNIZED;
+ }
+}
+
+export function auditLog_SeverityToJSON(object: AuditLog_Severity): string {
+ switch (object) {
+ case AuditLog_Severity.DEFAULT:
+ return "DEFAULT";
+ case AuditLog_Severity.DEBUG:
+ return "DEBUG";
+ case AuditLog_Severity.INFO:
+ return "INFO";
+ case AuditLog_Severity.NOTICE:
+ return "NOTICE";
+ case AuditLog_Severity.WARNING:
+ return "WARNING";
+ case AuditLog_Severity.ERROR:
+ return "ERROR";
+ case AuditLog_Severity.CRITICAL:
+ return "CRITICAL";
+ case AuditLog_Severity.ALERT:
+ return "ALERT";
+ case AuditLog_Severity.EMERGENCY:
+ return "EMERGENCY";
+ case AuditLog_Severity.UNRECOGNIZED:
+ default:
+ return "UNRECOGNIZED";
+ }
+}
+
+function createBaseSearchAuditLogsRequest(): SearchAuditLogsRequest {
+ return { filter: "", orderBy: "", pageSize: 0, pageToken: "" };
+}
+
+export const SearchAuditLogsRequest = {
+ encode(message: SearchAuditLogsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.filter !== "") {
+ writer.uint32(10).string(message.filter);
+ }
+ if (message.orderBy !== "") {
+ writer.uint32(18).string(message.orderBy);
+ }
+ if (message.pageSize !== 0) {
+ writer.uint32(24).int32(message.pageSize);
+ }
+ if (message.pageToken !== "") {
+ writer.uint32(34).string(message.pageToken);
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): SearchAuditLogsRequest {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseSearchAuditLogsRequest();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.filter = reader.string();
+ continue;
+ case 2:
+ if (tag !== 18) {
+ break;
+ }
+
+ message.orderBy = reader.string();
+ continue;
+ case 3:
+ if (tag !== 24) {
+ break;
+ }
+
+ message.pageSize = reader.int32();
+ continue;
+ case 4:
+ if (tag !== 34) {
+ break;
+ }
+
+ message.pageToken = reader.string();
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(object: any): SearchAuditLogsRequest {
+ return {
+ filter: isSet(object.filter) ? globalThis.String(object.filter) : "",
+ orderBy: isSet(object.orderBy) ? globalThis.String(object.orderBy) : "",
+ pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
+ pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
+ };
+ },
+
+ toJSON(message: SearchAuditLogsRequest): unknown {
+ const obj: any = {};
+ if (message.filter !== "") {
+ obj.filter = message.filter;
+ }
+ if (message.orderBy !== "") {
+ obj.orderBy = message.orderBy;
+ }
+ if (message.pageSize !== 0) {
+ obj.pageSize = Math.round(message.pageSize);
+ }
+ if (message.pageToken !== "") {
+ obj.pageToken = message.pageToken;
+ }
+ return obj;
+ },
+
+ create(base?: DeepPartial<SearchAuditLogsRequest>): SearchAuditLogsRequest {
+ return SearchAuditLogsRequest.fromPartial(base ?? {});
+ },
+ fromPartial(object: DeepPartial<SearchAuditLogsRequest>): SearchAuditLogsRequest {
+ const message = createBaseSearchAuditLogsRequest();
+ message.filter = object.filter ?? "";
+ message.orderBy = object.orderBy ?? "";
+ message.pageSize = object.pageSize ?? 0;
+ message.pageToken = object.pageToken ?? "";
+ return message;
+ },
+};
+
+function createBaseSearchAuditLogsResponse(): SearchAuditLogsResponse {
+ return { auditLogs: [], nextPageToken: "" };
+}
+
+export const SearchAuditLogsResponse = {
+ encode(message: SearchAuditLogsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ for (const v of message.auditLogs) {
+ AuditLog.encode(v!, writer.uint32(10).fork()).ldelim();
+ }
+ if (message.nextPageToken !== "") {
+ writer.uint32(18).string(message.nextPageToken);
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): SearchAuditLogsResponse {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseSearchAuditLogsResponse();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.auditLogs.push(AuditLog.decode(reader, reader.uint32()));
+ continue;
+ case 2:
+ if (tag !== 18) {
+ break;
+ }
+
+ message.nextPageToken = reader.string();
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(object: any): SearchAuditLogsResponse {
+ return {
+ auditLogs: globalThis.Array.isArray(object?.auditLogs)
+ ? object.auditLogs.map((e: any) => AuditLog.fromJSON(e))
+ : [],
+ nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
+ };
+ },
+
+ toJSON(message: SearchAuditLogsResponse): unknown {
+ const obj: any = {};
+ if (message.auditLogs?.length) {
+ obj.auditLogs = message.auditLogs.map((e) => AuditLog.toJSON(e));
+ }
+ if (message.nextPageToken !== "") {
+ obj.nextPageToken = message.nextPageToken;
+ }
+ return obj;
+ },
+
+ create(base?: DeepPartial<SearchAuditLogsResponse>): SearchAuditLogsResponse {
+ return SearchAuditLogsResponse.fromPartial(base ?? {});
+ },
+ fromPartial(object: DeepPartial<SearchAuditLogsResponse>): SearchAuditLogsResponse {
+ const message = createBaseSearchAuditLogsResponse();
+ message.auditLogs = object.auditLogs?.map((e) => AuditLog.fromPartial(e)) || [];
+ message.nextPageToken = object.nextPageToken ?? "";
+ return message;
+ },
+};
+
+function createBaseAuditLog(): AuditLog {
+ return {
+ name: "",
+ createTime: undefined,
+ user: "",
+ method: "",
+ severity: 0,
+ resource: "",
+ request: "",
+ response: "",
+ status: undefined,
+ };
+}
+
+export const AuditLog = {
+ encode(message: AuditLog, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.name !== "") {
+ writer.uint32(10).string(message.name);
+ }
+ if (message.createTime !== undefined) {
+ Timestamp.encode(toTimestamp(message.createTime), writer.uint32(18).fork()).ldelim();
+ }
+ if (message.user !== "") {
+ writer.uint32(26).string(message.user);
+ }
+ if (message.method !== "") {
+ writer.uint32(34).string(message.method);
+ }
+ if (message.severity !== 0) {
+ writer.uint32(40).int32(message.severity);
+ }
+ if (message.resource !== "") {
+ writer.uint32(50).string(message.resource);
+ }
+ if (message.request !== "") {
+ writer.uint32(58).string(message.request);
+ }
+ if (message.response !== "") {
+ writer.uint32(66).string(message.response);
+ }
+ if (message.status !== undefined) {
+ Status.encode(message.status, writer.uint32(74).fork()).ldelim();
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): AuditLog {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseAuditLog();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.name = reader.string();
+ continue;
+ case 2:
+ if (tag !== 18) {
+ break;
+ }
+
+ message.createTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
+ continue;
+ case 3:
+ if (tag !== 26) {
+ break;
+ }
+
+ message.user = reader.string();
+ continue;
+ case 4:
+ if (tag !== 34) {
+ break;
+ }
+
+ message.method = reader.string();
+ continue;
+ case 5:
+ if (tag !== 40) {
+ break;
+ }
+
+ message.severity = reader.int32() as any;
+ continue;
+ case 6:
+ if (tag !== 50) {
+ break;
+ }
+
+ message.resource = reader.string();
+ continue;
+ case 7:
+ if (tag !== 58) {
+ break;
+ }
+
+ message.request = reader.string();
+ continue;
+ case 8:
+ if (tag !== 66) {
+ break;
+ }
+
+ message.response = reader.string();
+ continue;
+ case 9:
+ if (tag !== 74) {
+ break;
+ }
+
+ message.status = Status.decode(reader, reader.uint32());
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(object: any): AuditLog {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ createTime: isSet(object.createTime) ? fromJsonTimestamp(object.createTime) : undefined,
+ user: isSet(object.user) ? globalThis.String(object.user) : "",
+ method: isSet(object.method) ? globalThis.String(object.method) : "",
+ severity: isSet(object.severity) ? auditLog_SeverityFromJSON(object.severity) : 0,
+ resource: isSet(object.resource) ? globalThis.String(object.resource) : "",
+ 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,
+ };
+ },
+
+ toJSON(message: AuditLog): unknown {
+ const obj: any = {};
+ if (message.name !== "") {
+ obj.name = message.name;
+ }
+ if (message.createTime !== undefined) {
+ obj.createTime = message.createTime.toISOString();
+ }
+ if (message.user !== "") {
+ obj.user = message.user;
+ }
+ if (message.method !== "") {
+ obj.method = message.method;
+ }
+ if (message.severity !== 0) {
+ obj.severity = auditLog_SeverityToJSON(message.severity);
+ }
+ if (message.resource !== "") {
+ obj.resource = message.resource;
+ }
+ if (message.request !== "") {
+ obj.request = message.request;
+ }
+ if (message.response !== "") {
+ obj.response = message.response;
+ }
+ if (message.status !== undefined) {
+ obj.status = Status.toJSON(message.status);
+ }
+ return obj;
+ },
+
+ create(base?: DeepPartial<AuditLog>): AuditLog {
+ return AuditLog.fromPartial(base ?? {});
+ },
+ fromPartial(object: DeepPartial<AuditLog>): AuditLog {
+ const message = createBaseAuditLog();
+ message.name = object.name ?? "";
+ message.createTime = object.createTime ?? undefined;
+ message.user = object.user ?? "";
+ message.method = object.method ?? "";
+ message.severity = object.severity ?? 0;
+ message.resource = object.resource ?? "";
+ message.request = object.request ?? "";
+ message.response = object.response ?? "";
+ message.status = (object.status !== undefined && object.status !== null)
+ ? Status.fromPartial(object.status)
+ : undefined;
+ return message;
+ },
+};
+
+export type AuditLogServiceDefinition = typeof AuditLogServiceDefinition;
+export const AuditLogServiceDefinition = {
+ name: "AuditLogService",
+ fullName: "bytebase.v1.AuditLogService",
+ methods: {
+ searchAuditLogs: {
+ name: "SearchAuditLogs",
+ requestType: SearchAuditLogsRequest,
+ requestStream: false,
+ responseType: SearchAuditLogsResponse,
+ responseStream: false,
+ options: {
+ _unknownFields: {
+ 578365826: [
+ new Uint8Array([17, 18, 15, 47, 118, 49, 47, 108, 111, 103, 115, 58, 115, 101, 97, 114, 99, 104]),
+ ],
+ },
+ },
+ },
+ },
+} as const;
+
+type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
+
+export type DeepPartial<T> = T extends Builtin ? T
+ : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
+ : Partial<T>;
+
+function toTimestamp(date: Date): Timestamp {
+ const seconds = numberToLong(date.getTime() / 1_000);
+ const nanos = (date.getTime() % 1_000) * 1_000_000;
+ return { seconds, nanos };
+}
+
+function fromTimestamp(t: Timestamp): Date {
+ let millis = (t.seconds.toNumber() || 0) * 1_000;
+ millis += (t.nanos || 0) / 1_000_000;
+ return new globalThis.Date(millis);
+}
+
+function fromJsonTimestamp(o: any): Date {
+ if (o instanceof globalThis.Date) {
+ return o;
+ } else if (typeof o === "string") {
+ return new globalThis.Date(o);
+ } else {
+ return fromTimestamp(Timestamp.fromJSON(o));
+ }
+}
+
+function numberToLong(number: number) {
+ return Long.fromNumber(number);
+}
+
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
+
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
diff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yaml
index 13b56ab75f..ed12d2ef5e 100644
--- a/proto/gen/grpc-doc/openapi.yaml
+++ b/proto/gen/grpc-doc/openapi.yaml
@@ -8151,6 +8151,41 @@ components:
Format: projects/{project}/issues/{issue}
comment:
type: string
+ AuditLog:
+ type: object
+ properties:
+ name:
+ readOnly: true
+ type: string
+ description: |-
+ The name of the log.
+ Format: logs/{uid}
+ createTime:
+ readOnly: true
+ type: string
+ format: date-time
+ user:
+ type: string
+ description: 'Format: users/[email protected]'
+ method:
+ type: string
+ description: e.g. `/bytebase.v1.SQLService/Query`, `bb.project.repository.push`
+ severity:
+ type: integer
+ format: enum
+ resource:
+ type: string
+ description: The associated resource.
+ request:
+ type: string
+ description: JSON-encoded request.
+ response:
+ type: string
+ description: |-
+ JSON-encoded response.
+ Some fields are omitted because they are too large or contain sensitive information.
+ status:
+ $ref: '#/components/schemas/Status'
BatchCancelTaskRunsRequest:
type: object
properties:
@@ -11670,6 +11705,19 @@ components:
description: |-
Not used. A token, which can be sent as `page_token` to retrieve the next page.
If this field is omitted, there are no subsequent pages.
+ SearchAuditLogsResponse:
+ type: object
+ properties:
+ auditLogs:
+ type: array
+ items:
+ $ref: '#/components/schemas/AuditLog'
+ nextPageToken:
+ type: string
+ description: |-
+ A token to retrieve next page of log entities.
+ Pass this value in the page_token field in the subsequent call
+ to retrieve the next page of log entities.
SearchDatabasesResponse:
type: object
properties:
@@ -13023,6 +13071,7 @@ components:
tags:
- name: ActuatorService
- name: AnomalyService
+ - name: AuditLogService
- name: AuthService
- name: BranchService
- name: CelService
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index f9dee3d989..4cd2594d9e 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -29,6 +29,15 @@
- [AnomalyService](#bytebase-v1-AnomalyService)
+- [v1/audit_log_service.proto](#v1_audit_log_service-proto)
+ - [AuditLog](#bytebase-v1-AuditLog)
+ - [SearchAuditLogsRequest](#bytebase-v1-SearchAuditLogsRequest)
+ - [SearchAuditLogsResponse](#bytebase-v1-SearchAuditLogsResponse)
+
+ - [AuditLog.Severity](#bytebase-v1-AuditLog-Severity)
+
+ - [AuditLogService](#bytebase-v1-AuditLogService)
+
- [v1/common.proto](#v1_common-proto)
- [Engine](#bytebase-v1-Engine)
- [ExportFormat](#bytebase-v1-ExportFormat)
@@ -982,6 +991,108 @@ DATABASE_CONNECTION is the anomaly type for database connection, e.g. the databa
+<a name="v1_audit_log_service-proto"></a>
+<p align="right"><a href="#top">Top</a></p>
+
+## v1/audit_log_service.proto
+
+
+
+<a name="bytebase-v1-AuditLog"></a>
+
+### AuditLog
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| name | [string](#string) | | The name of the log. Format: logs/{uid} |
+| create_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |
+| user | [string](#string) | | Format: users/[email protected] |
+| method | [string](#string) | | e.g. `/bytebase.v1.SQLService/Query`, `bb.project.repository.push` |
+| severity | [AuditLog.Severity](#bytebase-v1-AuditLog-Severity) | | |
+| resource | [string](#string) | | The associated resource. |
+| request | [string](#string) | | JSON-encoded request. |
+| 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) | | |
+
+
+
+
+
+
+<a name="bytebase-v1-SearchAuditLogsRequest"></a>
+
+### SearchAuditLogsRequest
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| filter | [string](#string) | | |
+| order_by | [string](#string) | | The order by of the log. Only support order by create_time. For example: - order_by = &#34;create_time asc&#34; - order_by = &#34;create_time desc&#34; |
+| page_size | [int32](#int32) | | The maximum number of logs to return. The service may return fewer than this value. If unspecified, at most 100 log entries will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000. |
+| page_token | [string](#string) | | A page token, received from a previous `SearchLogs` call. Provide this to retrieve the subsequent page. |
+
+
+
+
+
+
+<a name="bytebase-v1-SearchAuditLogsResponse"></a>
+
+### SearchAuditLogsResponse
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| audit_logs | [AuditLog](#bytebase-v1-AuditLog) | repeated | |
+| next_page_token | [string](#string) | | A token to retrieve next page of log entities. Pass this value in the page_token field in the subsequent call to retrieve the next page of log entities. |
+
+
+
+
+
+
+
+
+<a name="bytebase-v1-AuditLog-Severity"></a>
+
+### AuditLog.Severity
+
+
+| Name | Number | Description |
+| ---- | ------ | ----------- |
+| DEFAULT | 0 | |
+| DEBUG | 1 | |
+| INFO | 2 | |
+| NOTICE | 3 | |
+| WARNING | 4 | |
+| ERROR | 5 | |
+| CRITICAL | 6 | |
+| ALERT | 7 | |
+| EMERGENCY | 8 | |
+
+
+
+
+
+
+
+<a name="bytebase-v1-AuditLogService"></a>
+
+### AuditLogService
+
+
+| Method Name | Request Type | Response Type | Description |
+| ----------- | ------------ | ------------- | ------------|
+| SearchAuditLogs | [SearchAuditLogsRequest](#bytebase-v1-SearchAuditLogsRequest) | [SearchAuditLogsResponse](#bytebase-v1-SearchAuditLogsResponse) | |
+
+
+
+
+
<a name="v1_common-proto"></a>
<p align="right"><a href="#top">Top</a></p>
diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.html
index 4d934df4c9..b39c629659 100644
--- a/proto/gen/grpc-doc/v1/index.html
+++ b/proto/gen/grpc-doc/v1/index.html
@@ -272,6 +272,37 @@
</li>
+ <li>
+ <a href="#v1%2faudit_log_service.proto">v1/audit_log_service.proto</a>
+ <ul>
+
+ <li>
+ <a href="#bytebase.v1.AuditLog"><span class="badge">M</span>AuditLog</a>
+ </li>
+
+ <li>
+ <a href="#bytebase.v1.SearchAuditLogsRequest"><span class="badge">M</span>SearchAuditLogsRequest</a>
+ </li>
+
+ <li>
+ <a href="#bytebase.v1.SearchAuditLogsResponse"><span class="badge">M</span>SearchAuditLogsResponse</a>
+ </li>
+
+
+ <li>
+ <a href="#bytebase.v1.AuditLog.Severity"><span class="badge">E</span>AuditLog.Severity</a>
+ </li>
+
+
+
+ <li>
+ <a href="#bytebase.v1.AuditLogService"><span class="badge">S</span>AuditLogService</a>
+ </li>
+
+ </ul>
+ </li>
+
+
<li>
<a href="#v1%2fcommon.proto">v1/common.proto</a>
<ul>
@@ -3471,6 +3502,300 @@ e.g. the database schema had been changed without bytebase migration.</p></td>
+ <div class="file-heading">
+ <h2 id="v1/audit_log_service.proto">v1/audit_log_service.proto</h2><a href="#title">Top</a>
+ </div>
+ <p></p>
+
+
+ <h3 id="bytebase.v1.AuditLog">AuditLog</h3>
+ <p></p>
+
+
+ <table class="field-table">
+ <thead>
+ <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
+ </thead>
+ <tbody>
+
+ <tr>
+ <td>name</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>The name of the log.
+Format: logs/{uid} </p></td>
+ </tr>
+
+ <tr>
+ <td>create_time</td>
+ <td><a href="#google.protobuf.Timestamp">google.protobuf.Timestamp</a></td>
+ <td></td>
+ <td><p> </p></td>
+ </tr>
+
+ <tr>
+ <td>user</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>Format: users/[email protected] </p></td>
+ </tr>
+
+ <tr>
+ <td>method</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>e.g. `/bytebase.v1.SQLService/Query`, `bb.project.repository.push` </p></td>
+ </tr>
+
+ <tr>
+ <td>severity</td>
+ <td><a href="#bytebase.v1.AuditLog.Severity">AuditLog.Severity</a></td>
+ <td></td>
+ <td><p> </p></td>
+ </tr>
+
+ <tr>
+ <td>resource</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>The associated resource. </p></td>
+ </tr>
+
+ <tr>
+ <td>request</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>JSON-encoded request. </p></td>
+ </tr>
+
+ <tr>
+ <td>response</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>JSON-encoded response.
+Some fields are omitted because they are too large or contain sensitive information. </p></td>
+ </tr>
+
+ <tr>
+ <td>status</td>
+ <td><a href="#google.rpc.Status">google.rpc.Status</a></td>
+ <td></td>
+ <td><p> </p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+
+
+
+
+ <h3 id="bytebase.v1.SearchAuditLogsRequest">SearchAuditLogsRequest</h3>
+ <p></p>
+
+
+ <table class="field-table">
+ <thead>
+ <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
+ </thead>
+ <tbody>
+
+ <tr>
+ <td>filter</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p> </p></td>
+ </tr>
+
+ <tr>
+ <td>order_by</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>The order by of the log.
+Only support order by create_time.
+For example:
+ - order_by = &#34;create_time asc&#34;
+ - order_by = &#34;create_time desc&#34; </p></td>
+ </tr>
+
+ <tr>
+ <td>page_size</td>
+ <td><a href="#int32">int32</a></td>
+ <td></td>
+ <td><p>The maximum number of logs to return.
+The service may return fewer than this value.
+If unspecified, at most 100 log entries will be returned.
+The maximum value is 1000; values above 1000 will be coerced to 1000. </p></td>
+ </tr>
+
+ <tr>
+ <td>page_token</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>A page token, received from a previous `SearchLogs` call.
+Provide this to retrieve the subsequent page. </p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+
+
+
+
+ <h3 id="bytebase.v1.SearchAuditLogsResponse">SearchAuditLogsResponse</h3>
+ <p></p>
+
+
+ <table class="field-table">
+ <thead>
+ <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
+ </thead>
+ <tbody>
+
+ <tr>
+ <td>audit_logs</td>
+ <td><a href="#bytebase.v1.AuditLog">AuditLog</a></td>
+ <td>repeated</td>
+ <td><p> </p></td>
+ </tr>
+
+ <tr>
+ <td>next_page_token</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>A token to retrieve next page of log entities.
+Pass this value in the page_token field in the subsequent call
+to retrieve the next page of log entities. </p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+
+
+
+
+
+
+ <h3 id="bytebase.v1.AuditLog.Severity">AuditLog.Severity</h3>
+ <p></p>
+ <table class="enum-table">
+ <thead>
+ <tr><td>Name</td><td>Number</td><td>Description</td></tr>
+ </thead>
+ <tbody>
+
+ <tr>
+ <td>DEFAULT</td>
+ <td>0</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>DEBUG</td>
+ <td>1</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>INFO</td>
+ <td>2</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>NOTICE</td>
+ <td>3</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>WARNING</td>
+ <td>4</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>ERROR</td>
+ <td>5</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>CRITICAL</td>
+ <td>6</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>ALERT</td>
+ <td>7</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>EMERGENCY</td>
+ <td>8</td>
+ <td><p></p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+
+
+
+
+ <h3 id="bytebase.v1.AuditLogService">AuditLogService</h3>
+ <p></p>
+ <table class="enum-table">
+ <thead>
+ <tr><td>Method Name</td><td>Request Type</td><td>Response Type</td><td>Description</td></tr>
+ </thead>
+ <tbody>
+
+ <tr>
+ <td>SearchAuditLogs</td>
+ <td><a href="#bytebase.v1.SearchAuditLogsRequest">SearchAuditLogsRequest</a></td>
+ <td><a href="#bytebase.v1.SearchAuditLogsResponse">SearchAuditLogsResponse</a></td>
+ <td><p></p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+
+
+
+ <h4>Methods with HTTP bindings</h4>
+ <table>
+ <thead>
+ <tr>
+ <td>Method Name</td>
+ <td>Method</td>
+ <td>Pattern</td>
+ <td>Body</td>
+ </tr>
+ </thead>
+ <tbody>
+
+
+
+ <tr>
+ <td>SearchAuditLogs</td>
+ <td>GET</td>
+ <td>/v1/logs:search</td>
+ <td></td>
+ </tr>
+
+
+ </tbody>
+ </table>
+
+
+
+
<div class="file-heading">
<h2 id="v1/common.proto">v1/common.proto</h2><a href="#title">Top</a>
</div>
diff --git a/proto/generated-go/v1/audit_log_service.pb.go b/proto/generated-go/v1/audit_log_service.pb.go
new file mode 100644
index 0000000000..efdb6f8c42
--- /dev/null
+++ b/proto/generated-go/v1/audit_log_service.pb.go
@@ -0,0 +1,521 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// protoc-gen-go v1.33.0
+// protoc (unknown)
+// source: v1/audit_log_service.proto
+
+package v1
+
+import (
+ _ "google.golang.org/genproto/googleapis/api/annotations"
+ status "google.golang.org/genproto/googleapis/rpc/status"
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+ timestamppb "google.golang.org/protobuf/types/known/timestamppb"
+ reflect "reflect"
+ sync "sync"
+)
+
+const (
+ // Verify that this generated code is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+type AuditLog_Severity int32
+
+const (
+ AuditLog_DEFAULT AuditLog_Severity = 0
+ AuditLog_DEBUG AuditLog_Severity = 1
+ AuditLog_INFO AuditLog_Severity = 2
+ AuditLog_NOTICE AuditLog_Severity = 3
+ AuditLog_WARNING AuditLog_Severity = 4
+ AuditLog_ERROR AuditLog_Severity = 5
+ AuditLog_CRITICAL AuditLog_Severity = 6
+ AuditLog_ALERT AuditLog_Severity = 7
+ AuditLog_EMERGENCY AuditLog_Severity = 8
+)
+
+// Enum value maps for AuditLog_Severity.
+var (
+ AuditLog_Severity_name = map[int32]string{
+ 0: "DEFAULT",
+ 1: "DEBUG",
+ 2: "INFO",
+ 3: "NOTICE",
+ 4: "WARNING",
+ 5: "ERROR",
+ 6: "CRITICAL",
+ 7: "ALERT",
+ 8: "EMERGENCY",
+ }
+ AuditLog_Severity_value = map[string]int32{
+ "DEFAULT": 0,
+ "DEBUG": 1,
+ "INFO": 2,
+ "NOTICE": 3,
+ "WARNING": 4,
+ "ERROR": 5,
+ "CRITICAL": 6,
+ "ALERT": 7,
+ "EMERGENCY": 8,
+ }
+)
+
+func (x AuditLog_Severity) Enum() *AuditLog_Severity {
+ p := new(AuditLog_Severity)
+ *p = x
+ return p
+}
+
+func (x AuditLog_Severity) String() string {
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (AuditLog_Severity) Descriptor() protoreflect.EnumDescriptor {
+ return file_v1_audit_log_service_proto_enumTypes[0].Descriptor()
+}
+
+func (AuditLog_Severity) Type() protoreflect.EnumType {
+ return &file_v1_audit_log_service_proto_enumTypes[0]
+}
+
+func (x AuditLog_Severity) Number() protoreflect.EnumNumber {
+ return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use AuditLog_Severity.Descriptor instead.
+func (AuditLog_Severity) EnumDescriptor() ([]byte, []int) {
+ return file_v1_audit_log_service_proto_rawDescGZIP(), []int{2, 0}
+}
+
+type SearchAuditLogsRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ Filter string `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"`
+ // The order by of the log.
+ // Only support order by create_time.
+ // For example:
+ // - order_by = "create_time asc"
+ // - order_by = "create_time desc"
+ OrderBy string `protobuf:"bytes,2,opt,name=order_by,json=orderBy,proto3" json:"order_by,omitempty"`
+ // The maximum number of logs to return.
+ // The service may return fewer than this value.
+ // If unspecified, at most 100 log entries will be returned.
+ // The maximum value is 1000; values above 1000 will be coerced to 1000.
+ PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
+ // A page token, received from a previous `SearchLogs` call.
+ // Provide this to retrieve the subsequent page.
+ PageToken string `protobuf:"bytes,4,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
+}
+
+func (x *SearchAuditLogsRequest) Reset() {
+ *x = SearchAuditLogsRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_v1_audit_log_service_proto_msgTypes[0]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *SearchAuditLogsRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*SearchAuditLogsRequest) ProtoMessage() {}
+
+func (x *SearchAuditLogsRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_v1_audit_log_service_proto_msgTypes[0]
+ 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 SearchAuditLogsRequest.ProtoReflect.Descriptor instead.
+func (*SearchAuditLogsRequest) Descriptor() ([]byte, []int) {
+ return file_v1_audit_log_service_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *SearchAuditLogsRequest) GetFilter() string {
+ if x != nil {
+ return x.Filter
+ }
+ return ""
+}
+
+func (x *SearchAuditLogsRequest) GetOrderBy() string {
+ if x != nil {
+ return x.OrderBy
+ }
+ return ""
+}
+
+func (x *SearchAuditLogsRequest) GetPageSize() int32 {
+ if x != nil {
+ return x.PageSize
+ }
+ return 0
+}
+
+func (x *SearchAuditLogsRequest) GetPageToken() string {
+ if x != nil {
+ return x.PageToken
+ }
+ return ""
+}
+
+type SearchAuditLogsResponse struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ AuditLogs []*AuditLog `protobuf:"bytes,1,rep,name=audit_logs,json=auditLogs,proto3" json:"audit_logs,omitempty"`
+ // A token to retrieve next page of log entities.
+ // Pass this value in the page_token field in the subsequent call
+ // to retrieve the next page of log entities.
+ NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
+}
+
+func (x *SearchAuditLogsResponse) Reset() {
+ *x = SearchAuditLogsResponse{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_v1_audit_log_service_proto_msgTypes[1]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *SearchAuditLogsResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*SearchAuditLogsResponse) ProtoMessage() {}
+
+func (x *SearchAuditLogsResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_v1_audit_log_service_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 SearchAuditLogsResponse.ProtoReflect.Descriptor instead.
+func (*SearchAuditLogsResponse) Descriptor() ([]byte, []int) {
+ return file_v1_audit_log_service_proto_rawDescGZIP(), []int{1}
+}
+
+func (x *SearchAuditLogsResponse) GetAuditLogs() []*AuditLog {
+ if x != nil {
+ return x.AuditLogs
+ }
+ return nil
+}
+
+func (x *SearchAuditLogsResponse) GetNextPageToken() string {
+ if x != nil {
+ return x.NextPageToken
+ }
+ return ""
+}
+
+type AuditLog struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // The name of the log.
+ // Format: logs/{uid}
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+ CreateTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
+ // Format: users/[email protected]
+ User string `protobuf:"bytes,3,opt,name=user,proto3" json:"user,omitempty"`
+ // e.g. `/bytebase.v1.SQLService/Query`, `bb.project.repository.push`
+ Method string `protobuf:"bytes,4,opt,name=method,proto3" json:"method,omitempty"`
+ Severity AuditLog_Severity `protobuf:"varint,5,opt,name=severity,proto3,enum=bytebase.v1.AuditLog_Severity" json:"severity,omitempty"`
+ // The associated resource.
+ Resource string `protobuf:"bytes,6,opt,name=resource,proto3" json:"resource,omitempty"`
+ // JSON-encoded request.
+ Request string `protobuf:"bytes,7,opt,name=request,proto3" json:"request,omitempty"`
+ // JSON-encoded response.
+ // Some fields are omitted because they are too large or contain sensitive information.
+ Response string `protobuf:"bytes,8,opt,name=response,proto3" json:"response,omitempty"`
+ Status *status.Status `protobuf:"bytes,9,opt,name=status,proto3" json:"status,omitempty"`
+}
+
+func (x *AuditLog) Reset() {
+ *x = AuditLog{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_v1_audit_log_service_proto_msgTypes[2]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *AuditLog) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*AuditLog) ProtoMessage() {}
+
+func (x *AuditLog) ProtoReflect() protoreflect.Message {
+ mi := &file_v1_audit_log_service_proto_msgTypes[2]
+ 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 AuditLog.ProtoReflect.Descriptor instead.
+func (*AuditLog) Descriptor() ([]byte, []int) {
+ return file_v1_audit_log_service_proto_rawDescGZIP(), []int{2}
+}
+
+func (x *AuditLog) GetName() string {
+ if x != nil {
+ return x.Name
+ }
+ return ""
+}
+
+func (x *AuditLog) GetCreateTime() *timestamppb.Timestamp {
+ if x != nil {
+ return x.CreateTime
+ }
+ return nil
+}
+
+func (x *AuditLog) GetUser() string {
+ if x != nil {
+ return x.User
+ }
+ return ""
+}
+
+func (x *AuditLog) GetMethod() string {
+ if x != nil {
+ return x.Method
+ }
+ return ""
+}
+
+func (x *AuditLog) GetSeverity() AuditLog_Severity {
+ if x != nil {
+ return x.Severity
+ }
+ return AuditLog_DEFAULT
+}
+
+func (x *AuditLog) GetResource() string {
+ if x != nil {
+ return x.Resource
+ }
+ return ""
+}
+
+func (x *AuditLog) GetRequest() string {
+ if x != nil {
+ return x.Request
+ }
+ return ""
+}
+
+func (x *AuditLog) GetResponse() string {
+ if x != nil {
+ return x.Response
+ }
+ return ""
+}
+
+func (x *AuditLog) GetStatus() *status.Status {
+ if x != nil {
+ return x.Status
+ }
+ return nil
+}
+
+var File_v1_audit_log_service_proto protoreflect.FileDescriptor
+
+var file_v1_audit_log_service_proto_rawDesc = []byte{
+ 0x0a, 0x1a, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x64, 0x69, 0x74, 0x5f, 0x6c, 0x6f, 0x67, 0x5f, 0x73,
+ 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x62, 0x79,
+ 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
+ 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f,
+ 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69,
+ 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
+ 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74,
+ 0x61, 0x6d, 0x70, 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, 0x87, 0x01, 0x0a, 0x16, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x75, 0x64,
+ 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a,
+ 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66,
+ 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x62,
+ 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x42, 0x79,
+ 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20,
+ 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a,
+ 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28,
+ 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x77, 0x0a, 0x17,
+ 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x52,
+ 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x0a, 0x61, 0x75, 0x64, 0x69, 0x74,
+ 0x5f, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x62, 0x79,
+ 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x64, 0x69, 0x74, 0x4c,
+ 0x6f, 0x67, 0x52, 0x09, 0x61, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x12, 0x26, 0x0a,
+ 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e,
+ 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65,
+ 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xc5, 0x03, 0x0a, 0x08, 0x41, 0x75, 0x64, 0x69, 0x74, 0x4c,
+ 0x6f, 0x67, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
+ 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x40, 0x0a, 0x0b, 0x63,
+ 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b,
+ 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
+ 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41,
+ 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x12, 0x0a,
+ 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x73, 0x65,
+ 0x72, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28,
+ 0x09, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x3a, 0x0a, 0x08, 0x73, 0x65, 0x76,
+ 0x65, 0x72, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x62, 0x79,
+ 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 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, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63,
+ 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63,
+ 0x65, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x07, 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, 0x08, 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, 0x09, 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, 0x32, 0x88, 0x01,
+ 0x0a, 0x0f, 0x41, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
+ 0x65, 0x12, 0x75, 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,
+ 0x17, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x11, 0x12, 0x0f, 0x2f, 0x76, 0x31, 0x2f, 0x6c, 0x6f, 0x67,
+ 0x73, 0x3a, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 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 (
+ file_v1_audit_log_service_proto_rawDescOnce sync.Once
+ file_v1_audit_log_service_proto_rawDescData = file_v1_audit_log_service_proto_rawDesc
+)
+
+func file_v1_audit_log_service_proto_rawDescGZIP() []byte {
+ file_v1_audit_log_service_proto_rawDescOnce.Do(func() {
+ file_v1_audit_log_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_v1_audit_log_service_proto_rawDescData)
+ })
+ return file_v1_audit_log_service_proto_rawDescData
+}
+
+var file_v1_audit_log_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
+var file_v1_audit_log_service_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
+var file_v1_audit_log_service_proto_goTypes = []interface{}{
+ (AuditLog_Severity)(0), // 0: bytebase.v1.AuditLog.Severity
+ (*SearchAuditLogsRequest)(nil), // 1: bytebase.v1.SearchAuditLogsRequest
+ (*SearchAuditLogsResponse)(nil), // 2: bytebase.v1.SearchAuditLogsResponse
+ (*AuditLog)(nil), // 3: bytebase.v1.AuditLog
+ (*timestamppb.Timestamp)(nil), // 4: google.protobuf.Timestamp
+ (*status.Status)(nil), // 5: google.rpc.Status
+}
+var file_v1_audit_log_service_proto_depIdxs = []int32{
+ 3, // 0: bytebase.v1.SearchAuditLogsResponse.audit_logs:type_name -> bytebase.v1.AuditLog
+ 4, // 1: bytebase.v1.AuditLog.create_time:type_name -> google.protobuf.Timestamp
+ 0, // 2: bytebase.v1.AuditLog.severity:type_name -> bytebase.v1.AuditLog.Severity
+ 5, // 3: bytebase.v1.AuditLog.status:type_name -> google.rpc.Status
+ 1, // 4: bytebase.v1.AuditLogService.SearchAuditLogs:input_type -> bytebase.v1.SearchAuditLogsRequest
+ 2, // 5: bytebase.v1.AuditLogService.SearchAuditLogs:output_type -> bytebase.v1.SearchAuditLogsResponse
+ 5, // [5:6] is the sub-list for method output_type
+ 4, // [4:5] 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_v1_audit_log_service_proto_init() }
+func file_v1_audit_log_service_proto_init() {
+ if File_v1_audit_log_service_proto != nil {
+ return
+ }
+ if !protoimpl.UnsafeEnabled {
+ file_v1_audit_log_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*SearchAuditLogsRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_v1_audit_log_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*SearchAuditLogsResponse); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_v1_audit_log_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*AuditLog); 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{
+ File: protoimpl.DescBuilder{
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+ RawDescriptor: file_v1_audit_log_service_proto_rawDesc,
+ NumEnums: 1,
+ NumMessages: 3,
+ NumExtensions: 0,
+ NumServices: 1,
+ },
+ GoTypes: file_v1_audit_log_service_proto_goTypes,
+ DependencyIndexes: file_v1_audit_log_service_proto_depIdxs,
+ EnumInfos: file_v1_audit_log_service_proto_enumTypes,
+ MessageInfos: file_v1_audit_log_service_proto_msgTypes,
+ }.Build()
+ File_v1_audit_log_service_proto = out.File
+ file_v1_audit_log_service_proto_rawDesc = nil
+ file_v1_audit_log_service_proto_goTypes = nil
+ file_v1_audit_log_service_proto_depIdxs = nil
+}
diff --git a/proto/generated-go/v1/audit_log_service.pb.gw.go b/proto/generated-go/v1/audit_log_service.pb.gw.go
new file mode 100644
index 0000000000..ee4a496f3f
--- /dev/null
+++ b/proto/generated-go/v1/audit_log_service.pb.gw.go
@@ -0,0 +1,173 @@
+// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
+// source: v1/audit_log_service.proto
+
+/*
+Package v1 is a reverse proxy.
+
+It translates gRPC into RESTful JSON APIs.
+*/
+package v1
+
+import (
+ "context"
+ "io"
+ "net/http"
+
+ "github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
+ "github.com/grpc-ecosystem/grpc-gateway/v2/utilities"
+ "google.golang.org/grpc"
+ "google.golang.org/grpc/codes"
+ "google.golang.org/grpc/grpclog"
+ "google.golang.org/grpc/metadata"
+ "google.golang.org/grpc/status"
+ "google.golang.org/protobuf/proto"
+)
+
+// Suppress "imported and not used" errors
+var _ codes.Code
+var _ io.Reader
+var _ status.Status
+var _ = runtime.String
+var _ = utilities.NewDoubleArray
+var _ = metadata.Join
+
+var (
+ filter_AuditLogService_SearchAuditLogs_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
+)
+
+func request_AuditLogService_SearchAuditLogs_0(ctx context.Context, marshaler runtime.Marshaler, client AuditLogServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq SearchAuditLogsRequest
+ var metadata runtime.ServerMetadata
+
+ if err := req.ParseForm(); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AuditLogService_SearchAuditLogs_0); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := client.SearchAuditLogs(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+
+}
+
+func local_request_AuditLogService_SearchAuditLogs_0(ctx context.Context, marshaler runtime.Marshaler, server AuditLogServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq SearchAuditLogsRequest
+ var metadata runtime.ServerMetadata
+
+ if err := req.ParseForm(); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AuditLogService_SearchAuditLogs_0); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := server.SearchAuditLogs(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
+// RegisterAuditLogServiceHandlerServer registers the http handlers for service AuditLogService to "mux".
+// UnaryRPC :call AuditLogServiceServer directly.
+// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
+// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterAuditLogServiceHandlerFromEndpoint instead.
+func RegisterAuditLogServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AuditLogServiceServer) error {
+
+ mux.Handle("GET", pattern_AuditLogService_SearchAuditLogs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ var stream runtime.ServerTransportStream
+ ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ var err error
+ var annotatedContext context.Context
+ annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.AuditLogService/SearchAuditLogs", runtime.WithHTTPPathPattern("/v1/logs:search"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := local_request_AuditLogService_SearchAuditLogs_0(annotatedContext, inboundMarshaler, server, req, pathParams)
+ md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_AuditLogService_SearchAuditLogs_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ return nil
+}
+
+// RegisterAuditLogServiceHandlerFromEndpoint is same as RegisterAuditLogServiceHandler but
+// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
+func RegisterAuditLogServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
+ conn, err := grpc.DialContext(ctx, endpoint, opts...)
+ if err != nil {
+ return err
+ }
+ defer func() {
+ if err != nil {
+ if cerr := conn.Close(); cerr != nil {
+ grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
+ }
+ return
+ }
+ go func() {
+ <-ctx.Done()
+ if cerr := conn.Close(); cerr != nil {
+ grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
+ }
+ }()
+ }()
+
+ return RegisterAuditLogServiceHandler(ctx, mux, conn)
+}
+
+// RegisterAuditLogServiceHandler registers the http handlers for service AuditLogService to "mux".
+// The handlers forward requests to the grpc endpoint over "conn".
+func RegisterAuditLogServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
+ return RegisterAuditLogServiceHandlerClient(ctx, mux, NewAuditLogServiceClient(conn))
+}
+
+// RegisterAuditLogServiceHandlerClient registers the http handlers for service AuditLogService
+// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AuditLogServiceClient".
+// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AuditLogServiceClient"
+// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
+// "AuditLogServiceClient" to call the correct interceptors.
+func RegisterAuditLogServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AuditLogServiceClient) error {
+
+ mux.Handle("GET", pattern_AuditLogService_SearchAuditLogs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ var err error
+ var annotatedContext context.Context
+ annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.AuditLogService/SearchAuditLogs", runtime.WithHTTPPathPattern("/v1/logs:search"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := request_AuditLogService_SearchAuditLogs_0(annotatedContext, inboundMarshaler, client, req, pathParams)
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_AuditLogService_SearchAuditLogs_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ return nil
+}
+
+var (
+ pattern_AuditLogService_SearchAuditLogs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "logs"}, "search"))
+)
+
+var (
+ forward_AuditLogService_SearchAuditLogs_0 = runtime.ForwardResponseMessage
+)
diff --git a/proto/generated-go/v1/audit_log_service_grpc.pb.go b/proto/generated-go/v1/audit_log_service_grpc.pb.go
new file mode 100644
index 0000000000..54d6eb16b7
--- /dev/null
+++ b/proto/generated-go/v1/audit_log_service_grpc.pb.go
@@ -0,0 +1,109 @@
+// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
+// versions:
+// - protoc-gen-go-grpc v1.3.0
+// - protoc (unknown)
+// source: v1/audit_log_service.proto
+
+package v1
+
+import (
+ context "context"
+ grpc "google.golang.org/grpc"
+ codes "google.golang.org/grpc/codes"
+ status "google.golang.org/grpc/status"
+)
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the grpc package it is being compiled against.
+// Requires gRPC-Go v1.32.0 or later.
+const _ = grpc.SupportPackageIsVersion7
+
+const (
+ AuditLogService_SearchAuditLogs_FullMethodName = "/bytebase.v1.AuditLogService/SearchAuditLogs"
+)
+
+// AuditLogServiceClient is the client API for AuditLogService service.
+//
+// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
+type AuditLogServiceClient interface {
+ SearchAuditLogs(ctx context.Context, in *SearchAuditLogsRequest, opts ...grpc.CallOption) (*SearchAuditLogsResponse, error)
+}
+
+type auditLogServiceClient struct {
+ cc grpc.ClientConnInterface
+}
+
+func NewAuditLogServiceClient(cc grpc.ClientConnInterface) AuditLogServiceClient {
+ return &auditLogServiceClient{cc}
+}
+
+func (c *auditLogServiceClient) SearchAuditLogs(ctx context.Context, in *SearchAuditLogsRequest, opts ...grpc.CallOption) (*SearchAuditLogsResponse, error) {
+ out := new(SearchAuditLogsResponse)
+ err := c.cc.Invoke(ctx, AuditLogService_SearchAuditLogs_FullMethodName, in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+// AuditLogServiceServer is the server API for AuditLogService service.
+// All implementations must embed UnimplementedAuditLogServiceServer
+// for forward compatibility
+type AuditLogServiceServer interface {
+ SearchAuditLogs(context.Context, *SearchAuditLogsRequest) (*SearchAuditLogsResponse, error)
+ mustEmbedUnimplementedAuditLogServiceServer()
+}
+
+// UnimplementedAuditLogServiceServer must be embedded to have forward compatible implementations.
+type UnimplementedAuditLogServiceServer struct {
+}
+
+func (UnimplementedAuditLogServiceServer) SearchAuditLogs(context.Context, *SearchAuditLogsRequest) (*SearchAuditLogsResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method SearchAuditLogs not implemented")
+}
+func (UnimplementedAuditLogServiceServer) mustEmbedUnimplementedAuditLogServiceServer() {}
+
+// UnsafeAuditLogServiceServer may be embedded to opt out of forward compatibility for this service.
+// Use of this interface is not recommended, as added methods to AuditLogServiceServer will
+// result in compilation errors.
+type UnsafeAuditLogServiceServer interface {
+ mustEmbedUnimplementedAuditLogServiceServer()
+}
+
+func RegisterAuditLogServiceServer(s grpc.ServiceRegistrar, srv AuditLogServiceServer) {
+ s.RegisterService(&AuditLogService_ServiceDesc, srv)
+}
+
+func _AuditLogService_SearchAuditLogs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(SearchAuditLogsRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(AuditLogServiceServer).SearchAuditLogs(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: AuditLogService_SearchAuditLogs_FullMethodName,
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(AuditLogServiceServer).SearchAuditLogs(ctx, req.(*SearchAuditLogsRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+// AuditLogService_ServiceDesc is the grpc.ServiceDesc for AuditLogService service.
+// It's only intended for direct use with grpc.RegisterService,
+// and not to be introspected or modified (even as a copy)
+var AuditLogService_ServiceDesc = grpc.ServiceDesc{
+ ServiceName: "bytebase.v1.AuditLogService",
+ HandlerType: (*AuditLogServiceServer)(nil),
+ Methods: []grpc.MethodDesc{
+ {
+ MethodName: "SearchAuditLogs",
+ Handler: _AuditLogService_SearchAuditLogs_Handler,
+ },
+ },
+ Streams: []grpc.StreamDesc{},
+ Metadata: "v1/audit_log_service.proto",
+}
diff --git a/proto/v1/audit_log_service.proto b/proto/v1/audit_log_service.proto
new file mode 100644
index 0000000000..bbbbebffaf
--- /dev/null
+++ b/proto/v1/audit_log_service.proto
@@ -0,0 +1,86 @@
+syntax = "proto3";
+
+package bytebase.v1;
+
+import "google/api/annotations.proto";
+import "google/api/field_behavior.proto";
+import "google/protobuf/timestamp.proto";
+import "google/rpc/status.proto";
+
+option go_package = "generated-go/v1";
+
+service AuditLogService {
+ rpc SearchAuditLogs(SearchAuditLogsRequest) returns (SearchAuditLogsResponse) {
+ option (google.api.http) = {get: "/v1/logs:search"};
+ }
+}
+
+message SearchAuditLogsRequest {
+ string filter = 1;
+
+ // The order by of the log.
+ // Only support order by create_time.
+ // For example:
+ // - order_by = "create_time asc"
+ // - order_by = "create_time desc"
+ string order_by = 2;
+
+ // The maximum number of logs to return.
+ // The service may return fewer than this value.
+ // If unspecified, at most 100 log entries will be returned.
+ // The maximum value is 1000; values above 1000 will be coerced to 1000.
+ int32 page_size = 3;
+
+ // A page token, received from a previous `SearchLogs` call.
+ // Provide this to retrieve the subsequent page.
+ string page_token = 4;
+}
+
+message SearchAuditLogsResponse {
+ repeated AuditLog audit_logs = 1;
+
+ // A token to retrieve next page of log entities.
+ // Pass this value in the page_token field in the subsequent call
+ // to retrieve the next page of log entities.
+ string next_page_token = 2;
+}
+
+message AuditLog {
+ // The name of the log.
+ // Format: logs/{uid}
+ string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+ google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+ // Format: users/[email protected]
+ string user = 3;
+
+ // e.g. `/bytebase.v1.SQLService/Query`, `bb.project.repository.push`
+ string method = 4;
+
+ Severity severity = 5;
+
+ // The associated resource.
+ string resource = 6;
+
+ // JSON-encoded request.
+ string request = 7;
+
+ // JSON-encoded response.
+ // Some fields are omitted because they are too large or contain sensitive information.
+ string response = 8;
+
+ google.rpc.Status status = 9;
+
+ enum Severity {
+ DEFAULT = 0;
+ DEBUG = 1;
+ INFO = 2;
+ NOTICE = 3;
+ WARNING = 4;
+ ERROR = 5;
+ CRITICAL = 6;
+ ALERT = 7;
+ EMERGENCY = 8;
+ }
+}