Skip to content

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

chore: audit logs iam (#13069)

Danny Xued65e0334860
diff --git a/backend/api/v1/audit_log_service.go b/backend/api/v1/audit_log_service.go
index 95a62b757a..42f4e28cb2 100644
--- a/backend/api/v1/audit_log_service.go
+++ b/backend/api/v1/audit_log_service.go
@@ -58,21 +58,16 @@ func (s *AuditLogService) SearchAuditLogs(ctx context.Context, request *v1pb.Sea
}
limitPlusOne := limit + 1
- user, ok := ctx.Value(common.UserContextKey).(*store.UserMessage)
- if !ok {
- return nil, status.Errorf(codes.Internal, "failed to get user")
+ var project *string
+ if request.Parent != "" {
+ project = &request.Parent
}
- permissionFilter, serr := getSearchAuditLogsPermissionFilter(ctx, s.store, user, s.iamManager)
- if serr != nil {
- return nil, serr.Err()
- }
-
auditLogFind := &store.AuditLogFind{
- Limit: &limitPlusOne,
- Offset: &offset,
- Filter: filter,
- OrderByKeys: orderByKeys,
- PermissionFilter: permissionFilter,
+ Project: project,
+ Limit: &limitPlusOne,
+ Offset: &offset,
+ Filter: filter,
+ OrderByKeys: orderByKeys,
}
auditLogs, err := s.store.SearchAuditLogs(ctx, auditLogFind)
if err != nil {
@@ -278,7 +273,7 @@ func getSearchAuditLogsFilter(filter string) (*store.AuditLogFilter, *status.Sta
}
}
switch variable {
- case "resource", "parent", "method", "user", "severity":
+ case "resource", "method", "user", "severity":
default:
return "", errors.Errorf("unknown variable %s", variable)
}
@@ -361,21 +356,3 @@ func getSearchAuditLogsOrderByKeys(orderBy string) ([]store.OrderByKey, error) {
}
return orderByKeys, nil
}
-
-func getSearchAuditLogsPermissionFilter(ctx context.Context, s *store.Store, user *store.UserMessage, iamManager *iam.Manager) (*store.AuditLogPermissionFilter, *status.Status) {
- projectIDs, err := getProjectIDsWithPermission(ctx, s, user, iamManager, iam.PermissionAuditLogsGet)
- if err != nil {
- return nil, status.Newf(codes.Internal, "failed to get projectIDs with permission")
- }
- if projectIDs == nil {
- return nil, nil
- }
-
- var projects []string
- for _, p := range *projectIDs {
- projects = append(projects, common.FormatProject(p))
- }
- return &store.AuditLogPermissionFilter{
- Projects: projects,
- }, nil
-}
diff --git a/backend/component/iam/acl.yaml b/backend/component/iam/acl.yaml
index 149f56462a..3b7cfcffed 100644
--- a/backend/component/iam/acl.yaml
+++ b/backend/component/iam/acl.yaml
@@ -1,7 +1,8 @@
roles:
- name: roles/workspaceAdmin
permissions:
- - bb.auditLogs.get
+ - bb.auditLogs.export
+ - bb.auditLogs.search
- bb.branches.create
- bb.branches.delete
- bb.branches.get
@@ -122,7 +123,8 @@ roles:
- bb.worksheets.get
- name: roles/workspaceDBA
permissions:
- - bb.auditLogs.get
+ - bb.auditLogs.export
+ - bb.auditLogs.search
- bb.branches.create
- bb.branches.delete
- bb.branches.get
@@ -253,7 +255,8 @@ roles:
- bb.userGroups.list
- name: roles/projectOwner
permissions:
- - bb.auditLogs.get
+ - bb.auditLogs.export
+ - bb.auditLogs.search
- bb.branches.create
- bb.branches.delete
- bb.branches.get
diff --git a/backend/component/iam/permission.go b/backend/component/iam/permission.go
index 18470004f5..735432bb70 100644
--- a/backend/component/iam/permission.go
+++ b/backend/component/iam/permission.go
@@ -68,7 +68,8 @@ const (
PermissionWorksheetsManage Permission = "bb.worksheets.manage"
// Project-level permissions.
- PermissionAuditLogsGet Permission = "bb.auditLogs.get"
+ PermissionAuditLogsExport Permission = "bb.auditLogs.export"
+ PermissionAuditLogsSearch Permission = "bb.auditLogs.search"
PermissionBranchesCreate Permission = "bb.branches.create"
PermissionBranchesDelete Permission = "bb.branches.delete"
PermissionBranchesGet Permission = "bb.branches.get"
@@ -192,7 +193,8 @@ var allWorkspacePermissions = []Permission{
PermissionWorksheetsGet,
}
var allProjectPermissions = []Permission{
- PermissionAuditLogsGet,
+ PermissionAuditLogsExport,
+ PermissionAuditLogsSearch,
PermissionBranchesCreate,
PermissionBranchesDelete,
PermissionBranchesGet,
diff --git a/backend/component/iam/permission.yaml b/backend/component/iam/permission.yaml
index df7cfe287b..52ab6edee0 100644
--- a/backend/component/iam/permission.yaml
+++ b/backend/component/iam/permission.yaml
@@ -1,6 +1,7 @@
permissions:
projectPermissions:
- - bb.auditLogs.get
+ - bb.auditLogs.export
+ - bb.auditLogs.search
- bb.branches.create
- bb.branches.delete
- bb.branches.get
diff --git a/backend/store/audit_log.go b/backend/store/audit_log.go
index 2a27d2fb02..9a676a7664 100644
--- a/backend/store/audit_log.go
+++ b/backend/store/audit_log.go
@@ -29,20 +29,17 @@ type AuditLog struct {
}
type AuditLogFind struct {
- PermissionFilter *AuditLogPermissionFilter
- Filter *AuditLogFilter
- Limit *int
- Offset *int
- OrderByKeys []OrderByKey
+ Project *string
+ Filter *AuditLogFilter
+ Limit *int
+ Offset *int
+ OrderByKeys []OrderByKey
}
type AuditLogFilter struct {
Args []any
Where string
}
-type AuditLogPermissionFilter struct {
- Projects []string
-}
func (s *Store) CreateAuditLog(ctx context.Context, payload *storepb.AuditLog) error {
if !s.profile.DevelopmentAudit {
@@ -69,9 +66,9 @@ func (s *Store) SearchAuditLogs(ctx context.Context, find *AuditLogFind) ([]*Aud
where = append(where, v.Where)
args = append(args, v.Args...)
}
- if v := find.PermissionFilter; v != nil {
- where = append(where, fmt.Sprintf("payload->>'parent' = ANY($%d)", len(args)+1))
- args = append(args, v.Projects)
+ if v := find.Project; v != nil {
+ where = append(where, fmt.Sprintf("payload->>'parent' = $%d", len(args)+1))
+ args = append(args, *v)
}
query := fmt.Sprintf(`
diff --git a/frontend/src/store/modules/v1/auditLog.ts b/frontend/src/store/modules/v1/auditLog.ts
index 046bab978b..372f477fe4 100644
--- a/frontend/src/store/modules/v1/auditLog.ts
+++ b/frontend/src/store/modules/v1/auditLog.ts
@@ -12,9 +12,6 @@ dayjs.extend(utc);
const buildFilter = (search: SearchAuditLogsParams): string => {
const filter: string[] = [];
- if (search.parent) {
- filter.push(`parent == "${search.parent}"`);
- }
if (search.method) {
filter.push(`method == "${search.method}"`);
}
@@ -42,6 +39,7 @@ export const useAuditLogStore = defineStore("audit_log", () => {
const fetchAuditLogs = async (search: SearchAuditLogsParams) => {
const resp = await auditLogServiceClient.searchAuditLogs({
+ parent: search.parent,
filter: buildFilter(search),
orderBy: search.order ? `create_time ${search.order}` : undefined,
pageSize: search.pageSize,
@@ -60,6 +58,7 @@ export const useAuditLogStore = defineStore("audit_log", () => {
format: ExportFormat
) => {
const { content } = await auditLogServiceClient.exportAuditLogs({
+ parent: search.parent,
filter: buildFilter(search),
orderBy: search.order ? `create_time ${search.order}` : undefined,
format,
diff --git a/frontend/src/types/proto/v1/audit_log_service.ts b/frontend/src/types/proto/v1/audit_log_service.ts
index c7107717bb..e2187860d9 100644
--- a/frontend/src/types/proto/v1/audit_log_service.ts
+++ b/frontend/src/types/proto/v1/audit_log_service.ts
@@ -10,6 +10,7 @@ import { PolicyDelta } from "./iam_policy";
export const protobufPackage = "bytebase.v1";
export interface SearchAuditLogsRequest {
+ parent: string;
/**
* The filter of the log. It should be a valid CEL expression.
* For example:
@@ -52,6 +53,7 @@ export interface SearchAuditLogsResponse {
}
export interface ExportAuditLogsRequest {
+ parent: string;
/**
* The filter of the log. It should be a valid CEL expression.
* For example:
@@ -215,11 +217,14 @@ export interface AuditData {
}
function createBaseSearchAuditLogsRequest(): SearchAuditLogsRequest {
- return { filter: "", orderBy: "", pageSize: 0, pageToken: "" };
+ return { parent: "", filter: "", orderBy: "", pageSize: 0, pageToken: "" };
}
export const SearchAuditLogsRequest = {
encode(message: SearchAuditLogsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.parent !== "") {
+ writer.uint32(42).string(message.parent);
+ }
if (message.filter !== "") {
writer.uint32(10).string(message.filter);
}
@@ -242,6 +247,13 @@ export const SearchAuditLogsRequest = {
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
+ case 5:
+ if (tag !== 42) {
+ break;
+ }
+
+ message.parent = reader.string();
+ continue;
case 1:
if (tag !== 10) {
break;
@@ -281,6 +293,7 @@ export const SearchAuditLogsRequest = {
fromJSON(object: any): SearchAuditLogsRequest {
return {
+ parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
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,
@@ -290,6 +303,9 @@ export const SearchAuditLogsRequest = {
toJSON(message: SearchAuditLogsRequest): unknown {
const obj: any = {};
+ if (message.parent !== "") {
+ obj.parent = message.parent;
+ }
if (message.filter !== "") {
obj.filter = message.filter;
}
@@ -310,6 +326,7 @@ export const SearchAuditLogsRequest = {
},
fromPartial(object: DeepPartial<SearchAuditLogsRequest>): SearchAuditLogsRequest {
const message = createBaseSearchAuditLogsRequest();
+ message.parent = object.parent ?? "";
message.filter = object.filter ?? "";
message.orderBy = object.orderBy ?? "";
message.pageSize = object.pageSize ?? 0;
@@ -395,11 +412,14 @@ export const SearchAuditLogsResponse = {
};
function createBaseExportAuditLogsRequest(): ExportAuditLogsRequest {
- return { filter: "", orderBy: "", format: ExportFormat.FORMAT_UNSPECIFIED };
+ return { parent: "", filter: "", orderBy: "", format: ExportFormat.FORMAT_UNSPECIFIED };
}
export const ExportAuditLogsRequest = {
encode(message: ExportAuditLogsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.parent !== "") {
+ writer.uint32(34).string(message.parent);
+ }
if (message.filter !== "") {
writer.uint32(10).string(message.filter);
}
@@ -419,6 +439,13 @@ export const ExportAuditLogsRequest = {
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
+ case 4:
+ if (tag !== 34) {
+ break;
+ }
+
+ message.parent = reader.string();
+ continue;
case 1:
if (tag !== 10) {
break;
@@ -451,6 +478,7 @@ export const ExportAuditLogsRequest = {
fromJSON(object: any): ExportAuditLogsRequest {
return {
+ parent: isSet(object.parent) ? globalThis.String(object.parent) : "",
filter: isSet(object.filter) ? globalThis.String(object.filter) : "",
orderBy: isSet(object.orderBy) ? globalThis.String(object.orderBy) : "",
format: isSet(object.format) ? exportFormatFromJSON(object.format) : ExportFormat.FORMAT_UNSPECIFIED,
@@ -459,6 +487,9 @@ export const ExportAuditLogsRequest = {
toJSON(message: ExportAuditLogsRequest): unknown {
const obj: any = {};
+ if (message.parent !== "") {
+ obj.parent = message.parent;
+ }
if (message.filter !== "") {
obj.filter = message.filter;
}
@@ -476,6 +507,7 @@ export const ExportAuditLogsRequest = {
},
fromPartial(object: DeepPartial<ExportAuditLogsRequest>): ExportAuditLogsRequest {
const message = createBaseExportAuditLogsRequest();
+ message.parent = object.parent ?? "";
message.filter = object.filter ?? "";
message.orderBy = object.orderBy ?? "";
message.format = object.format ?? ExportFormat.FORMAT_UNSPECIFIED;
@@ -821,9 +853,14 @@ export const AuditLogServiceDefinition = {
responseStream: false,
options: {
_unknownFields: {
- 800016: [new Uint8Array([2])],
+ 800010: [
+ new Uint8Array([19, 98, 98, 46, 97, 117, 100, 105, 116, 76, 111, 103, 115, 46, 115, 101, 97, 114, 99, 104]),
+ ],
+ 800016: [new Uint8Array([1])],
578365826: [
new Uint8Array([
+ 66,
+ 90,
22,
18,
20,
@@ -847,6 +884,48 @@ export const AuditLogServiceDefinition = {
114,
99,
104,
+ 18,
+ 40,
+ 47,
+ 118,
+ 49,
+ 47,
+ 123,
+ 112,
+ 97,
+ 114,
+ 101,
+ 110,
+ 116,
+ 61,
+ 112,
+ 114,
+ 111,
+ 106,
+ 101,
+ 99,
+ 116,
+ 115,
+ 47,
+ 42,
+ 125,
+ 47,
+ 97,
+ 117,
+ 100,
+ 105,
+ 116,
+ 76,
+ 111,
+ 103,
+ 115,
+ 58,
+ 115,
+ 101,
+ 97,
+ 114,
+ 99,
+ 104,
]),
],
},
@@ -860,13 +939,39 @@ export const AuditLogServiceDefinition = {
responseStream: false,
options: {
_unknownFields: {
- 800016: [new Uint8Array([2])],
+ 800010: [
+ new Uint8Array([
+ 19,
+ 98,
+ 98,
+ 46,
+ 97,
+ 117,
+ 100,
+ 105,
+ 116,
+ 76,
+ 111,
+ 103,
+ 115,
+ 46,
+ 101,
+ 120,
+ 112,
+ 111,
+ 114,
+ 116,
+ ]),
+ ],
+ 800016: [new Uint8Array([1])],
578365826: [
new Uint8Array([
- 25,
+ 69,
58,
1,
42,
+ 90,
+ 22,
34,
20,
47,
@@ -889,6 +994,48 @@ export const AuditLogServiceDefinition = {
111,
114,
116,
+ 34,
+ 40,
+ 47,
+ 118,
+ 49,
+ 47,
+ 123,
+ 112,
+ 97,
+ 114,
+ 101,
+ 110,
+ 116,
+ 61,
+ 112,
+ 114,
+ 111,
+ 106,
+ 101,
+ 99,
+ 116,
+ 115,
+ 47,
+ 42,
+ 125,
+ 47,
+ 97,
+ 117,
+ 100,
+ 105,
+ 116,
+ 76,
+ 111,
+ 103,
+ 115,
+ 58,
+ 101,
+ 120,
+ 112,
+ 111,
+ 114,
+ 116,
]),
],
},
diff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yaml
index fc62c247f9..d6b0e0f1cd 100644
--- a/proto/gen/grpc-doc/openapi.yaml
+++ b/proto/gen/grpc-doc/openapi.yaml
@@ -174,12 +174,44 @@ paths:
tags:
- AuditLogService
operationId: AuditLogService_ExportAuditLogs
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ExportAuditLogsRequest'
- required: true
+ parameters:
+ - name: parent
+ in: query
+ schema:
+ type: string
+ - name: filter
+ in: query
+ description: |-
+ The filter of the log. It should be a valid CEL expression.
+ For example:
+ - filter = "method == '/bytebase.v1.SQLService/Query'"
+ - filter = "method == '/bytebase.v1.SQLService/Query' && severity == 'ERROR'"
+ - filter = "method == '/bytebase.v1.SQLService/Query' && severity == 'ERROR' && user == 'users/[email protected]'"
+ - filter = "method == '/bytebase.v1.SQLService/Query' && severity == 'ERROR' && create_time <= '2021-01-01T00:00:00Z' && create_time >= '2020-01-01T00:00:00Z'"
+ schema:
+ type: string
+ - name: orderBy
+ in: query
+ description: |-
+ The order by of the log.
+ Only support order by create_time.
+ For example:
+ - order_by = "create_time asc"
+ - order_by = "create_time desc"
+ schema:
+ type: string
+ - name: format
+ in: query
+ description: The export format.
+ schema:
+ enum:
+ - FORMAT_UNSPECIFIED
+ - CSV
+ - JSON
+ - SQL
+ - XLSX
+ type: string
+ format: enum
responses:
"200":
description: OK
@@ -199,6 +231,10 @@ paths:
- AuditLogService
operationId: AuditLogService_SearchAuditLogs
parameters:
+ - name: parent
+ in: query
+ schema:
+ type: string
- name: filter
in: query
description: |-
@@ -3469,6 +3505,100 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Status'
+ /v1/projects/{project}/auditLogs:export:
+ post:
+ tags:
+ - AuditLogService
+ operationId: AuditLogService_ExportAuditLogs
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ExportAuditLogsRequest'
+ required: true
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ExportAuditLogsResponse'
+ default:
+ description: Default error response
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Status'
+ /v1/projects/{project}/auditLogs:search:
+ get:
+ tags:
+ - AuditLogService
+ operationId: AuditLogService_SearchAuditLogs
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: filter
+ in: query
+ description: |-
+ The filter of the log. It should be a valid CEL expression.
+ For example:
+ - filter = "method == '/bytebase.v1.SQLService/Query'"
+ - filter = "method == '/bytebase.v1.SQLService/Query' && severity == 'ERROR'"
+ - filter = "method == '/bytebase.v1.SQLService/Query' && severity == 'ERROR' && user == 'users/[email protected]'"
+ - filter = "method == '/bytebase.v1.SQLService/Query' && severity == 'ERROR' && create_time <= '2021-01-01T00:00:00Z' && create_time >= '2020-01-01T00:00:00Z'"
+ schema:
+ type: string
+ - name: orderBy
+ in: query
+ description: |-
+ The order by of the log.
+ Only support order by create_time.
+ For example:
+ - order_by = "create_time asc"
+ - order_by = "create_time desc"
+ schema:
+ type: string
+ - name: pageSize
+ in: query
+ description: |-
+ 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.
+ schema:
+ type: integer
+ format: int32
+ - name: pageToken
+ in: query
+ description: |-
+ A page token, received from a previous `SearchLogs` call.
+ Provide this to retrieve the subsequent page.
+ schema:
+ type: string
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/SearchAuditLogsResponse'
+ default:
+ description: Default error response
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Status'
/v1/projects/{project}/branch:
post:
tags:
@@ -9806,8 +9936,12 @@ components:
description: The column number, starting from 0.
format: int32
ExportAuditLogsRequest:
+ required:
+ - parent
type: object
properties:
+ parent:
+ type: string
filter:
type: string
description: |-
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index 0bc8d26dcf..1895a1f98f 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -1354,6 +1354,7 @@ The type of action performed on a Binding in a policy.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
+| parent | [string](#string) | | |
| filter | [string](#string) | | The filter of the log. It should be a valid CEL expression. For example: - filter = &#34;method == &#39;/bytebase.v1.SQLService/Query&#39;&#34; - filter = &#34;method == &#39;/bytebase.v1.SQLService/Query&#39; &amp;&amp; severity == &#39;ERROR&#39;&#34; - filter = &#34;method == &#39;/bytebase.v1.SQLService/Query&#39; &amp;&amp; severity == &#39;ERROR&#39; &amp;&amp; user == &#39;users/[email protected]&#39;&#34; - filter = &#34;method == &#39;/bytebase.v1.SQLService/Query&#39; &amp;&amp; severity == &#39;ERROR&#39; &amp;&amp; create_time &lt;= &#39;2021-01-01T00:00:00Z&#39; &amp;&amp; create_time &gt;= &#39;2020-01-01T00:00:00Z&#39;&#34; |
| 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; |
| format | [ExportFormat](#bytebase-v1-ExportFormat) | | The export format. |
@@ -1386,6 +1387,7 @@ The type of action performed on a Binding in a policy.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
+| parent | [string](#string) | | |
| filter | [string](#string) | | The filter of the log. It should be a valid CEL expression. For example: - filter = &#34;method == &#39;/bytebase.v1.SQLService/Query&#39;&#34; - filter = &#34;method == &#39;/bytebase.v1.SQLService/Query&#39; &amp;&amp; severity == &#39;ERROR&#39;&#34; - filter = &#34;method == &#39;/bytebase.v1.SQLService/Query&#39; &amp;&amp; severity == &#39;ERROR&#39; &amp;&amp; user == &#39;users/[email protected]&#39;&#34; - filter = &#34;method == &#39;/bytebase.v1.SQLService/Query&#39; &amp;&amp; severity == &#39;ERROR&#39; &amp;&amp; create_time &lt;= &#39;2021-01-01T00:00:00Z&#39; &amp;&amp; create_time &gt;= &#39;2020-01-01T00:00:00Z&#39;&#34; |
| 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. |
diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.html
index ed08112d3b..2c55bbc130 100644
--- a/proto/gen/grpc-doc/v1/index.html
+++ b/proto/gen/grpc-doc/v1/index.html
@@ -4457,6 +4457,13 @@ Some fields are omitted because they are too large or contain sensitive informat
</thead>
<tbody>
+ <tr>
+ <td>parent</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p> </p></td>
+ </tr>
+
<tr>
<td>filter</td>
<td><a href="#string">string</a></td>
@@ -4528,6 +4535,13 @@ For example:
</thead>
<tbody>
+ <tr>
+ <td>parent</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p> </p></td>
+ </tr>
+
<tr>
<td>filter</td>
<td><a href="#string">string</a></td>
@@ -4722,6 +4736,13 @@ to retrieve the next page of log entities. </p></td>
+ <tr>
+ <td>SearchAuditLogs</td>
+ <td>GET</td>
+ <td>/v1/{parent=projects/*}/auditLogs:search</td>
+ <td></td>
+ </tr>
+
<tr>
<td>SearchAuditLogs</td>
<td>GET</td>
@@ -4735,10 +4756,17 @@ to retrieve the next page of log entities. </p></td>
<tr>
<td>ExportAuditLogs</td>
<td>POST</td>
- <td>/v1/auditLogs:export</td>
+ <td>/v1/{parent=projects/*}/auditLogs:export</td>
<td>*</td>
</tr>
+ <tr>
+ <td>ExportAuditLogs</td>
+ <td>POST</td>
+ <td>/v1/auditLogs:export</td>
+ <td></td>
+ </tr>
+
</tbody>
</table>
diff --git a/proto/generated-go/v1/audit_log_service.pb.go b/proto/generated-go/v1/audit_log_service.pb.go
index ce167b6a46..a344d0f006 100644
--- a/proto/generated-go/v1/audit_log_service.pb.go
+++ b/proto/generated-go/v1/audit_log_service.pb.go
@@ -96,6 +96,7 @@ type SearchAuditLogsRequest struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
+ Parent string `protobuf:"bytes,5,opt,name=parent,proto3" json:"parent,omitempty"`
// The filter of the log. It should be a valid CEL expression.
// For example:
// - filter = "method == '/bytebase.v1.SQLService/Query'"
@@ -151,6 +152,13 @@ func (*SearchAuditLogsRequest) Descriptor() ([]byte, []int) {
return file_v1_audit_log_service_proto_rawDescGZIP(), []int{0}
}
+func (x *SearchAuditLogsRequest) GetParent() string {
+ if x != nil {
+ return x.Parent
+ }
+ return ""
+}
+
func (x *SearchAuditLogsRequest) GetFilter() string {
if x != nil {
return x.Filter
@@ -242,6 +250,7 @@ type ExportAuditLogsRequest struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
+ Parent string `protobuf:"bytes,4,opt,name=parent,proto3" json:"parent,omitempty"`
// The filter of the log. It should be a valid CEL expression.
// For example:
// - filter = "method == '/bytebase.v1.SQLService/Query'"
@@ -291,6 +300,13 @@ func (*ExportAuditLogsRequest) Descriptor() ([]byte, []int) {
return file_v1_audit_log_service_proto_rawDescGZIP(), []int{2}
}
+func (x *ExportAuditLogsRequest) GetParent() string {
+ if x != nil {
+ return x.Parent
+ }
+ return ""
+}
+
func (x *ExportAuditLogsRequest) GetFilter() string {
if x != nil {
return x.Filter
@@ -546,98 +562,116 @@ var file_v1_audit_log_service_proto_rawDesc = []byte{
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, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
- 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x1a, 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, 0x1a, 0x13, 0x76,
- 0x31, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f,
- 0x74, 0x6f, 0x1a, 0x0f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x76, 0x31, 0x2f, 0x69, 0x61, 0x6d, 0x5f, 0x70, 0x6f, 0x6c, 0x69,
- 0x63, 0x79, 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, 0x7e, 0x0a, 0x16, 0x45,
- 0x78, 0x70, 0x6f, 0x72, 0x74, 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, 0x31, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d,
- 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
- 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x46, 0x6f, 0x72,
- 0x6d, 0x61, 0x74, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x22, 0x33, 0x0a, 0x17, 0x45,
- 0x78, 0x70, 0x6f, 0x72, 0x74, 0x41, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65,
- 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e,
- 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74,
- 0x22, 0x80, 0x04, 0x0a, 0x08, 0x41, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x12, 0x18, 0x0a,
- 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01,
- 0x03, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x41, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74,
- 0x65, 0x5f, 0x74, 0x69, 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, 0x04, 0xe2, 0x41, 0x01, 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,
- 0x12, 0x37, 0x0a, 0x0c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61,
- 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
- 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0b, 0x73, 0x65,
- 0x72, 0x76, 0x69, 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x22, 0x78, 0x0a, 0x08, 0x53, 0x65, 0x76,
- 0x65, 0x72, 0x69, 0x74, 0x79, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54,
- 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x44, 0x45, 0x42, 0x55, 0x47, 0x10, 0x01, 0x12, 0x08, 0x0a,
- 0x04, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x4f, 0x54, 0x49, 0x43,
- 0x45, 0x10, 0x03, 0x12, 0x0b, 0x0a, 0x07, 0x57, 0x41, 0x52, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x04,
- 0x12, 0x09, 0x0a, 0x05, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x05, 0x12, 0x0c, 0x0a, 0x08, 0x43,
- 0x52, 0x49, 0x54, 0x49, 0x43, 0x41, 0x4c, 0x10, 0x06, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x4c, 0x45,
- 0x52, 0x54, 0x10, 0x07, 0x12, 0x0d, 0x0a, 0x09, 0x45, 0x4d, 0x45, 0x52, 0x47, 0x45, 0x4e, 0x43,
- 0x59, 0x10, 0x08, 0x22, 0x48, 0x0a, 0x09, 0x41, 0x75, 0x64, 0x69, 0x74, 0x44, 0x61, 0x74, 0x61,
- 0x12, 0x3b, 0x0a, 0x0c, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x64, 0x65, 0x6c, 0x74, 0x61,
- 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
- 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x44, 0x65, 0x6c, 0x74, 0x61,
- 0x52, 0x0b, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x44, 0x65, 0x6c, 0x74, 0x61, 0x32, 0x95, 0x02,
- 0x0a, 0x0f, 0x41, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
- 0x65, 0x12, 0x7e, 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,
- 0x20, 0x90, 0xea, 0x30, 0x02, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x12, 0x14, 0x2f, 0x76, 0x31,
+ 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72,
+ 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74,
+ 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 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, 0x1a, 0x13, 0x76, 0x31, 0x2f, 0x61, 0x6e, 0x6e,
+ 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0f, 0x76,
+ 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13,
+ 0x76, 0x31, 0x2f, 0x69, 0x61, 0x6d, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x70, 0x72,
+ 0x6f, 0x74, 0x6f, 0x22, 0xbf, 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, 0x36,
+ 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1e,
+ 0xe2, 0x41, 0x01, 0x02, 0xfa, 0x41, 0x17, 0x12, 0x15, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
+ 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x41, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x52, 0x06,
+ 0x70, 0x61, 0x72, 0x65, 0x6e, 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, 0xb6,
+ 0x01, 0x0a, 0x16, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x41, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f,
+ 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x36, 0x0a, 0x06, 0x70, 0x61, 0x72,
+ 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1e, 0xe2, 0x41, 0x01, 0x02, 0xfa,
+ 0x41, 0x17, 0x12, 0x15, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d,
+ 0x2f, 0x41, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e,
+ 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, 0x31, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x03,
+ 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
+ 0x76, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x52,
+ 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x22, 0x33, 0x0a, 0x17, 0x45, 0x78, 0x70, 0x6f, 0x72,
+ 0x74, 0x41, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
+ 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20,
+ 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x80, 0x04, 0x0a,
+ 0x08, 0x41, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x12, 0x18, 0x0a, 0x04, 0x6e, 0x61, 0x6d,
+ 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x03, 0x52, 0x04, 0x6e,
+ 0x61, 0x6d, 0x65, 0x12, 0x41, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69,
+ 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, 0x04, 0xe2, 0x41, 0x01, 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, 0x12, 0x37, 0x0a, 0x0c,
+ 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0a, 0x20, 0x01,
+ 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
+ 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63,
+ 0x65, 0x44, 0x61, 0x74, 0x61, 0x22, 0x78, 0x0a, 0x08, 0x53, 0x65, 0x76, 0x65, 0x72, 0x69, 0x74,
+ 0x79, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0x00, 0x12, 0x09,
+ 0x0a, 0x05, 0x44, 0x45, 0x42, 0x55, 0x47, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x4e, 0x46,
+ 0x4f, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x4f, 0x54, 0x49, 0x43, 0x45, 0x10, 0x03, 0x12,
+ 0x0b, 0x0a, 0x07, 0x57, 0x41, 0x52, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x04, 0x12, 0x09, 0x0a, 0x05,
+ 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x05, 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x52, 0x49, 0x54, 0x49,
+ 0x43, 0x41, 0x4c, 0x10, 0x06, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x4c, 0x45, 0x52, 0x54, 0x10, 0x07,
+ 0x12, 0x0d, 0x0a, 0x09, 0x45, 0x4d, 0x45, 0x52, 0x47, 0x45, 0x4e, 0x43, 0x59, 0x10, 0x08, 0x22,
+ 0x48, 0x0a, 0x09, 0x41, 0x75, 0x64, 0x69, 0x74, 0x44, 0x61, 0x74, 0x61, 0x12, 0x3b, 0x0a, 0x0c,
+ 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x64, 0x65, 0x6c, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01,
+ 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,
+ 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x44, 0x65, 0x6c, 0x74, 0x61, 0x52, 0x0b, 0x70, 0x6f,
+ 0x6c, 0x69, 0x63, 0x79, 0x44, 0x65, 0x6c, 0x74, 0x61, 0x32, 0x9c, 0x03, 0x0a, 0x0f, 0x41, 0x75,
+ 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xc1, 0x01,
+ 0x0a, 0x0f, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67,
+ 0x73, 0x12, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
+ 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x52,
+ 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
+ 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x75, 0x64, 0x69, 0x74,
+ 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x63, 0x8a, 0xea,
+ 0x30, 0x13, 0x62, 0x62, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x2e, 0x73,
+ 0x65, 0x61, 0x72, 0x63, 0x68, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x42, 0x5a,
+ 0x16, 0x12, 0x14, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x73,
+ 0x3a, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x28, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61,
+ 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d,
0x2f, 0x61, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x3a, 0x73, 0x65, 0x61, 0x72, 0x63,
- 0x68, 0x12, 0x81, 0x01, 0x0a, 0x0f, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x41, 0x75, 0x64, 0x69,
+ 0x68, 0x12, 0xc4, 0x01, 0x0a, 0x0f, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x41, 0x75, 0x64, 0x69,
0x74, 0x4c, 0x6f, 0x67, 0x73, 0x12, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x41, 0x75, 0x64, 0x69, 0x74, 0x4c,
0x6f, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x62, 0x79, 0x74,
0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x41,
0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
- 0x22, 0x23, 0x90, 0xea, 0x30, 0x02, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x3a, 0x01, 0x2a, 0x22,
- 0x14, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x3a, 0x65,
- 0x78, 0x70, 0x6f, 0x72, 0x74, 0x42, 0x11, 0x5a, 0x0f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,
- 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+ 0x22, 0x66, 0x8a, 0xea, 0x30, 0x13, 0x62, 0x62, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f,
+ 0x67, 0x73, 0x2e, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4,
+ 0x93, 0x02, 0x45, 0x3a, 0x01, 0x2a, 0x5a, 0x16, 0x22, 0x14, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75,
+ 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x3a, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x22, 0x28,
+ 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a,
+ 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x61, 0x75, 0x64, 0x69, 0x74, 0x4c, 0x6f, 0x67,
+ 0x73, 0x3a, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x42, 0x11, 0x5a, 0x0f, 0x67, 0x65, 0x6e, 0x65,
+ 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f,
+ 0x74, 0x6f, 0x33,
}
var (
diff --git a/proto/generated-go/v1/audit_log_service.pb.gw.go b/proto/generated-go/v1/audit_log_service.pb.gw.go
index 5d17e1c4dd..ca1ef69390 100644
--- a/proto/generated-go/v1/audit_log_service.pb.gw.go
+++ b/proto/generated-go/v1/audit_log_service.pb.gw.go
@@ -32,13 +32,30 @@ var _ = utilities.NewDoubleArray
var _ = metadata.Join
var (
- filter_AuditLogService_SearchAuditLogs_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
+ filter_AuditLogService_SearchAuditLogs_0 = &utilities.DoubleArray{Encoding: map[string]int{"parent": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
)
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
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["parent"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent")
+ }
+
+ protoReq.Parent, err = runtime.String(val)
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err)
+ }
+
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
@@ -55,6 +72,23 @@ func local_request_AuditLogService_SearchAuditLogs_0(ctx context.Context, marsha
var protoReq SearchAuditLogsRequest
var metadata runtime.ServerMetadata
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["parent"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent")
+ }
+
+ protoReq.Parent, err = runtime.String(val)
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err)
+ }
+
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
@@ -67,6 +101,42 @@ func local_request_AuditLogService_SearchAuditLogs_0(ctx context.Context, marsha
}
+var (
+ filter_AuditLogService_SearchAuditLogs_1 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
+)
+
+func request_AuditLogService_SearchAuditLogs_1(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_1); 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_1(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_1); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := server.SearchAuditLogs(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
func request_AuditLogService_ExportAuditLogs_0(ctx context.Context, marshaler runtime.Marshaler, client AuditLogServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ExportAuditLogsRequest
var metadata runtime.ServerMetadata
@@ -75,6 +145,23 @@ func request_AuditLogService_ExportAuditLogs_0(ctx context.Context, marshaler ru
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["parent"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent")
+ }
+
+ protoReq.Parent, err = runtime.String(val)
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err)
+ }
+
msg, err := client.ExportAuditLogs(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
@@ -88,6 +175,59 @@ func local_request_AuditLogService_ExportAuditLogs_0(ctx context.Context, marsha
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["parent"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent")
+ }
+
+ protoReq.Parent, err = runtime.String(val)
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err)
+ }
+
+ msg, err := server.ExportAuditLogs(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
+var (
+ filter_AuditLogService_ExportAuditLogs_1 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
+)
+
+func request_AuditLogService_ExportAuditLogs_1(ctx context.Context, marshaler runtime.Marshaler, client AuditLogServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq ExportAuditLogsRequest
+ 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_ExportAuditLogs_1); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := client.ExportAuditLogs(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+
+}
+
+func local_request_AuditLogService_ExportAuditLogs_1(ctx context.Context, marshaler runtime.Marshaler, server AuditLogServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq ExportAuditLogsRequest
+ 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_ExportAuditLogs_1); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
msg, err := server.ExportAuditLogs(ctx, &protoReq)
return msg, metadata, err
@@ -107,7 +247,7 @@ func RegisterAuditLogServiceHandlerServer(ctx context.Context, mux *runtime.Serv
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/auditLogs:search"))
+ annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.AuditLogService/SearchAuditLogs", runtime.WithHTTPPathPattern("/v1/{parent=projects/*}/auditLogs:search"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@@ -124,6 +264,31 @@ func RegisterAuditLogServiceHandlerServer(ctx context.Context, mux *runtime.Serv
})
+ mux.Handle("GET", pattern_AuditLogService_SearchAuditLogs_1, 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/auditLogs:search"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := local_request_AuditLogService_SearchAuditLogs_1(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_1(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
mux.Handle("POST", pattern_AuditLogService_ExportAuditLogs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -132,7 +297,7 @@ func RegisterAuditLogServiceHandlerServer(ctx context.Context, mux *runtime.Serv
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
- annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.AuditLogService/ExportAuditLogs", runtime.WithHTTPPathPattern("/v1/auditLogs:export"))
+ annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.AuditLogService/ExportAuditLogs", runtime.WithHTTPPathPattern("/v1/{parent=projects/*}/auditLogs:export"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@@ -149,6 +314,31 @@ func RegisterAuditLogServiceHandlerServer(ctx context.Context, mux *runtime.Serv
})
+ mux.Handle("POST", pattern_AuditLogService_ExportAuditLogs_1, 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/ExportAuditLogs", runtime.WithHTTPPathPattern("/v1/auditLogs:export"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := local_request_AuditLogService_ExportAuditLogs_1(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_ExportAuditLogs_1(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
return nil
}
@@ -196,7 +386,7 @@ func RegisterAuditLogServiceHandlerClient(ctx context.Context, mux *runtime.Serv
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/auditLogs:search"))
+ annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.AuditLogService/SearchAuditLogs", runtime.WithHTTPPathPattern("/v1/{parent=projects/*}/auditLogs:search"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@@ -212,13 +402,35 @@ func RegisterAuditLogServiceHandlerClient(ctx context.Context, mux *runtime.Serv
})
+ mux.Handle("GET", pattern_AuditLogService_SearchAuditLogs_1, 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/auditLogs:search"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := request_AuditLogService_SearchAuditLogs_1(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_1(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
mux.Handle("POST", pattern_AuditLogService_ExportAuditLogs_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/ExportAuditLogs", runtime.WithHTTPPathPattern("/v1/auditLogs:export"))
+ annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.AuditLogService/ExportAuditLogs", runtime.WithHTTPPathPattern("/v1/{parent=projects/*}/auditLogs:export"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
@@ -234,17 +446,47 @@ func RegisterAuditLogServiceHandlerClient(ctx context.Context, mux *runtime.Serv
})
+ mux.Handle("POST", pattern_AuditLogService_ExportAuditLogs_1, 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/ExportAuditLogs", runtime.WithHTTPPathPattern("/v1/auditLogs:export"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := request_AuditLogService_ExportAuditLogs_1(annotatedContext, inboundMarshaler, client, req, pathParams)
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_AuditLogService_ExportAuditLogs_1(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", "auditLogs"}, "search"))
+ pattern_AuditLogService_SearchAuditLogs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2, 2, 3}, []string{"v1", "projects", "parent", "auditLogs"}, "search"))
+
+ pattern_AuditLogService_SearchAuditLogs_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "auditLogs"}, "search"))
+
+ pattern_AuditLogService_ExportAuditLogs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2, 2, 3}, []string{"v1", "projects", "parent", "auditLogs"}, "export"))
- pattern_AuditLogService_ExportAuditLogs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "auditLogs"}, "export"))
+ pattern_AuditLogService_ExportAuditLogs_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "auditLogs"}, "export"))
)
var (
forward_AuditLogService_SearchAuditLogs_0 = runtime.ForwardResponseMessage
+ forward_AuditLogService_SearchAuditLogs_1 = runtime.ForwardResponseMessage
+
forward_AuditLogService_ExportAuditLogs_0 = runtime.ForwardResponseMessage
+
+ forward_AuditLogService_ExportAuditLogs_1 = runtime.ForwardResponseMessage
)
diff --git a/proto/v1/audit_log_service.proto b/proto/v1/audit_log_service.proto
index c31152a6b0..ab51834a2e 100644
--- a/proto/v1/audit_log_service.proto
+++ b/proto/v1/audit_log_service.proto
@@ -4,6 +4,7 @@ package bytebase.v1;
import "google/api/annotations.proto";
import "google/api/field_behavior.proto";
+import "google/api/resource.proto";
import "google/protobuf/any.proto";
import "google/protobuf/timestamp.proto";
import "google/rpc/status.proto";
@@ -15,19 +16,30 @@ option go_package = "generated-go/v1";
service AuditLogService {
rpc SearchAuditLogs(SearchAuditLogsRequest) returns (SearchAuditLogsResponse) {
- option (google.api.http) = {get: "/v1/auditLogs:search"};
- option (bytebase.v1.auth_method) = CUSTOM;
+ option (google.api.http) = {
+ get: "/v1/{parent=projects/*}/auditLogs:search"
+ additional_bindings: {get: "/v1/auditLogs:search"}
+ };
+ option (bytebase.v1.permission) = "bb.auditLogs.search";
+ option (bytebase.v1.auth_method) = IAM;
}
rpc ExportAuditLogs(ExportAuditLogsRequest) returns (ExportAuditLogsResponse) {
option (google.api.http) = {
- post: "/v1/auditLogs:export"
+ post: "/v1/{parent=projects/*}/auditLogs:export"
+ additional_bindings: {post: "/v1/auditLogs:export"}
body: "*"
};
- option (bytebase.v1.auth_method) = CUSTOM;
+ option (bytebase.v1.permission) = "bb.auditLogs.export";
+ option (bytebase.v1.auth_method) = IAM;
}
}
message SearchAuditLogsRequest {
+ string parent = 5 [
+ (google.api.field_behavior) = REQUIRED,
+ (google.api.resource_reference) = {child_type: "bytebase.com/AuditLog"}
+ ];
+
// The filter of the log. It should be a valid CEL expression.
// For example:
// - filter = "method == '/bytebase.v1.SQLService/Query'"
@@ -64,6 +76,11 @@ message SearchAuditLogsResponse {
}
message ExportAuditLogsRequest {
+ string parent = 4 [
+ (google.api.field_behavior) = REQUIRED,
+ (google.api.resource_reference) = {child_type: "bytebase.com/AuditLog"}
+ ];
+
// The filter of the log. It should be a valid CEL expression.
// For example:
// - filter = "method == '/bytebase.v1.SQLService/Query'"