Skip to content

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

chore: add audit coverage for release, saved query, and password reset APIs (#21162)

ecmadaob6ef55a7a4d0
diff --git a/backend/api/mcp/gen/openapi.yaml b/backend/api/mcp/gen/openapi.yaml
index a574c65ce7..073f6cfcbf 100644
--- a/backend/api/mcp/gen/openapi.yaml
+++ b/backend/api/mcp/gen/openapi.yaml
@@ -7524,6 +7524,362 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/bytebase.v1.WorkloadIdentity'
+ /bytebase.v1.WorksheetService/BatchUpdateWorksheetOrganizer:
+ post:
+ tags:
+ - bytebase.v1.WorksheetService
+ summary: BatchUpdateWorksheetOrganizer
+ description: |-
+ Batch update the organizers of worksheets.
+ The access is the same as UpdateWorksheet method.
+ Permissions required: bb.worksheets.get (or creator, or project member for shared worksheets)
+ operationId: bytebase.v1.WorksheetService.BatchUpdateWorksheetOrganizer
+ parameters:
+ - name: Connect-Protocol-Version
+ in: header
+ required: true
+ schema:
+ $ref: '#/components/schemas/connect-protocol-version'
+ - name: Connect-Timeout-Ms
+ in: header
+ schema:
+ $ref: '#/components/schemas/connect-timeout-header'
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.BatchUpdateWorksheetOrganizerRequest'
+ required: true
+ responses:
+ default:
+ description: Error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/connect.error'
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.BatchUpdateWorksheetOrganizerResponse'
+ /bytebase.v1.WorksheetService/CreateWorksheet:
+ post:
+ tags:
+ - bytebase.v1.WorksheetService
+ summary: CreateWorksheet
+ description: |-
+ Creates a personal worksheet used in SQL Editor. Any authenticated user can create their own worksheets.
+ Permissions required: None (authenticated users only)
+ operationId: bytebase.v1.WorksheetService.CreateWorksheet
+ parameters:
+ - name: Connect-Protocol-Version
+ in: header
+ required: true
+ schema:
+ $ref: '#/components/schemas/connect-protocol-version'
+ - name: Connect-Timeout-Ms
+ in: header
+ schema:
+ $ref: '#/components/schemas/connect-timeout-header'
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.CreateWorksheetRequest'
+ required: true
+ responses:
+ default:
+ description: Error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/connect.error'
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Worksheet'
+ /bytebase.v1.WorksheetService/DeleteWorksheet:
+ post:
+ tags:
+ - bytebase.v1.WorksheetService
+ summary: DeleteWorksheet
+ description: |-
+ Delete a worksheet.
+ The access is the same as UpdateWorksheet method.
+ Permissions required: bb.worksheets.manage (or creator, or project member for PROJECT_WRITE worksheets)
+ operationId: bytebase.v1.WorksheetService.DeleteWorksheet
+ parameters:
+ - name: Connect-Protocol-Version
+ in: header
+ required: true
+ schema:
+ $ref: '#/components/schemas/connect-protocol-version'
+ - name: Connect-Timeout-Ms
+ in: header
+ schema:
+ $ref: '#/components/schemas/connect-timeout-header'
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.DeleteWorksheetRequest'
+ required: true
+ responses:
+ default:
+ description: Error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/connect.error'
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/google.protobuf.Empty'
+ /bytebase.v1.WorksheetService/GetWorksheet:
+ post:
+ tags:
+ - bytebase.v1.WorksheetService
+ summary: GetWorksheet
+ description: |-
+ Get a worksheet by name.
+ The users can access this method if,
+ - they are the creator of the worksheet;
+ - they have bb.worksheets.get permission on the workspace;
+ - the sheet is shared with them with PROJECT_READ and PROJECT_WRITE visibility, and they have bb.projects.get permission on the project.
+ Permissions required: bb.worksheets.get (or creator, or project member for shared worksheets)
+ operationId: bytebase.v1.WorksheetService.GetWorksheet
+ parameters:
+ - name: Connect-Protocol-Version
+ in: header
+ required: true
+ schema:
+ $ref: '#/components/schemas/connect-protocol-version'
+ - name: Connect-Timeout-Ms
+ in: header
+ schema:
+ $ref: '#/components/schemas/connect-timeout-header'
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.GetWorksheetRequest'
+ required: true
+ responses:
+ default:
+ description: Error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/connect.error'
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Worksheet'
+ /bytebase.v1.WorksheetService/ListWorksheetFolders:
+ post:
+ tags:
+ - bytebase.v1.WorksheetService
+ summary: ListWorksheetFolders
+ description: |-
+ List the caller's worksheet folders.
+ Only folders stored in the caller's worksheet organizer are returned.
+ operationId: bytebase.v1.WorksheetService.ListWorksheetFolders
+ parameters:
+ - name: Connect-Protocol-Version
+ in: header
+ required: true
+ schema:
+ $ref: '#/components/schemas/connect-protocol-version'
+ - name: Connect-Timeout-Ms
+ in: header
+ schema:
+ $ref: '#/components/schemas/connect-timeout-header'
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.ListWorksheetFoldersRequest'
+ required: true
+ responses:
+ default:
+ description: Error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/connect.error'
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.ListWorksheetFoldersResponse'
+ /bytebase.v1.WorksheetService/ListWorksheets:
+ post:
+ tags:
+ - bytebase.v1.WorksheetService
+ summary: ListWorksheets
+ description: |-
+ List worksheets.
+ This is used for listing worksheets in a project, or across all projects by using `projects/-`.
+ Permissions required: bb.worksheets.list
+ operationId: bytebase.v1.WorksheetService.ListWorksheets
+ parameters:
+ - name: Connect-Protocol-Version
+ in: header
+ required: true
+ schema:
+ $ref: '#/components/schemas/connect-protocol-version'
+ - name: Connect-Timeout-Ms
+ in: header
+ schema:
+ $ref: '#/components/schemas/connect-timeout-header'
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.ListWorksheetsRequest'
+ required: true
+ responses:
+ default:
+ description: Error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/connect.error'
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.ListWorksheetsResponse'
+ /bytebase.v1.WorksheetService/SearchWorksheets:
+ post:
+ tags:
+ - bytebase.v1.WorksheetService
+ summary: SearchWorksheets
+ description: |-
+ Search for worksheets.
+ This is used for finding my worksheets or worksheets shared by other people.
+ The sheet accessibility is the same as GetWorksheet().
+ Permissions required: bb.worksheets.get (or creator, or project member for shared worksheets)
+ operationId: bytebase.v1.WorksheetService.SearchWorksheets
+ parameters:
+ - name: Connect-Protocol-Version
+ in: header
+ required: true
+ schema:
+ $ref: '#/components/schemas/connect-protocol-version'
+ - name: Connect-Timeout-Ms
+ in: header
+ schema:
+ $ref: '#/components/schemas/connect-timeout-header'
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.SearchWorksheetsRequest'
+ required: true
+ responses:
+ default:
+ description: Error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/connect.error'
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.SearchWorksheetsResponse'
+ /bytebase.v1.WorksheetService/UpdateWorksheet:
+ post:
+ tags:
+ - bytebase.v1.WorksheetService
+ summary: UpdateWorksheet
+ description: |-
+ Update a worksheet.
+ The users can access this method if,
+ - they are the creator of the worksheet;
+ - they have bb.worksheets.manage permission on the workspace;
+ - the sheet is shared with them with PROJECT_WRITE visibility, and they have bb.projects.get permission on the project.
+ Permissions required: bb.worksheets.manage (or creator, or project member for PROJECT_WRITE worksheets)
+ operationId: bytebase.v1.WorksheetService.UpdateWorksheet
+ parameters:
+ - name: Connect-Protocol-Version
+ in: header
+ required: true
+ schema:
+ $ref: '#/components/schemas/connect-protocol-version'
+ - name: Connect-Timeout-Ms
+ in: header
+ schema:
+ $ref: '#/components/schemas/connect-timeout-header'
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.UpdateWorksheetRequest'
+ required: true
+ responses:
+ default:
+ description: Error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/connect.error'
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Worksheet'
+ /bytebase.v1.WorksheetService/UpdateWorksheetOrganizer:
+ post:
+ tags:
+ - bytebase.v1.WorksheetService
+ summary: UpdateWorksheetOrganizer
+ description: |-
+ Update the organizer of a worksheet.
+ The access is the same as UpdateWorksheet method.
+ Permissions required: bb.worksheets.get (or creator, or project member for shared worksheets)
+ operationId: bytebase.v1.WorksheetService.UpdateWorksheetOrganizer
+ parameters:
+ - name: Connect-Protocol-Version
+ in: header
+ required: true
+ schema:
+ $ref: '#/components/schemas/connect-protocol-version'
+ - name: Connect-Timeout-Ms
+ in: header
+ schema:
+ $ref: '#/components/schemas/connect-timeout-header'
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.UpdateWorksheetOrganizerRequest'
+ required: true
+ responses:
+ default:
+ description: Error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/connect.error'
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.WorksheetOrganizer'
/bytebase.v1.WorkspaceService/DeleteWorkspace:
post:
tags:
@@ -9310,26 +9666,77 @@ components:
title: update_mask
description: |-
The list of fields to be updated.
- Fields are specified relative to the saved query organizer.
+ Fields are specified relative to the saved query organizer.
+ Only support update the following fields for now:
+ - `starred`
+ - `folders`
+ $ref: '#/components/schemas/google.protobuf.FieldMask'
+ title: BatchUpdateSavedQueryOrganizerRequest
+ additionalProperties: false
+ bytebase.v1.BatchUpdateSavedQueryOrganizerResponse:
+ type: object
+ properties:
+ savedQueryOrganizers:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.SavedQueryOrganizer'
+ title: saved_query_organizers
+ updatedCount:
+ type: integer
+ title: updated_count
+ format: int32
+ title: BatchUpdateSavedQueryOrganizerResponse
+ additionalProperties: false
+ bytebase.v1.BatchUpdateWorksheetOrganizerRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: |-
+ The parent resource whose worksheets' organizers are updated.
+ Format: projects/{project}
+ filter:
+ type: string
+ title: filter
+ description: |-
+ To filter the batch update target.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+ Supported filter:
+ - name: the worksheet name in "projects/{project}/worksheets/{worksheet}" format, support "==" and "in [xx]" operator.
+ - creator: the worksheet creator in "users/{email}" format, support "==" and "!=" operator.
+ - starred: should be "true" or "false", filter starred/unstarred sheets, support "==" operator.
+ - visibility: check Visibility enum in the Worksheet message for values, support "==" and "in [xx]" operator.
+ - folder: the worksheet organizer folder path, support exact "==" operator.
+ organizer:
+ title: organizer
+ description: The organizer fields to update.
+ $ref: '#/components/schemas/bytebase.v1.WorksheetOrganizer'
+ updateMask:
+ title: update_mask
+ description: |-
+ The list of fields to be updated.
+ Fields are specified relative to the worksheet organizer.
Only support update the following fields for now:
- `starred`
- `folders`
$ref: '#/components/schemas/google.protobuf.FieldMask'
- title: BatchUpdateSavedQueryOrganizerRequest
+ title: BatchUpdateWorksheetOrganizerRequest
additionalProperties: false
- bytebase.v1.BatchUpdateSavedQueryOrganizerResponse:
+ bytebase.v1.BatchUpdateWorksheetOrganizerResponse:
type: object
properties:
- savedQueryOrganizers:
+ worksheetOrganizers:
type: array
items:
- $ref: '#/components/schemas/bytebase.v1.SavedQueryOrganizer'
- title: saved_query_organizers
+ $ref: '#/components/schemas/bytebase.v1.WorksheetOrganizer'
+ title: worksheet_organizers
updatedCount:
type: integer
title: updated_count
format: int32
- title: BatchUpdateSavedQueryOrganizerResponse
+ title: BatchUpdateWorksheetOrganizerResponse
additionalProperties: false
bytebase.v1.BillingInterval:
type: string
@@ -10241,6 +10648,21 @@ components:
title: CreateWorkloadIdentityRequest
additionalProperties: false
description: Request message for creating a workload identity.
+ bytebase.v1.CreateWorksheetRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: |-
+ The parent resource where this worksheet will be created.
+ Format: projects/{project}
+ worksheet:
+ title: worksheet
+ description: The worksheet to create.
+ $ref: '#/components/schemas/bytebase.v1.Worksheet'
+ title: CreateWorksheetRequest
+ additionalProperties: false
bytebase.v1.DataClassificationSetting:
type: object
properties:
@@ -11227,6 +11649,17 @@ components:
title: DeleteWorkloadIdentityRequest
additionalProperties: false
description: Request message for deleting a workload identity.
+ bytebase.v1.DeleteWorksheetRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the worksheet to delete.
+ Format: projects/{project}/worksheets/{worksheet}
+ title: DeleteWorksheetRequest
+ additionalProperties: false
bytebase.v1.DeleteWorkspaceRequest:
type: object
properties:
@@ -12448,6 +12881,17 @@ components:
title: GetWorkloadIdentityRequest
additionalProperties: false
description: Request message for getting a workload identity.
+ bytebase.v1.GetWorksheetRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the worksheet to retrieve.
+ Format: projects/{project}/worksheets/{worksheet}
+ title: GetWorksheetRequest
+ additionalProperties: false
bytebase.v1.GetWorkspaceRequest:
type: object
properties:
@@ -14778,6 +15222,89 @@ components:
title: ListWorkloadIdentitiesResponse
additionalProperties: false
description: Response message for listing workload identities.
+ bytebase.v1.ListWorksheetFoldersRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: |-
+ The parent resource of the worksheet folders.
+ Format: projects/{project}
+ title: ListWorksheetFoldersRequest
+ additionalProperties: false
+ bytebase.v1.ListWorksheetFoldersResponse:
+ type: object
+ properties:
+ folders:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.WorksheetFolder'
+ title: folders
+ description: The caller's worksheet folders.
+ title: ListWorksheetFoldersResponse
+ additionalProperties: false
+ bytebase.v1.ListWorksheetsRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: |-
+ The parent resource of the worksheets.
+ Format: projects/{project}
+ Use "projects/-" to list worksheets across all projects.
+ filter:
+ type: string
+ title: filter
+ description: |-
+ To filter the list result.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+ Supported filter:
+ - creator: the worksheet creator in "users/{email}" format, support "==" and "!=" operator.
+
+ For example:
+ creator == "users/{email}"
+ creator != "users/{email}"
+ pageSize:
+ type: integer
+ title: page_size
+ format: int32
+ description: |-
+ The maximum number of worksheets to return. The service may return fewer than
+ this value.
+ If unspecified, at most 10 worksheets will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ pageToken:
+ type: string
+ title: page_token
+ description: |-
+ A page token, received from a previous `ListWorksheets` call.
+ Provide this to retrieve the subsequent page.
+
+ When paginating, all other parameters provided to `ListWorksheets` must match
+ the call that provided the page token.
+ title: ListWorksheetsRequest
+ additionalProperties: false
+ bytebase.v1.ListWorksheetsResponse:
+ type: object
+ properties:
+ worksheets:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.Worksheet'
+ title: worksheets
+ description: The worksheets from the specified parent.
+ nextPageToken:
+ type: string
+ title: next_page_token
+ description: |-
+ A token to retrieve next page of worksheets.
+ Pass this value in the page_token field in the subsequent call to
+ `ListWorksheets` method to retrieve the next page of worksheets.
+ title: ListWorksheetsResponse
+ additionalProperties: false
bytebase.v1.ListWorkspacesRequest:
type: object
title: ListWorkspacesRequest
@@ -18308,6 +18835,74 @@ components:
`SearchSavedQueries` method to retrieve the next page of saved queries.
title: SearchSavedQueriesResponse
additionalProperties: false
+ bytebase.v1.SearchWorksheetsRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: |-
+ The parent resource of the worksheets.
+ Format: projects/{project}
+ filter:
+ type: string
+ title: filter
+ description: |-
+ To filter the search result.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+ Supported filter:
+ - name: the worksheet name in "projects/{project}/worksheets/{worksheet}" format, support "==" and "in [xx]" operator.
+ - title: the worksheet title, support "contains" operator.
+ - creator: the worksheet creator in "users/{email}" format, support "==" and "!=" operator.
+ - starred: should be "true" or "false", filter starred/unstarred sheets, support "==" operator.
+ - visibility: check Visibility enum in the Worksheet message for values, support "==" and "in [xx]" operator.
+ - folder: the worksheet organizer folder path, support "==" operator.
+
+ For example:
+ creator == "users/{email}"
+ title.contains("worksheet title")
+ creator != "users/{email}"
+ starred == true
+ starred == false
+ visibility in ["PRIVATE", "PROJECT_READ", "PROJECT_WRITE"]
+ visibility == "PRIVATE"
+ folder == "foo/bar"
+ pageSize:
+ type: integer
+ title: page_size
+ format: int32
+ description: |-
+ The maximum number of worksheets to return. The service may return fewer than
+ this value.
+ If unspecified, at most 10 worksheets will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ pageToken:
+ type: string
+ title: page_token
+ description: |-
+ A page token, received from a previous `SearchWorksheets` call.
+ Provide this to retrieve the subsequent page.
+ title: SearchWorksheetsRequest
+ additionalProperties: false
+ bytebase.v1.SearchWorksheetsResponse:
+ type: object
+ properties:
+ worksheets:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.Worksheet'
+ title: worksheets
+ description: The worksheets that matched the search criteria.
+ nextPageToken:
+ type: string
+ title: next_page_token
+ description: |-
+ A token to retrieve next page of worksheets.
+ Pass this value in the page_token field in the subsequent call to
+ `SearchWorksheets` method to retrieve the next page of worksheets.
+ title: SearchWorksheetsResponse
+ additionalProperties: false
bytebase.v1.SemanticTypeSetting:
type: object
properties:
@@ -20790,6 +21385,58 @@ components:
title: UpdateWorkloadIdentityRequest
additionalProperties: false
description: Request message for updating a workload identity.
+ bytebase.v1.UpdateWorksheetOrganizerRequest:
+ type: object
+ properties:
+ organizer:
+ title: organizer
+ description: |-
+ The organizer to update.
+
+ The organizer's `worksheet` field is used to identify the worksheet.
+ Format: projects/{project}/worksheets/{worksheet}
+ $ref: '#/components/schemas/bytebase.v1.WorksheetOrganizer'
+ updateMask:
+ title: update_mask
+ description: |-
+ The list of fields to be updated.
+ Fields are specified relative to the worksheet organizer.
+ Only support update the following fields for now:
+ - `starred`
+ $ref: '#/components/schemas/google.protobuf.FieldMask'
+ allowMissing:
+ type: boolean
+ title: allow_missing
+ description: |-
+ If set to true, and the worksheet organizer is not found, a new worksheet organizer will be created.
+ In this situation, `update_mask` is ignored.
+ title: UpdateWorksheetOrganizerRequest
+ additionalProperties: false
+ bytebase.v1.UpdateWorksheetRequest:
+ type: object
+ properties:
+ worksheet:
+ title: worksheet
+ description: |-
+ The worksheet to update.
+
+ The worksheet's `name` field is used to identify the worksheet to update.
+ Format: projects/{project}/worksheets/{worksheet}
+ $ref: '#/components/schemas/bytebase.v1.Worksheet'
+ updateMask:
+ title: update_mask
+ description: |-
+ The list of fields to be updated.
+ Fields are specified relative to the worksheet.
+ (e.g., `title`, `statement`; *not* `worksheet.title` or `worksheet.statement`)
+ Only support update the following fields for now:
+ - `title`
+ - `statement`
+ - `starred`
+ - `visibility`
+ $ref: '#/components/schemas/google.protobuf.FieldMask'
+ title: UpdateWorksheetRequest
+ additionalProperties: false
bytebase.v1.UpdateWorkspaceRequest:
type: object
properties:
@@ -21112,6 +21759,127 @@ components:
- GITHUB
- GITLAB
description: ProviderType identifies the CI/CD platform.
+ bytebase.v1.Worksheet:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the worksheet resource, generated by the server.
+ Canonical parent is project.
+ Format: projects/{project}/worksheets/{worksheet}
+ project:
+ type: string
+ title: project
+ description: |-
+ The project resource name.
+ Format: projects/{project}
+ database:
+ type: string
+ title: database
+ description: |-
+ The database resource name.
+ Format: instances/{instance}/databases/{database}
+ If the database parent doesn't exist, the database field is empty.
+ title:
+ type: string
+ title: title
+ maxLength: 200
+ description: The title of the worksheet.
+ creator:
+ type: string
+ title: creator
+ description: |-
+ The creator of the Worksheet.
+ Format: users/{email}
+ createTime:
+ title: create_time
+ description: The create time of the worksheet.
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ updateTime:
+ title: update_time
+ description: The last update time of the worksheet.
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ content:
+ type: string
+ title: content
+ format: byte
+ description: |-
+ The content of the worksheet.
+ By default, it will be cut off in SearchWorksheet() method. If it doesn't match the `content_size`, you can
+ use GetWorksheet() request to retrieve the full content.
+ contentSize:
+ type:
+ - integer
+ - string
+ title: content_size
+ format: int64
+ description: content_size is the full size of the content, may not match the size of the `content` field.
+ visibility:
+ title: visibility
+ $ref: '#/components/schemas/bytebase.v1.Worksheet.Visibility'
+ starred:
+ type: boolean
+ title: starred
+ description: starred indicates whether the worksheet is starred by the current authenticated user.
+ folders:
+ type: array
+ items:
+ type: string
+ title: folders
+ title: Worksheet
+ additionalProperties: false
+ bytebase.v1.Worksheet.Visibility:
+ type: string
+ title: Visibility
+ enum:
+ - VISIBILITY_UNSPECIFIED
+ - PROJECT_READ
+ - PROJECT_WRITE
+ - PRIVATE
+ bytebase.v1.WorksheetFolder:
+ type: object
+ properties:
+ folders:
+ type: array
+ items:
+ type: string
+ title: folders
+ description: The folder path segments.
+ category:
+ title: category
+ description: The folder category.
+ $ref: '#/components/schemas/bytebase.v1.WorksheetFolder.Category'
+ title: WorksheetFolder
+ additionalProperties: false
+ bytebase.v1.WorksheetFolder.Category:
+ type: string
+ title: Category
+ enum:
+ - CATEGORY_UNSPECIFIED
+ - MINE
+ - SHARED
+ bytebase.v1.WorksheetOrganizer:
+ type: object
+ properties:
+ worksheet:
+ type: string
+ title: worksheet
+ description: |-
+ The name of the worksheet.
+ Format: projects/{project}/worksheets/{worksheet}
+ starred:
+ type: boolean
+ title: starred
+ description: starred means if the worksheet is starred.
+ folders:
+ type: array
+ items:
+ type: string
+ title: folders
+ title: WorksheetOrganizer
+ additionalProperties: false
bytebase.v1.Workspace:
type: object
properties:
@@ -22782,5 +23550,7 @@ tags:
description: SubscriptionService manages enterprise subscriptions and licensing.
- name: bytebase.v1.WorkloadIdentityService
description: WorkloadIdentityService manages workload identities for external CI/CD integrations.
+ - name: bytebase.v1.WorksheetService
+ description: WorksheetService manages SQL worksheets for query development.
- name: bytebase.v1.WorkspaceService
description: WorkspaceService manages workspace-level operations and profile.
diff --git a/backend/api/v1/audit.go b/backend/api/v1/audit.go
index 6b1c7e21b6..88b6649efd 100644
--- a/backend/api/v1/audit.go
+++ b/backend/api/v1/audit.go
@@ -184,9 +184,9 @@ type auditEntry struct {
// serviceData is populated by handlers via common.WithSetServiceData.
serviceData *anypb.Any
// handlerAuditWorkspaceID is populated by handlers via
- // common.SetAuditWorkspaceID. Used as the audit-parent fallback for
- // allow_without_credential methods (Login/Signup/ExchangeToken) where
- // authContext.Resources is empty because no workspace is in the context.
+ // common.SetAuditWorkspaceID. Used as the validated audit parent for
+ // allow_without_credential methods where authContext.Resources is empty
+ // because no workspace is in the context.
handlerAuditWorkspaceID string
rerr error
headers http.Header
@@ -229,9 +229,9 @@ func (in *AuditInterceptor) createAuditLog(ctx context.Context, e *auditEntry) e
// Build the list of parents to audit under. Normally these come from the
// ACL interceptor via authContext.Resources. For audited methods that run
- // without a workspace-bound caller (Login/Signup/ExchangeToken), Resources
- // is empty; fall back to the workspace the handler announced, or any
- // workspace embedded in the response, so the audit entry is still written.
+ // without a workspace-bound caller, Resources is empty; fall back to the
+ // workspace the handler announced, or any workspace embedded in the
+ // response, so the audit entry is still written.
type auditParent struct {
parent string
auditWorkspaceID string
@@ -249,21 +249,33 @@ func (in *AuditInterceptor) createAuditLog(ctx context.Context, e *auditEntry) e
seenParent[ap.parent] = true
parents = append(parents, ap)
}
- for _, authResource := range authContext.Resources {
- switch authResource.Type {
- case common.ResourceTypeProject:
+ handlerValidatedWorkspaceMethod := e.method == v1connect.AuthServiceRequestPasswordResetProcedure ||
+ e.method == v1connect.AuthServiceResetPasswordProcedure ||
+ e.method == v1connect.AuthServiceSendEmailLoginCodeProcedure
+ if handlerValidatedWorkspaceMethod {
+ if e.handlerAuditWorkspaceID != "" {
appendParent(auditParent{
- parent: common.FormatProject(authResource.ID),
+ parent: common.FormatWorkspace(e.handlerAuditWorkspaceID),
+ auditWorkspaceID: e.handlerAuditWorkspaceID,
})
- case common.ResourceTypeWorkspace:
- appendParent(auditParent{
- parent: common.FormatWorkspace(authResource.ID),
- auditWorkspaceID: authResource.ID,
- })
- default:
+ }
+ } else {
+ for _, authResource := range authContext.Resources {
+ switch authResource.Type {
+ case common.ResourceTypeProject:
+ appendParent(auditParent{
+ parent: common.FormatProject(authResource.ID),
+ })
+ case common.ResourceTypeWorkspace:
+ appendParent(auditParent{
+ parent: common.FormatWorkspace(authResource.ID),
+ auditWorkspaceID: authResource.ID,
+ })
+ default:
+ }
}
}
- if len(parents) == 0 {
+ if len(parents) == 0 && !handlerValidatedWorkspaceMethod {
fallbackWS := e.handlerAuditWorkspaceID
if fallbackWS == "" {
if loginResp, ok := e.response.(*v1pb.LoginResponse); ok {
@@ -470,6 +482,12 @@ func getRequestResource(request any, method string) string {
return r.GetEmail()
case *v1pb.ExchangeTokenRequest:
return r.GetEmail()
+ case *v1pb.RequestPasswordResetRequest:
+ return strings.ToLower(strings.TrimSpace(r.GetEmail()))
+ case *v1pb.ResetPasswordRequest:
+ return strings.ToLower(strings.TrimSpace(r.GetEmail()))
+ case *v1pb.SendEmailLoginCodeRequest:
+ return strings.ToLower(strings.TrimSpace(r.GetEmail()))
case *v1pb.CreateInstanceRequest:
if r.GetParent() == "" {
return common.FormatInstance(r.GetInstanceId())
@@ -510,6 +528,8 @@ func getRequestString(request any) (string, error) {
return redactSignupRequest(r)
case *v1pb.ExchangeTokenRequest:
return redactExchangeTokenRequest(r)
+ case *v1pb.ResetPasswordRequest:
+ return redactResetPasswordRequest(r)
case *v1pb.CreateProjectRequest:
r = proto.CloneOf(r)
r.Project = redactProject(r.Project)
@@ -518,6 +538,18 @@ func getRequestString(request any) (string, error) {
r = proto.CloneOf(r)
r.Project = redactProject(r.Project)
return r
+ case *v1pb.CreateReleaseRequest:
+ r = proto.CloneOf(r)
+ r.Release = redactRelease(r.Release)
+ return r
+ case *v1pb.UpdateReleaseRequest:
+ r = proto.CloneOf(r)
+ r.Release = redactRelease(r.Release)
+ return r
+ case *v1pb.CreateSavedQueryRequest:
+ r = proto.CloneOf(r)
+ r.SavedQuery = redactSavedQuery(r.SavedQuery)
+ return r
case *v1pb.CreateInstanceRequest:
r = proto.CloneOf(r)
r.Instance = redactInstance(r.Instance)
@@ -614,6 +646,10 @@ func getResponseString(response any) (string, error) {
return redactInstance(r)
case *v1pb.Project:
return redactProject(r)
+ case *v1pb.Release:
+ return redactRelease(r)
+ case *v1pb.SavedQuery:
+ return redactSavedQuery(r)
case *v1pb.Sheet:
return redactSheet(r)
case *v1pb.BatchCreateSheetsResponse:
@@ -639,6 +675,16 @@ func getResponseString(response any) (string, error) {
return string(b), nil
}
+func redactResetPasswordRequest(r *v1pb.ResetPasswordRequest) *v1pb.ResetPasswordRequest {
+ if r == nil {
+ return nil
+ }
+ cloned := proto.CloneOf(r)
+ cloned.Code = maskedString
+ cloned.NewPassword = maskedString
+ return cloned
+}
+
func redactExportRequest(r *v1pb.ExportRequest) *v1pb.ExportRequest {
if r == nil {
return nil
@@ -803,6 +849,28 @@ func redactProject(p *v1pb.Project) *v1pb.Project {
return cloned
}
+func redactRelease(r *v1pb.Release) *v1pb.Release {
+ if r == nil {
+ return nil
+ }
+ cloned := proto.CloneOf(r)
+ for _, file := range cloned.Files {
+ if file != nil {
+ file.Statement = nil
+ }
+ }
+ return cloned
+}
+
+func redactSavedQuery(r *v1pb.SavedQuery) *v1pb.SavedQuery {
+ if r == nil {
+ return nil
+ }
+ cloned := proto.CloneOf(r)
+ cloned.Content = nil
+ return cloned
+}
+
// redactSetting masks every credential a settings payload can carry. The read
// path blanks these, so they reach the audit log only through UpdateSetting's
// request. Each secret is masked rather than dropped so the log still records
diff --git a/backend/api/v1/audit_redaction_test.go b/backend/api/v1/audit_redaction_test.go
index 1957857f76..743a46483d 100644
--- a/backend/api/v1/audit_redaction_test.go
+++ b/backend/api/v1/audit_redaction_test.go
@@ -1,6 +1,7 @@
package v1
import (
+ "encoding/base64"
"testing"
"github.com/stretchr/testify/require"
@@ -19,6 +20,8 @@ import (
const secretSentinel = "s3cr3t-sentinel-value"
+var encodedSecretSentinel = base64.StdEncoding.EncodeToString([]byte(secretSentinel))
+
func TestAuditResponseRedactsCredentials(t *testing.T) {
for _, tt := range []struct {
name string
@@ -53,11 +56,22 @@ func TestAuditResponseRedactsCredentials(t *testing.T) {
Url: secretSentinel,
}}},
},
+ {
+ name: "release response SQL",
+ response: &v1pb.Release{Files: []*v1pb.Release_File{nil, {
+ Statement: []byte(secretSentinel),
+ }}},
+ },
+ {
+ name: "saved query response SQL",
+ response: &v1pb.SavedQuery{Content: []byte(secretSentinel)},
+ },
} {
t.Run(tt.name, func(t *testing.T) {
got, err := getResponseString(tt.response)
require.NoError(t, err)
require.NotContains(t, got, secretSentinel, "credential written to the audit log")
+ require.NotContains(t, got, encodedSecretSentinel, "encoded content written to the audit log")
})
}
}
@@ -112,11 +126,29 @@ func TestAuditRequestRedactsCredentials(t *testing.T) {
Name: "projects/project-a",
Webhooks: []*v1pb.Webhook{{Name: "projects/project-a/webhooks/webhook-a", Url: secretSentinel}},
}}},
+ {"release SQL", &v1pb.CreateReleaseRequest{Release: &v1pb.Release{
+ Files: []*v1pb.Release_File{nil, {Statement: []byte(secretSentinel)}},
+ }}},
+ {"updated release SQL", &v1pb.UpdateReleaseRequest{Release: &v1pb.Release{
+ Files: []*v1pb.Release_File{{Statement: []byte(secretSentinel)}},
+ }}},
+ {"saved query SQL", &v1pb.CreateSavedQueryRequest{SavedQuery: &v1pb.SavedQuery{
+ Content: []byte(secretSentinel),
+ }}},
+ {"password reset code and password", &v1pb.ResetPasswordRequest{
+ Email: "[email protected]",
+ Code: secretSentinel,
+ NewPassword: secretSentinel,
+ }},
} {
t.Run(tt.name, func(t *testing.T) {
got, err := getRequestString(tt.request)
require.NoError(t, err)
require.NotContains(t, got, secretSentinel, "credential written to the audit log")
+ require.NotContains(t, got, encodedSecretSentinel, "encoded content written to the audit log")
+ if _, ok := tt.request.(*v1pb.ResetPasswordRequest); ok {
+ require.Contains(t, got, "[email protected]", "email is required for audit attribution")
+ }
})
}
}
@@ -143,6 +175,16 @@ func TestAuditRedactionDoesNotMutateInput(t *testing.T) {
require.NoError(t, err)
require.Equal(t, secretSentinel, project.GetWebhooks()[0].GetUrl(), "redaction mutated the project response")
+ release := &v1pb.Release{Files: []*v1pb.Release_File{{Statement: []byte(secretSentinel)}}}
+ _, err = getResponseString(release)
+ require.NoError(t, err)
+ require.Equal(t, secretSentinel, string(release.GetFiles()[0].GetStatement()), "redaction mutated the release response")
+
+ savedQuery := &v1pb.SavedQuery{Content: []byte(secretSentinel)}
+ _, err = getResponseString(savedQuery)
+ require.NoError(t, err)
+ require.Equal(t, secretSentinel, string(savedQuery.GetContent()), "redaction mutated the saved query response")
+
for _, tt := range []struct {
name string
request any
@@ -162,26 +204,39 @@ func TestAuditRedactionDoesNotMutateInput(t *testing.T) {
{name: "add data source request", request: &v1pb.AddDataSourceRequest{DataSource: &v1pb.DataSource{Password: secretSentinel}}},
{name: "update data source request", request: &v1pb.UpdateDataSourceRequest{DataSource: &v1pb.DataSource{Password: secretSentinel}}},
{name: "remove data source request", request: &v1pb.RemoveDataSourceRequest{DataSource: &v1pb.DataSource{Password: secretSentinel}}},
+ {name: "create release request", request: &v1pb.CreateReleaseRequest{Release: &v1pb.Release{Files: []*v1pb.Release_File{{Statement: []byte(secretSentinel)}}}}},
+ {name: "update release request", request: &v1pb.UpdateReleaseRequest{Release: &v1pb.Release{Files: []*v1pb.Release_File{{Statement: []byte(secretSentinel)}}}}},
+ {name: "create saved query request", request: &v1pb.CreateSavedQueryRequest{SavedQuery: &v1pb.SavedQuery{Content: []byte(secretSentinel)}}},
+ {name: "reset password request", request: &v1pb.ResetPasswordRequest{Email: "[email protected]", Code: secretSentinel, NewPassword: secretSentinel}},
} {
t.Run(tt.name, func(t *testing.T) {
_, err := getRequestString(tt.request)
require.NoError(t, err)
- var password string
+ var sensitiveValue string
switch request := tt.request.(type) {
case *v1pb.CreateInstanceRequest:
- password = request.GetInstance().GetDataSources()[0].GetPassword()
+ sensitiveValue = request.GetInstance().GetDataSources()[0].GetPassword()
case *v1pb.UpdateInstanceRequest:
- password = request.GetInstance().GetDataSources()[0].GetPassword()
+ sensitiveValue = request.GetInstance().GetDataSources()[0].GetPassword()
case *v1pb.AddDataSourceRequest:
- password = request.GetDataSource().GetPassword()
+ sensitiveValue = request.GetDataSource().GetPassword()
case *v1pb.UpdateDataSourceRequest:
- password = request.GetDataSource().GetPassword()
+ sensitiveValue = request.GetDataSource().GetPassword()
case *v1pb.RemoveDataSourceRequest:
- password = request.GetDataSource().GetPassword()
+ sensitiveValue = request.GetDataSource().GetPassword()
+ case *v1pb.CreateReleaseRequest:
+ sensitiveValue = string(request.GetRelease().GetFiles()[0].GetStatement())
+ case *v1pb.UpdateReleaseRequest:
+ sensitiveValue = string(request.GetRelease().GetFiles()[0].GetStatement())
+ case *v1pb.CreateSavedQueryRequest:
+ sensitiveValue = string(request.GetSavedQuery().GetContent())
+ case *v1pb.ResetPasswordRequest:
+ sensitiveValue = request.GetCode()
+ require.Equal(t, secretSentinel, request.GetNewPassword())
default:
t.Fatalf("unexpected request type %T", request)
}
- require.Equal(t, secretSentinel, password, "redaction mutated the request")
+ require.Equal(t, secretSentinel, sensitiveValue, "redaction mutated the request")
})
}
}
diff --git a/backend/api/v1/audit_test.go b/backend/api/v1/audit_test.go
index d614261f00..6389290a1c 100644
--- a/backend/api/v1/audit_test.go
+++ b/backend/api/v1/audit_test.go
@@ -310,6 +310,9 @@ func TestLifecycleAuditResource(t *testing.T) {
{name: "login", request: &v1pb.LoginRequest{Email: "[email protected]"}, method: "/bytebase.v1.AuthService/Login", want: "[email protected]"},
{name: "signup", request: &v1pb.SignupRequest{Email: "[email protected]"}, method: "/bytebase.v1.AuthService/Signup", want: "[email protected]"},
{name: "exchange token", request: &v1pb.ExchangeTokenRequest{Email: "[email protected]"}, method: "/bytebase.v1.AuthService/ExchangeToken", want: "[email protected]"},
+ {name: "request password reset", request: &v1pb.RequestPasswordResetRequest{Email: " [email protected] "}, method: "/bytebase.v1.AuthService/RequestPasswordReset", want: "[email protected]"},
+ {name: "reset password", request: &v1pb.ResetPasswordRequest{Email: " [email protected] "}, method: "/bytebase.v1.AuthService/ResetPassword", want: "[email protected]"},
+ {name: "send email login code", request: &v1pb.SendEmailLoginCodeRequest{Email: " [email protected] "}, method: "/bytebase.v1.AuthService/SendEmailLoginCode", want: "[email protected]"},
{name: "create project", request: &v1pb.CreateProjectRequest{ProjectId: "project-a", Project: &v1pb.Project{}}, method: "/bytebase.v1.ProjectService/CreateProject", want: "projects/project-a"},
{name: "create project ignores nested name", request: &v1pb.CreateProjectRequest{ProjectId: "project-a", Project: &v1pb.Project{Name: "projects/wrong-project"}}, method: "/bytebase.v1.ProjectService/CreateProject", want: "projects/project-a"},
{name: "update project", request: &v1pb.UpdateProjectRequest{Project: &v1pb.Project{Name: "projects/project-a"}}, method: "/bytebase.v1.ProjectService/UpdateProject", want: "projects/project-a"},
@@ -319,6 +322,10 @@ func TestLifecycleAuditResource(t *testing.T) {
{name: "cancel plan checks", request: &v1pb.CancelPlanCheckRunRequest{Name: "projects/project-a/plans/101/planCheckRun"}, method: "/bytebase.v1.PlanService/CancelPlanCheckRun", want: "projects/project-a/plans/101/planCheckRun"},
{name: "delete release", request: &v1pb.DeleteReleaseRequest{Name: "projects/project-a/releases/release-a"}, method: "/bytebase.v1.ReleaseService/DeleteRelease", want: "projects/project-a/releases/release-a"},
{name: "undelete release", request: &v1pb.UndeleteReleaseRequest{Name: "projects/project-a/releases/release-a"}, method: "/bytebase.v1.ReleaseService/UndeleteRelease", want: "projects/project-a/releases/release-a"},
+ {name: "create release", request: &v1pb.CreateReleaseRequest{Parent: "projects/project-a"}, method: "/bytebase.v1.ReleaseService/CreateRelease", want: "projects/project-a"},
+ {name: "update release", request: &v1pb.UpdateReleaseRequest{Release: &v1pb.Release{Name: "projects/project-a/releases/release-a"}}, method: "/bytebase.v1.ReleaseService/UpdateRelease", want: "projects/project-a/releases/release-a"},
+ {name: "create saved query", request: &v1pb.CreateSavedQueryRequest{Parent: "projects/project-a"}, method: "/bytebase.v1.SavedQueryService/CreateSavedQuery", want: "projects/project-a"},
+ {name: "delete saved query", request: &v1pb.DeleteSavedQueryRequest{Name: "projects/project-a/savedQueries/101"}, method: "/bytebase.v1.SavedQueryService/DeleteSavedQuery", want: "projects/project-a/savedQueries/101"},
{name: "batch create revisions", request: &v1pb.BatchCreateRevisionsRequest{Parent: "instances/instance-a/databases/database-a"}, method: "/bytebase.v1.RevisionService/BatchCreateRevisions", want: "instances/instance-a/databases/database-a"},
{name: "delete revision", request: &v1pb.DeleteRevisionRequest{Name: "instances/instance-a/databases/database-a/revisions/101"}, method: "/bytebase.v1.RevisionService/DeleteRevision", want: "instances/instance-a/databases/database-a/revisions/101"},
{name: "create workspace instance", request: &v1pb.CreateInstanceRequest{InstanceId: "instance-a", Instance: &v1pb.Instance{Name: "instances/wrong-instance"}}, method: "/bytebase.v1.InstanceService/CreateInstance", want: "instances/instance-a"},
diff --git a/backend/api/v1/auth_service.go b/backend/api/v1/auth_service.go
index f837d399dd..7f00daead5 100644
--- a/backend/api/v1/auth_service.go
+++ b/backend/api/v1/auth_service.go
@@ -1589,12 +1589,17 @@ func (s *AuthService) RequestPasswordReset(ctx context.Context, req *connect.Req
return nil, connect.NewError(connect.CodeInvalidArgument, errors.Errorf("email is required"))
}
+ workspaceID, err := s.parseAndSetAuditWorkspace(ctx, email, req.Msg.Workspace)
+ if err != nil {
+ return nil, connect.NewError(connect.CodeInvalidArgument, err)
+ }
+
// Send synchronously, but swallow errors to avoid email enumeration — a fast silent
// "success" for unknown emails must be indistinguishable from an SMTP failure for
// known ones. Errors are logged server-side for operator visibility.
if err := s.sendEmailVerificationCode(
ctx,
- req.Msg.Workspace,
+ workspaceID,
email,
storepb.EmailVerificationCodePurpose_PASSWORD_RESET,
"[Bytebase] Reset your password",
@@ -1624,6 +1629,9 @@ func (s *AuthService) ResetPassword(ctx context.Context, req *connect.Request[v1
if err != nil {
return nil, err
}
+ if codeRow.Workspace != "" {
+ common.SetAuditWorkspaceID(ctx, codeRow.Workspace)
+ }
user, err := s.store.GetUserByEmail(ctx, email)
if err != nil {
@@ -1716,7 +1724,7 @@ func (s *AuthService) SendEmailLoginCode(ctx context.Context, req *connect.Reque
if email == "" {
return nil, connect.NewError(connect.CodeInvalidArgument, errors.Errorf("email is required"))
}
- workspaceID, err := parseOptionalWorkspace(req.Msg.Workspace)
+ workspaceID, err := s.parseAndSetAuditWorkspace(ctx, email, req.Msg.Workspace)
if err != nil {
return nil, connect.NewError(connect.CodeInvalidArgument, err)
}
@@ -1737,7 +1745,7 @@ func (s *AuthService) SendEmailLoginCode(ctx context.Context, req *connect.Reque
// send regardless of whether the email exists (sign-up is handled on verify).
if err := s.sendEmailVerificationCode(
ctx,
- req.Msg.Workspace,
+ workspaceID,
email,
storepb.EmailVerificationCodePurpose_LOGIN,
"[Bytebase] Your sign-in code",
@@ -1749,6 +1757,31 @@ func (s *AuthService) SendEmailLoginCode(ctx context.Context, req *connect.Reque
return connect.NewResponse(&emptypb.Empty{}), nil
}
+// parseAndSetAuditWorkspace parses the requested workspace and attributes the
+// audit event only when the email belongs to an active user in that workspace.
+// Membership affects audit attribution only; the parsed workspace ID is still
+// returned for email-setting resolution and verification-code storage.
+func (s *AuthService) parseAndSetAuditWorkspace(ctx context.Context, email string, workspaceName *string) (string, error) {
+ workspaceID, err := parseOptionalWorkspace(workspaceName)
+ if err != nil {
+ return "", err
+ }
+ if workspaceID != "" {
+ account, err := s.store.GetAccountByEmail(ctx, email)
+ if err == nil && account != nil && account.Type == storepb.PrincipalType_END_USER && !account.MemberDeleted {
+ workspace, err := s.store.FindWorkspace(ctx, &store.FindWorkspaceMessage{
+ WorkspaceID: &workspaceID,
+ Email: email,
+ IncludeAllUser: !s.profile.SaaS,
+ })
+ if err == nil && workspace != nil {
+ common.SetAuditWorkspaceID(ctx, workspace.ResourceID)
+ }
+ }
+ }
+ return workspaceID, nil
+}
+
// resolvePreLoginEmailSetting returns the EMAIL setting to use for unauthenticated flows
// (email-code sign-in, password reset). Resolution order:
// 1. If `workspaceID` is provided, use that workspace's EMAIL setting. The frontend
@@ -1796,24 +1829,19 @@ func resolvePreLoginEmailSetting(
// Callers decide whether to propagate the error: `SendEmailLoginCode` surfaces it (users need
// to know email delivery failed), `RequestPasswordReset` swallows it to avoid revealing that
// the account exists. `bodyFmt` must contain one %s for the 6-digit code.
-func (s *AuthService) sendEmailVerificationCode(ctx context.Context, workspaceName *string, email string, purpose storepb.EmailVerificationCodePurpose, subject, bodyFmt string) error {
- // For password reset, only send to existing principals — no upsert, no email for unknown addresses.
- // Prevents arbitrary email spam. LOGIN intentionally skips this check (also covers signup).
+func (s *AuthService) sendEmailVerificationCode(ctx context.Context, workspaceID, email string, purpose storepb.EmailVerificationCodePurpose, subject, bodyFmt string) error {
+ // For password reset, only send to active end users — no upsert or email for other targets.
+ // Login intentionally skips this account check because email-code login also supports signup.
if purpose == storepb.EmailVerificationCodePurpose_PASSWORD_RESET {
account, err := s.store.GetAccountByEmail(ctx, email)
if err != nil {
return errors.Wrap(err, "failed to look up account for password reset")
}
- if account == nil || account.Type != storepb.PrincipalType_END_USER {
+ if account == nil || account.Type != storepb.PrincipalType_END_USER || account.MemberDeleted {
return nil // silent: account doesn't exist
}
}
- workspaceID, err := parseOptionalWorkspace(workspaceName)
- if err != nil {
- return errors.Wrap(err, "failed to parse workspace id")
- }
-
// Resolve the EMAIL setting FIRST — fail fast if misconfigured so we don't write a
// verification row we can't actually deliver.
emailSetting, err := resolvePreLoginEmailSetting(ctx, s.store, workspaceID)
diff --git a/backend/api/v1/auth_service_test.go b/backend/api/v1/auth_service_test.go
index f517217ea9..6f9b306aea 100644
--- a/backend/api/v1/auth_service_test.go
+++ b/backend/api/v1/auth_service_test.go
@@ -2,6 +2,7 @@ package v1
import (
"context"
+ "fmt"
"net/http"
"testing"
"time"
@@ -12,7 +13,10 @@ import (
"github.com/bytebase/bytebase/backend/api/auth"
"github.com/bytebase/bytebase/backend/common"
+ "github.com/bytebase/bytebase/backend/common/testcontainer"
+ storepb "github.com/bytebase/bytebase/backend/generated-go/store"
v1pb "github.com/bytebase/bytebase/backend/generated-go/v1"
+ "github.com/bytebase/bytebase/backend/migrator"
"github.com/bytebase/bytebase/backend/store"
)
@@ -47,6 +51,40 @@ func TestExtractDomain(t *testing.T) {
}
}
+func TestPasswordResetEmailSkipsDeletedUser(t *testing.T) {
+ ctx := context.Background()
+ container := testcontainer.GetTestPgContainer(ctx, t)
+ t.Cleanup(func() { container.Close(ctx) })
+ require.NoError(t, migrator.MigrateSchema(ctx, container.GetDB()))
+
+ pgURL := fmt.Sprintf("host=%s port=%s user=postgres password=root-password database=postgres", container.GetHost(), container.GetPort())
+ stores, err := store.New(ctx, pgURL, false)
+ require.NoError(t, err)
+ t.Cleanup(func() { require.NoError(t, stores.Close()) })
+
+ user, err := stores.CreateUser(ctx, &store.UserMessage{
+ Email: "[email protected]",
+ Name: "Deleted user",
+ PasswordHash: "unused",
+ Profile: &storepb.UserProfile{},
+ })
+ require.NoError(t, err)
+ deleted := true
+ _, err = stores.UpdateUser(ctx, user, &store.UpdateUserMessage{Delete: &deleted})
+ require.NoError(t, err)
+
+ t.Setenv("EMAIL_CONFIG", "")
+ service := &AuthService{store: stores, secret: "test-secret"}
+ require.NoError(t, service.sendEmailVerificationCode(
+ ctx,
+ "",
+ user.Email,
+ storepb.EmailVerificationCodePurpose_PASSWORD_RESET,
+ "subject",
+ "code: %s, expires in %d minutes",
+ ))
+}
+
// TestSwitchWorkspaceMCPRecognition pins the SwitchWorkspace guard predicate
// across both MCP credential generations. An MCP session must never mint a
// plain user token: that token is not audience-bound to the MCP resource, does
diff --git a/backend/generated-go/v1/auth_service.pb.go b/backend/generated-go/v1/auth_service.pb.go
index 579b5947e5..c193b8ccdb 100644
--- a/backend/generated-go/v1/auth_service.pb.go
+++ b/backend/generated-go/v1/auth_service.pb.go
@@ -1012,16 +1012,16 @@ const file_v1_auth_service_proto_rawDesc = "" +
"\x0emfa_temp_token\x18\x05 \x01(\tH\x02R\fmfaTempToken\x88\x01\x01B\v\n" +
"\t_otp_codeB\x10\n" +
"\x0e_recovery_codeB\x11\n" +
- "\x0f_mfa_temp_token2\xc7\b\n" +
+ "\x0f_mfa_temp_token2\xcf\b\n" +
"\vAuthService\x12e\n" +
"\x05Login\x12\x19.bytebase.v1.LoginRequest\x1a\x1a.bytebase.v1.LoginResponse\"%\x80\xea0\x01\x98\xea0\x01\xa0\xea0\x03\x82\xd3\xe4\x93\x02\x13:\x01*\"\x0e/v1/auth/login\x12d\n" +
"\x06Logout\x12\x1a.bytebase.v1.LogoutRequest\x1a\x16.google.protobuf.Empty\"&\x80\xea0\x01\x98\xea0\x01\xa0\xea0\x03\x82\xd3\xe4\x93\x02\x14:\x01*\"\x0f/v1/auth/logout\x12\x85\x01\n" +
"\rExchangeToken\x12!.bytebase.v1.ExchangeTokenRequest\x1a\".bytebase.v1.ExchangeTokenResponse\"-\x80\xea0\x01\x98\xea0\x01\xa0\xea0\x03\x82\xd3\xe4\x93\x02\x1b:\x01*\"\x16/v1/auth:exchangeToken\x12h\n" +
"\x06Signup\x12\x1a.bytebase.v1.SignupRequest\x1a\x1a.bytebase.v1.LoginResponse\"&\x80\xea0\x01\x98\xea0\x01\xa0\xea0\x03\x82\xd3\xe4\x93\x02\x14:\x01*\"\x0f/v1/auth/signup\x12i\n" +
"\aRefresh\x12\x1b.bytebase.v1.RefreshRequest\x1a\x1c.bytebase.v1.RefreshResponse\"#\x80\xea0\x01\xa0\xea0\x03\x82\xd3\xe4\x93\x02\x15:\x01*\"\x10/v1/auth/refresh\x12\x7f\n" +
- "\x0fSwitchWorkspace\x12#.bytebase.v1.SwitchWorkspaceRequest\x1a\x1a.bytebase.v1.LoginResponse\"+\x90\xea0\x02\xa0\xea0\x03\x82\xd3\xe4\x93\x02\x1d:\x01*\"\x18/v1/auth:switchWorkspace\x12\x8a\x01\n" +
- "\x14RequestPasswordReset\x12(.bytebase.v1.RequestPasswordResetRequest\x1a\x16.google.protobuf.Empty\"0\x80\xea0\x01\xa0\xea0\x03\x82\xd3\xe4\x93\x02\":\x01*\"\x1d/v1/auth:requestPasswordReset\x12u\n" +
- "\rResetPassword\x12!.bytebase.v1.ResetPasswordRequest\x1a\x16.google.protobuf.Empty\")\x80\xea0\x01\xa0\xea0\x03\x82\xd3\xe4\x93\x02\x1b:\x01*\"\x16/v1/auth:resetPassword\x12\x88\x01\n" +
+ "\x0fSwitchWorkspace\x12#.bytebase.v1.SwitchWorkspaceRequest\x1a\x1a.bytebase.v1.LoginResponse\"+\x90\xea0\x02\xa0\xea0\x03\x82\xd3\xe4\x93\x02\x1d:\x01*\"\x18/v1/auth:switchWorkspace\x12\x8e\x01\n" +
+ "\x14RequestPasswordReset\x12(.bytebase.v1.RequestPasswordResetRequest\x1a\x16.google.protobuf.Empty\"4\x80\xea0\x01\x98\xea0\x01\xa0\xea0\x03\x82\xd3\xe4\x93\x02\":\x01*\"\x1d/v1/auth:requestPasswordReset\x12y\n" +
+ "\rResetPassword\x12!.bytebase.v1.ResetPasswordRequest\x1a\x16.google.protobuf.Empty\"-\x80\xea0\x01\x98\xea0\x01\xa0\xea0\x03\x82\xd3\xe4\x93\x02\x1b:\x01*\"\x16/v1/auth:resetPassword\x12\x88\x01\n" +
"\x12SendEmailLoginCode\x12&.bytebase.v1.SendEmailLoginCodeRequest\x1a\x16.google.protobuf.Empty\"2\x80\xea0\x01\x98\xea0\x01\xa0\xea0\x03\x82\xd3\xe4\x93\x02 :\x01*\"\x1b/v1/auth:sendEmailLoginCodeB\xa6\x01\n" +
"\x0fcom.bytebase.v1B\x10AuthServiceProtoP\x01Z4github.com/bytebase/bytebase/backend/generated-go/v1\xa2\x02\x03BXX\xaa\x02\vBytebase.V1\xca\x02\vBytebase\\V1\xe2\x02\x17Bytebase\\V1\\GPBMetadata\xea\x02\fBytebase::V1b\x06proto3"
diff --git a/backend/generated-go/v1/release_service.pb.go b/backend/generated-go/v1/release_service.pb.go
index 12189e0fc2..4878a67e18 100644
--- a/backend/generated-go/v1/release_service.pb.go
+++ b/backend/generated-go/v1/release_service.pb.go
@@ -1228,14 +1228,14 @@ const file_v1_release_service_proto_rawDesc = "" +
"\x10TYPE_UNSPECIFIED\x10\x00\x12\r\n" +
"\tVERSIONED\x10\x01\x12\x0f\n" +
"\vDECLARATIVE\x10\x02:@\xeaA=\n" +
- "\x14bytebase.com/Release\x12%projects/{project}/releases/{release}2\xc8\n" +
+ "\x14bytebase.com/Release\x12%projects/{project}/releases/{release}2\xd0\n" +
"\n" +
"\x0eReleaseService\x12\x8a\x01\n" +
"\n" +
"GetRelease\x12\x1e.bytebase.v1.GetReleaseRequest\x1a\x14.bytebase.v1.Release\"F\xdaA\x04name\x8a\xea0\x0fbb.releases.get\x90\xea0\x01\x82\xd3\xe4\x93\x02\"\x12 /v1/{name=projects/*/releases/*}\x12\x9e\x01\n" +
- "\fListReleases\x12 .bytebase.v1.ListReleasesRequest\x1a!.bytebase.v1.ListReleasesResponse\"I\xdaA\x06parent\x8a\xea0\x10bb.releases.list\x90\xea0\x01\x82\xd3\xe4\x93\x02\"\x12 /v1/{parent=projects/*}/releases\x12\xa6\x01\n" +
- "\rCreateRelease\x12!.bytebase.v1.CreateReleaseRequest\x1a\x14.bytebase.v1.Release\"\\\xdaA\x0eparent,release\x8a\xea0\x12bb.releases.create\x90\xea0\x01\x82\xd3\xe4\x93\x02+:\arelease\" /v1/{parent=projects/*}/releases\x12\xb3\x01\n" +
- "\rUpdateRelease\x12!.bytebase.v1.UpdateReleaseRequest\x1a\x14.bytebase.v1.Release\"i\xdaA\x13release,update_mask\x8a\xea0\x12bb.releases.update\x90\xea0\x01\x82\xd3\xe4\x93\x023:\arelease2(/v1/{release.name=projects/*/releases/*}\x12\x99\x01\n" +
+ "\fListReleases\x12 .bytebase.v1.ListReleasesRequest\x1a!.bytebase.v1.ListReleasesResponse\"I\xdaA\x06parent\x8a\xea0\x10bb.releases.list\x90\xea0\x01\x82\xd3\xe4\x93\x02\"\x12 /v1/{parent=projects/*}/releases\x12\xaa\x01\n" +
+ "\rCreateRelease\x12!.bytebase.v1.CreateReleaseRequest\x1a\x14.bytebase.v1.Release\"`\xdaA\x0eparent,release\x8a\xea0\x12bb.releases.create\x90\xea0\x01\x98\xea0\x01\x82\xd3\xe4\x93\x02+:\arelease\" /v1/{parent=projects/*}/releases\x12\xb7\x01\n" +
+ "\rUpdateRelease\x12!.bytebase.v1.UpdateReleaseRequest\x1a\x14.bytebase.v1.Release\"m\xdaA\x13release,update_mask\x8a\xea0\x12bb.releases.update\x90\xea0\x01\x98\xea0\x01\x82\xd3\xe4\x93\x023:\arelease2(/v1/{release.name=projects/*/releases/*}\x12\x99\x01\n" +
"\rDeleteRelease\x12!.bytebase.v1.DeleteReleaseRequest\x1a\x16.google.protobuf.Empty\"M\xdaA\x04name\x8a\xea0\x12bb.releases.delete\x90\xea0\x01\x98\xea0\x01\x82\xd3\xe4\x93\x02\"* /v1/{name=projects/*/releases/*}\x12\x9f\x01\n" +
"\x0fUndeleteRelease\x12#.bytebase.v1.UndeleteReleaseRequest\x1a\x14.bytebase.v1.Release\"Q\x8a\xea0\x14bb.releases.undelete\x90\xea0\x01\x98\xea0\x01\x82\xd3\xe4\x93\x02+\")/v1/{name=projects/*/releases/*}:undelete\x12\x9f\x01\n" +
"\fCheckRelease\x12 .bytebase.v1.CheckReleaseRequest\x1a!.bytebase.v1.CheckReleaseResponse\"J\x8a\xea0\x11bb.releases.check\x90\xea0\x01\x82\xd3\xe4\x93\x02+:\x01*\"&/v1/{parent=projects/*}/releases:check\x12\xc8\x01\n" +
diff --git a/backend/generated-go/v1/saved_query_service.pb.go b/backend/generated-go/v1/saved_query_service.pb.go
index 3dc394c373..7a2a0a42dd 100644
--- a/backend/generated-go/v1/saved_query_service.pb.go
+++ b/backend/generated-go/v1/saved_query_service.pb.go
@@ -1139,9 +1139,10 @@ var File_v1_saved_query_service_proto protoreflect.FileDescriptor
const file_v1_saved_query_service_proto_rawDesc = "" +
"\n" +
- "\x1cv1/saved_query_service.proto\x12\vbytebase.v1\x1a\x1bbuf/validate/validate.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x13v1/annotation.proto\"u\n" +
- "\x17CreateSavedQueryRequest\x12\x1b\n" +
- "\x06parent\x18\x01 \x01(\tB\x03\xe0A\x02R\x06parent\x12=\n" +
+ "\x1cv1/saved_query_service.proto\x12\vbytebase.v1\x1a\x1bbuf/validate/validate.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x13v1/annotation.proto\"\x8e\x01\n" +
+ "\x17CreateSavedQueryRequest\x124\n" +
+ "\x06parent\x18\x01 \x01(\tB\x1c\xe0A\x02\xfaA\x16\n" +
+ "\x14bytebase.com/ProjectR\x06parent\x12=\n" +
"\vsaved_query\x18\x02 \x01(\v2\x17.bytebase.v1.SavedQueryB\x03\xe0A\x02R\n" +
"savedQuery\"/\n" +
"\x14GetSavedQueryRequest\x12\x17\n" +
@@ -1191,9 +1192,10 @@ const file_v1_saved_query_service_proto_rawDesc = "" +
"\vsaved_query\x18\x01 \x01(\tB\x03\xe0A\x02R\n" +
"savedQuery\x12\x18\n" +
"\astarred\x18\x02 \x01(\bR\astarred\x12\x18\n" +
- "\afolders\x18\x03 \x03(\tR\afolders\"2\n" +
- "\x17DeleteSavedQueryRequest\x12\x17\n" +
- "\x04name\x18\x01 \x01(\tB\x03\xe0A\x02R\x04name\"\x8c\x01\n" +
+ "\afolders\x18\x03 \x03(\tR\afolders\"N\n" +
+ "\x17DeleteSavedQueryRequest\x123\n" +
+ "\x04name\x18\x01 \x01(\tB\x1f\xe0A\x02\xfaA\x19\n" +
+ "\x17bytebase.com/SavedQueryR\x04name\"\x8c\x01\n" +
"\x19SearchSavedQueriesRequest\x12\x1b\n" +
"\x06parent\x18\x01 \x01(\tB\x03\xe0A\x02R\x06parent\x12\x16\n" +
"\x06filter\x18\x02 \x01(\tR\x06filter\x12\x1b\n" +
@@ -1202,7 +1204,7 @@ const file_v1_saved_query_service_proto_rawDesc = "" +
"page_token\x18\x04 \x01(\tR\tpageToken\"\x82\x01\n" +
"\x1aSearchSavedQueriesResponse\x12<\n" +
"\rsaved_queries\x18\x01 \x03(\v2\x17.bytebase.v1.SavedQueryR\fsavedQueries\x12&\n" +
- "\x0fnext_page_token\x18\x02 \x01(\tR\rnextPageToken\"\xc0\x03\n" +
+ "\x0fnext_page_token\x18\x02 \x01(\tR\rnextPageToken\"\x8d\x04\n" +
"\n" +
"SavedQuery\x12\x1a\n" +
"\x04name\x18\x01 \x01(\tB\x06\xe0A\x02\xe0A\x05R\x04name\x12\x1d\n" +
@@ -1217,19 +1219,20 @@ const file_v1_saved_query_service_proto_rawDesc = "" +
"\acontent\x18\b \x01(\fB\x03\xe0A\x02R\acontent\x12&\n" +
"\fcontent_size\x18\t \x01(\x03B\x03\xe0A\x03R\vcontentSize\x12\x1d\n" +
"\astarred\x18\v \x01(\bB\x03\xe0A\x03R\astarred\x12\x1d\n" +
- "\afolders\x18\f \x03(\tB\x03\xe0A\x03R\afoldersJ\x04\b\n" +
+ "\afolders\x18\f \x03(\tB\x03\xe0A\x03R\afolders:K\xeaAH\n" +
+ "\x17bytebase.com/SavedQuery\x12-projects/{project}/savedQueries/{saved_query}J\x04\b\n" +
"\x10\vR\n" +
- "visibility2\xee\f\n" +
- "\x11SavedQueryService\x12\xa5\x01\n" +
- "\x10CreateSavedQuery\x12$.bytebase.v1.CreateSavedQueryRequest\x1a\x17.bytebase.v1.SavedQuery\"R\xdaA\x12parent,saved_query\x90\xea0\x02\x82\xd3\xe4\x93\x023:\vsaved_query\"$/v1/{parent=projects/*}/savedQueries\x12\x84\x01\n" +
+ "visibility2\xf6\f\n" +
+ "\x11SavedQueryService\x12\xa9\x01\n" +
+ "\x10CreateSavedQuery\x12$.bytebase.v1.CreateSavedQueryRequest\x1a\x17.bytebase.v1.SavedQuery\"V\xdaA\x12parent,saved_query\x90\xea0\x02\x98\xea0\x01\x82\xd3\xe4\x93\x023:\vsaved_query\"$/v1/{parent=projects/*}/savedQueries\x12\x84\x01\n" +
"\rGetSavedQuery\x12!.bytebase.v1.GetSavedQueryRequest\x1a\x17.bytebase.v1.SavedQuery\"7\xdaA\x04name\x90\xea0\x02\x82\xd3\xe4\x93\x02&\x12$/v1/{name=projects/*/savedQueries/*}\x12\xb0\x01\n" +
"\x10ListSavedQueries\x12$.bytebase.v1.ListSavedQueriesRequest\x1a%.bytebase.v1.ListSavedQueriesResponse\"O\xdaA\x06parent\x8a\xea0\x12bb.worksheets.list\x90\xea0\x01\x82\xd3\xe4\x93\x02&\x12$/v1/{parent=projects/*}/savedQueries\x12\xae\x01\n" +
"\x15ListSavedQueryFolders\x12).bytebase.v1.ListSavedQueryFoldersRequest\x1a*.bytebase.v1.ListSavedQueryFoldersResponse\">\xdaA\x06parent\x90\xea0\x02\x82\xd3\xe4\x93\x02+\x12)/v1/{parent=projects/*}/savedQueryFolders\x12\xaa\x01\n" +
"\x12SearchSavedQueries\x12&.bytebase.v1.SearchSavedQueriesRequest\x1a'.bytebase.v1.SearchSavedQueriesResponse\"C\xdaA\x06parent\x90\xea0\x02\x82\xd3\xe4\x93\x020:\x01*\"+/v1/{parent=projects/*}/savedQueries:search\x12\xb6\x01\n" +
"\x10UpdateSavedQuery\x12$.bytebase.v1.UpdateSavedQueryRequest\x1a\x17.bytebase.v1.SavedQuery\"c\xdaA\x17saved_query,update_mask\x90\xea0\x02\x82\xd3\xe4\x93\x02?:\vsaved_query20/v1/{saved_query.name=projects/*/savedQueries/*}\x12\xdc\x01\n" +
"\x19UpdateSavedQueryOrganizer\x12-.bytebase.v1.UpdateSavedQueryOrganizerRequest\x1a .bytebase.v1.SavedQueryOrganizer\"n\xdaA\x15organizer,update_mask\x90\xea0\x02\x82\xd3\xe4\x93\x02L:\torganizer2?/v1/{organizer.saved_query=projects/*/savedQueries/*}/organizer\x12\xf4\x01\n" +
- "\x1eBatchUpdateSavedQueryOrganizer\x122.bytebase.v1.BatchUpdateSavedQueryOrganizerRequest\x1a3.bytebase.v1.BatchUpdateSavedQueryOrganizerResponse\"i\xdaA\x1cparent,organizer,update_mask\x90\xea0\x02\x82\xd3\xe4\x93\x02@:\x01*\";/v1/{parent=projects/*}/savedQueries/organizers:batchUpdate\x12\x89\x01\n" +
- "\x10DeleteSavedQuery\x12$.bytebase.v1.DeleteSavedQueryRequest\x1a\x16.google.protobuf.Empty\"7\xdaA\x04name\x90\xea0\x02\x82\xd3\xe4\x93\x02&*$/v1/{name=projects/*/savedQueries/*}B\xac\x01\n" +
+ "\x1eBatchUpdateSavedQueryOrganizer\x122.bytebase.v1.BatchUpdateSavedQueryOrganizerRequest\x1a3.bytebase.v1.BatchUpdateSavedQueryOrganizerResponse\"i\xdaA\x1cparent,organizer,update_mask\x90\xea0\x02\x82\xd3\xe4\x93\x02@:\x01*\";/v1/{parent=projects/*}/savedQueries/organizers:batchUpdate\x12\x8d\x01\n" +
+ "\x10DeleteSavedQuery\x12$.bytebase.v1.DeleteSavedQueryRequest\x1a\x16.google.protobuf.Empty\";\xdaA\x04name\x90\xea0\x02\x98\xea0\x01\x82\xd3\xe4\x93\x02&*$/v1/{name=projects/*/savedQueries/*}B\xac\x01\n" +
"\x0fcom.bytebase.v1B\x16SavedQueryServiceProtoP\x01Z4github.com/bytebase/bytebase/backend/generated-go/v1\xa2\x02\x03BXX\xaa\x02\vBytebase.V1\xca\x02\vBytebase\\V1\xe2\x02\x17Bytebase\\V1\\GPBMetadata\xea\x02\fBytebase::V1b\x06proto3"
var (
diff --git a/backend/tests/login_audit_test.go b/backend/tests/login_audit_test.go
index 456acd23d1..1adcbb1559 100644
--- a/backend/tests/login_audit_test.go
+++ b/backend/tests/login_audit_test.go
@@ -2,9 +2,14 @@ package tests
import (
"context"
+ "crypto/hmac"
+ "crypto/sha256"
+ "database/sql"
+ "encoding/hex"
"regexp"
"strings"
"testing"
+ "time"
"connectrpc.com/connect"
"github.com/stretchr/testify/require"
@@ -126,6 +131,45 @@ func TestAuditLogFormat(t *testing.T) {
a.Len(updateProjectLogs.Msg.AuditLogs, 1)
a.Equal(ctl.project.Name, updateProjectLogs.Msg.AuditLogs[0].Resource)
+ savedQueryContent := "SELECT secret_audit_saved_query_content;"
+ savedQuery, err := ctl.savedQueryServiceClient.CreateSavedQuery(ctx, connect.NewRequest(&v1pb.CreateSavedQueryRequest{
+ Parent: ctl.project.Name,
+ SavedQuery: &v1pb.SavedQuery{
+ Title: "Audit saved query",
+ Content: []byte(savedQueryContent),
+ },
+ }))
+ a.NoError(err)
+
+ createSavedQueryLogs, err := ctl.auditLogServiceClient.SearchAuditLogs(ctx, connect.NewRequest(&v1pb.SearchAuditLogsRequest{
+ Parent: ctl.project.Name,
+ Filter: `method == "/bytebase.v1.SavedQueryService/CreateSavedQuery"`,
+ }))
+ a.NoError(err)
+ a.Len(createSavedQueryLogs.Msg.AuditLogs, 1)
+ a.Equal(ctl.project.Name, createSavedQueryLogs.Msg.AuditLogs[0].Resource)
+ a.True(strings.HasPrefix(createSavedQueryLogs.Msg.AuditLogs[0].Name, ctl.project.Name+"/auditLogs/"))
+ auditedCreateSavedQueryRequest := &v1pb.CreateSavedQueryRequest{}
+ a.NoError(common.ProtojsonUnmarshaler.Unmarshal([]byte(createSavedQueryLogs.Msg.AuditLogs[0].Request), auditedCreateSavedQueryRequest))
+ a.Empty(auditedCreateSavedQueryRequest.GetSavedQuery().GetContent())
+ auditedSavedQuery := &v1pb.SavedQuery{}
+ a.NoError(common.ProtojsonUnmarshaler.Unmarshal([]byte(createSavedQueryLogs.Msg.AuditLogs[0].Response), auditedSavedQuery))
+ a.Empty(auditedSavedQuery.Content)
+
+ _, err = ctl.savedQueryServiceClient.DeleteSavedQuery(ctx, connect.NewRequest(&v1pb.DeleteSavedQueryRequest{
+ Name: savedQuery.Msg.Name,
+ }))
+ a.NoError(err)
+
+ deleteSavedQueryLogs, err := ctl.auditLogServiceClient.SearchAuditLogs(ctx, connect.NewRequest(&v1pb.SearchAuditLogsRequest{
+ Parent: ctl.project.Name,
+ Filter: `method == "/bytebase.v1.SavedQueryService/DeleteSavedQuery"`,
+ }))
+ a.NoError(err)
+ a.Len(deleteSavedQueryLogs.Msg.AuditLogs, 1)
+ a.Equal(savedQuery.Msg.Name, deleteSavedQueryLogs.Msg.AuditLogs[0].Resource)
+ a.True(strings.HasPrefix(deleteSavedQueryLogs.Msg.AuditLogs[0].Name, ctl.project.Name+"/auditLogs/"))
+
// --- Part 2: Signup (workspace-scoped, allow_without_credential) ---
//
// The initial `signupAndLogin` in setup already produced a Signup audit
@@ -143,6 +187,315 @@ func TestAuditLogFormat(t *testing.T) {
a.NotContains(signupEntry.Request, "1024bytebase",
"plaintext password must never appear in Signup audit Request")
+ // --- Part 2.25: Email-code login audit events ---
+ // SendEmailLoginCode is attributed only for an existing active workspace
+ // member. Signup-capable targets are audited by Login after authentication.
+ workspaceName := workspace
+ invitedEmail := "[email protected]"
+ _, err = ctl.addMemberToWorkspaceIAM(ctx, workspace, "user:"+invitedEmail, "roles/workspaceMember")
+ a.NoError(err)
+
+ ctl.authInterceptor.token = ""
+ _, err = ctl.authServiceClient.SendEmailLoginCode(ctx, connect.NewRequest(&v1pb.SendEmailLoginCodeRequest{
+ Email: " [email protected] ",
+ Workspace: &workspaceName,
+ }))
+ a.Error(err)
+ a.Equal(connect.CodeFailedPrecondition, connect.CodeOf(err))
+ _, err = ctl.authServiceClient.SendEmailLoginCode(ctx, connect.NewRequest(&v1pb.SendEmailLoginCodeRequest{
+ Email: invitedEmail,
+ Workspace: &workspaceName,
+ }))
+ a.Error(err)
+ a.Equal(connect.CodeFailedPrecondition, connect.CodeOf(err))
+
+ ctl.authInterceptor.token = adminToken
+ _, err = ctl.authServiceClient.SendEmailLoginCode(ctx, connect.NewRequest(&v1pb.SendEmailLoginCodeRequest{
+ Email: "[email protected]",
+ Workspace: &workspaceName,
+ }))
+ a.Error(err)
+ a.Equal(connect.CodeFailedPrecondition, connect.CodeOf(err))
+
+ emailCodeLogs, err := ctl.auditLogServiceClient.SearchAuditLogs(ctx, connect.NewRequest(&v1pb.SearchAuditLogsRequest{
+ Parent: workspace,
+ Filter: `method == "/bytebase.v1.AuthService/SendEmailLoginCode"`,
+ }))
+ a.NoError(err)
+ a.Len(emailCodeLogs.Msg.AuditLogs, 1)
+ emailCodeByResource := make(map[string]*v1pb.AuditLog)
+ for _, auditLog := range emailCodeLogs.Msg.AuditLogs {
+ emailCodeByResource[auditLog.Resource] = auditLog
+ }
+ a.Contains(emailCodeByResource, "[email protected]")
+ a.Equal(v1pb.AuditLog_INFO, emailCodeByResource["[email protected]"].Severity)
+ a.Equal(int32(connect.CodeFailedPrecondition), emailCodeByResource["[email protected]"].GetStatus().GetCode())
+ a.Empty(emailCodeByResource[invitedEmail], "an invite without an account has no SendEmailLoginCode audit row")
+ a.Empty(emailCodeByResource["[email protected]"])
+
+ // --- Part 2.5: Password reset security events ---
+ // Only active end users with a validated workspace are auditable. The
+ // endpoint still returns success for every target to prevent enumeration.
+ deletedUser, err := ctl.userServiceClient.CreateUser(ctx, connect.NewRequest(&v1pb.CreateUserRequest{
+ User: &v1pb.User{Email: "[email protected]", Title: "Deleted reset user", Password: "1024bytebase"},
+ }))
+ a.NoError(err)
+ _, err = ctl.userServiceClient.DeleteUser(ctx, connect.NewRequest(&v1pb.DeleteUserRequest{Name: deletedUser.Msg.Name}))
+ a.NoError(err)
+
+ serviceAccount, err := ctl.serviceAccountServiceClient.CreateServiceAccount(ctx, connect.NewRequest(&v1pb.CreateServiceAccountRequest{
+ Parent: workspace,
+ ServiceAccountId: "audit-reset",
+ ServiceAccount: &v1pb.ServiceAccount{Title: "Audit reset service account"},
+ }))
+ a.NoError(err)
+ workloadIdentity, err := ctl.workloadIdentityServiceClient.CreateWorkloadIdentity(ctx, connect.NewRequest(&v1pb.CreateWorkloadIdentityRequest{
+ Parent: workspace,
+ WorkloadIdentityId: "audit-reset",
+ WorkloadIdentity: &v1pb.WorkloadIdentity{
+ Title: "Audit reset workload identity",
+ WorkloadIdentityConfig: &v1pb.WorkloadIdentityConfig{
+ ProviderType: v1pb.WorkloadIdentityConfig_GITHUB,
+ AllowedAudiences: []string{"audit-reset"},
+ SubjectPattern: "repo:bytebase/bytebase:*",
+ },
+ },
+ }))
+ a.NoError(err)
+
+ _, err = ctl.addMemberToWorkspaceIAM(ctx, workspace, common.AllUsers, "roles/workspaceMember")
+ a.NoError(err)
+
+ passwordResetTargets := []string{
+ deletedUser.Msg.Email,
+ serviceAccount.Msg.Email,
+ workloadIdentity.Msg.Email,
+ }
+ ctl.authInterceptor.token = ""
+ for _, email := range passwordResetTargets {
+ _, err := ctl.authServiceClient.RequestPasswordReset(ctx, connect.NewRequest(&v1pb.RequestPasswordResetRequest{
+ Email: email,
+ Workspace: &workspaceName,
+ }))
+ a.NoError(err, "password-reset request must not reveal target validity")
+ }
+ _, err = ctl.authServiceClient.RequestPasswordReset(ctx, connect.NewRequest(&v1pb.RequestPasswordResetRequest{
+ Email: "[email protected]",
+ }))
+ a.NoError(err, "no-workspace password-reset request must preserve existing behavior")
+ ctl.authInterceptor.token = adminToken
+ for _, email := range passwordResetTargets[1:] {
+ _, err := ctl.authServiceClient.RequestPasswordReset(ctx, connect.NewRequest(&v1pb.RequestPasswordResetRequest{
+ Email: email,
+ Workspace: &workspaceName,
+ }))
+ a.NoError(err, "authenticated password-reset request must not reveal target validity")
+ }
+ _, err = ctl.authServiceClient.RequestPasswordReset(ctx, connect.NewRequest(&v1pb.RequestPasswordResetRequest{
+ Email: "[email protected]",
+ }))
+ a.NoError(err, "authenticated no-workspace request must preserve existing behavior")
+
+ requestResetLogs, err := ctl.auditLogServiceClient.SearchAuditLogs(ctx, connect.NewRequest(&v1pb.SearchAuditLogsRequest{
+ Parent: workspace,
+ Filter: `method == "/bytebase.v1.AuthService/RequestPasswordReset"`,
+ }))
+ a.NoError(err)
+ requestResetByEmail := make(map[string][]*v1pb.AuditLog)
+ for _, auditLog := range requestResetLogs.Msg.AuditLogs {
+ requestResetByEmail[auditLog.Resource] = append(requestResetByEmail[auditLog.Resource], auditLog)
+ }
+ a.Len(requestResetByEmail["[email protected]"], 1,
+ "only the workspace-bound request for the active end user is auditable")
+ for _, email := range passwordResetTargets[1:] {
+ a.Empty(requestResetByEmail[email], "non-end-user target %q must not produce an audit row", email)
+ }
+ requestResetPayload := &v1pb.RequestPasswordResetRequest{}
+ a.NoError(common.ProtojsonUnmarshaler.Unmarshal([]byte(requestResetByEmail["[email protected]"][0].Request), requestResetPayload))
+ a.Equal("[email protected]", requestResetPayload.Email)
+ a.Equal(workspace, requestResetPayload.GetWorkspace())
+
+ metadataDB, err := sql.Open("pgx", ctl.profile.PgURL)
+ a.NoError(err)
+ defer metadataDB.Close()
+ var authSecret string
+ a.NoError(metadataDB.QueryRowContext(ctx, `SELECT payload->>'authSecret' FROM server_config LIMIT 1`).Scan(&authSecret))
+ insertVerificationCode := func(email, purpose, code string, workspaceID sql.NullString) {
+ mac := hmac.New(sha256.New, []byte(authSecret))
+ _, err := mac.Write([]byte(code))
+ a.NoError(err)
+ _, err = metadataDB.ExecContext(ctx, `
+ INSERT INTO email_verification_code (email, purpose, code_hash, expires_at, last_sent_at, workspace)
+ VALUES ($1, $2, $3, $4, $5, $6)
+ ON CONFLICT (email, purpose) DO UPDATE SET code_hash = EXCLUDED.code_hash, attempts = 0,
+ expires_at = EXCLUDED.expires_at, last_sent_at = EXCLUDED.last_sent_at, workspace = EXCLUDED.workspace
+ `, email, purpose, hex.EncodeToString(mac.Sum(nil)), time.Now().Add(time.Hour), time.Now(), workspaceID)
+ a.NoError(err)
+ }
+
+ workspaceID, err := common.GetWorkspaceID(workspace)
+ a.NoError(err)
+ var invitedUserCount int
+ _, err = ctl.settingServiceClient.UpdateSetting(ctx, connect.NewRequest(&v1pb.UpdateSettingRequest{
+ Setting: &v1pb.Setting{
+ Name: "settings/" + v1pb.Setting_EMAIL.String(),
+ Value: &v1pb.SettingValue{Value: &v1pb.SettingValue_Email{Email: &v1pb.EmailSetting{
+ Type: v1pb.EmailSetting_SMTP,
+ Config: &v1pb.EmailSetting_Smtp{Smtp: &v1pb.EmailSetting_SMTPConfig{
+ Host: "localhost",
+ Port: 1,
+ Encryption: v1pb.EmailSetting_SMTPConfig_ENCRYPTION_NONE,
+ Authentication: v1pb.EmailSetting_SMTPConfig_AUTHENTICATION_NONE,
+ }},
+ }}},
+ },
+ AllowMissing: true,
+ UpdateMask: &fieldmaskpb.FieldMask{Paths: []string{
+ "value.email.from",
+ "value.email.type",
+ "value.email.smtp",
+ }},
+ }))
+ a.NoError(err)
+ _, err = ctl.settingServiceClient.UpdateSetting(ctx, connect.NewRequest(&v1pb.UpdateSettingRequest{
+ Setting: &v1pb.Setting{
+ Name: "settings/" + v1pb.Setting_WORKSPACE_PROFILE.String(),
+ Value: &v1pb.SettingValue{Value: &v1pb.SettingValue_WorkspaceProfile{WorkspaceProfile: &v1pb.WorkspaceProfileSetting{
+ AllowEmailCodeSignin: true,
+ }}},
+ },
+ UpdateMask: &fieldmaskpb.FieldMask{Paths: []string{
+ "value.workspace_profile.allow_email_code_signin",
+ }},
+ }))
+ a.NoError(err)
+ loginCode := "765432"
+ insertVerificationCode(invitedEmail, "LOGIN", loginCode, sql.NullString{String: workspaceID, Valid: true})
+ ctl.authInterceptor.token = ""
+ _, err = ctl.authServiceClient.Login(ctx, connect.NewRequest(&v1pb.LoginRequest{
+ Email: invitedEmail,
+ EmailCode: &loginCode,
+ Workspace: &workspaceName,
+ }))
+ a.NoError(err)
+ ctl.authInterceptor.token = adminToken
+ a.NoError(metadataDB.QueryRowContext(ctx, `SELECT COUNT(*) FROM principal WHERE email = $1`, invitedEmail).Scan(&invitedUserCount))
+ a.Equal(1, invitedUserCount)
+ loginAuditLogs, err = ctl.auditLogServiceClient.SearchAuditLogs(ctx, connect.NewRequest(&v1pb.SearchAuditLogsRequest{
+ Parent: workspace,
+ Filter: `method == "/bytebase.v1.AuthService/Login"`,
+ OrderBy: "create_time desc",
+ }))
+ a.NoError(err)
+ var invitedLoginAudit *v1pb.AuditLog
+ for _, auditLog := range loginAuditLogs.Msg.AuditLogs {
+ if auditLog.Resource == invitedEmail {
+ invitedLoginAudit = auditLog
+ break
+ }
+ }
+ a.NotNil(invitedLoginAudit, "successful email-code signup must be audited by Login")
+ invitedLoginRequest := &v1pb.LoginRequest{}
+ a.NoError(common.ProtojsonUnmarshaler.Unmarshal([]byte(invitedLoginAudit.Request), invitedLoginRequest))
+ a.Equal(invitedEmail, invitedLoginRequest.Email)
+ a.NotEqual(loginCode, invitedLoginRequest.GetEmailCode())
+ _, err = ctl.settingServiceClient.UpdateSetting(ctx, connect.NewRequest(&v1pb.UpdateSettingRequest{
+ Setting: &v1pb.Setting{
+ Name: "settings/" + v1pb.Setting_WORKSPACE_PROFILE.String(),
+ Value: &v1pb.SettingValue{Value: &v1pb.SettingValue_WorkspaceProfile{WorkspaceProfile: &v1pb.WorkspaceProfileSetting{}}},
+ },
+ UpdateMask: &fieldmaskpb.FieldMask{Paths: []string{
+ "value.workspace_profile.allow_email_code_signin",
+ }},
+ }))
+ a.NoError(err)
+
+ resetCode := "123456"
+ newPassword := "new-password-1024"
+ insertVerificationCode("[email protected]", "PASSWORD_RESET", resetCode, sql.NullString{String: workspaceID, Valid: true})
+ ctl.authInterceptor.token = ""
+ _, err = ctl.authServiceClient.ResetPassword(ctx, connect.NewRequest(&v1pb.ResetPasswordRequest{
+ Email: "[email protected]",
+ Code: resetCode,
+ NewPassword: newPassword,
+ }))
+ a.NoError(err)
+ ctl.authInterceptor.token = adminToken
+
+ resetLogs, err := ctl.auditLogServiceClient.SearchAuditLogs(ctx, connect.NewRequest(&v1pb.SearchAuditLogsRequest{
+ Parent: workspace,
+ Filter: `method == "/bytebase.v1.AuthService/ResetPassword"`,
+ }))
+ a.NoError(err)
+ a.Len(resetLogs.Msg.AuditLogs, 1)
+ a.Equal("[email protected]", resetLogs.Msg.AuditLogs[0].Resource)
+ resetPayload := &v1pb.ResetPasswordRequest{}
+ a.NoError(common.ProtojsonUnmarshaler.Unmarshal([]byte(resetLogs.Msg.AuditLogs[0].Request), resetPayload))
+ a.Equal("[email protected]", resetPayload.Email)
+ a.Empty(resetPayload.Code)
+ a.Empty(resetPayload.NewPassword)
+ a.NotContains(resetLogs.Msg.AuditLogs[0].Request, resetCode)
+ a.NotContains(resetLogs.Msg.AuditLogs[0].Request, newPassword)
+
+ failedResetCode := "654321"
+ failedPassword := "short"
+ insertVerificationCode("[email protected]", "PASSWORD_RESET", failedResetCode, sql.NullString{String: workspaceID, Valid: true})
+ ctl.authInterceptor.token = ""
+ _, resetErr := ctl.authServiceClient.ResetPassword(ctx, connect.NewRequest(&v1pb.ResetPasswordRequest{
+ Email: "[email protected]",
+ Code: failedResetCode,
+ NewPassword: failedPassword,
+ }))
+ a.Error(resetErr, "password policy must reject a short password")
+ ctl.authInterceptor.token = adminToken
+ resetLogs, err = ctl.auditLogServiceClient.SearchAuditLogs(ctx, connect.NewRequest(&v1pb.SearchAuditLogsRequest{
+ Parent: workspace,
+ Filter: `method == "/bytebase.v1.AuthService/ResetPassword"`,
+ }))
+ a.NoError(err)
+ a.Len(resetLogs.Msg.AuditLogs, 2, "post-verification failures retain the validated workspace audit parent")
+ var failedResetLog *v1pb.AuditLog
+ for _, auditLog := range resetLogs.Msg.AuditLogs {
+ if auditLog.Status != nil {
+ failedResetLog = auditLog
+ break
+ }
+ }
+ a.NotNil(failedResetLog)
+ a.Equal(int32(connect.CodeInvalidArgument), failedResetLog.Status.Code)
+ a.NotContains(failedResetLog.Request, failedResetCode)
+ a.NotContains(failedResetLog.Request, failedPassword)
+
+ noWorkspaceUser, err := ctl.userServiceClient.CreateUser(ctx, connect.NewRequest(&v1pb.CreateUserRequest{
+ User: &v1pb.User{Email: "[email protected]", Title: "No workspace reset", Password: "1024bytebase"},
+ }))
+ a.NoError(err)
+ insertVerificationCode(noWorkspaceUser.Msg.Email, "PASSWORD_RESET", resetCode, sql.NullString{})
+ ctl.authInterceptor.token = ""
+ _, err = ctl.authServiceClient.ResetPassword(ctx, connect.NewRequest(&v1pb.ResetPasswordRequest{
+ Email: noWorkspaceUser.Msg.Email,
+ Code: resetCode,
+ NewPassword: newPassword,
+ }))
+ a.NoError(err, "no-workspace reset must preserve existing API behavior")
+ ctl.authInterceptor.token = adminToken
+ insertVerificationCode(noWorkspaceUser.Msg.Email, "PASSWORD_RESET", resetCode, sql.NullString{})
+ _, err = ctl.authServiceClient.ResetPassword(ctx, connect.NewRequest(&v1pb.ResetPasswordRequest{
+ Email: noWorkspaceUser.Msg.Email,
+ Code: resetCode,
+ NewPassword: "another-new-password-1024",
+ }))
+ a.NoError(err, "authenticated no-workspace reset must preserve existing API behavior")
+ resetLogs, err = ctl.auditLogServiceClient.SearchAuditLogs(ctx, connect.NewRequest(&v1pb.SearchAuditLogsRequest{
+ Parent: workspace,
+ Filter: `method == "/bytebase.v1.AuthService/ResetPassword"`,
+ }))
+ a.NoError(err)
+ a.Len(resetLogs.Msg.AuditLogs, 2, "a reset code without workspace context has no valid audit parent")
+
// --- Part 2.5: Denied Signup is still audited ---
//
// Regression guard for #20024 (discussion_r3089978499): Signup failures
diff --git a/docs/superpowers/plans/2026-08-12-v1-api-audit-coverage.md b/docs/superpowers/plans/2026-08-12-v1-api-audit-coverage.md
index c830199b86..4259d27e21 100644
--- a/docs/superpowers/plans/2026-08-12-v1-api-audit-coverage.md
+++ b/docs/superpowers/plans/2026-08-12-v1-api-audit-coverage.md
@@ -2,7 +2,7 @@
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
-**Goal:** Add reliable, non-secret-bearing audit records for the uncovered V1 security and mutation APIs while explicitly preserving the intentional opt-outs for high-volume reads, synchronization, token refresh, and worksheet autosave.
+**Goal:** Add reliable, non-secret-bearing audit records for the uncovered V1 security and mutation APIs while explicitly preserving the intentional opt-outs for high-volume reads, synchronization, token refresh, and saved query autosave.
**Architecture:** Keep the existing proto-driven audit interceptor as the single audit path. Each covered RPC receives `option (bytebase.v1.audit) = true`; `backend/api/v1/audit.go` remains responsible for canonical resource extraction and cloning/redacting request and response messages before serialization. Standard resource extraction reuses the method-aware proto reflection helper already shared with ACL evaluation, while explicit audit cases are reserved for canonical create names and non-standard request shapes. Unauthenticated handlers resolve a validated workspace through `common.SetAuditWorkspaceID`, and focused end-to-end tests verify that annotations result in persisted rows rather than merely changing descriptors.
@@ -10,14 +10,14 @@
## Global Constraints
-- Never put credentials, tokens, raw SQL, AI prompts, worksheet content, exported files, license text, webhook URLs, or payment-session data in an audit request or response.
+- Never put credentials, tokens, raw SQL, AI prompts, saved query content, exported files, license text, webhook URLs, or payment-session data in an audit request or response.
- Every redactor must clone before modification; `getRequestString` and `getResponseString` must not mutate live handler messages.
- Audit parents must be canonical `workspaces/{workspace}` or `projects/{project}` names; project-scoped actions must not leak into the workspace-scoped audit stream.
-- Keep `Refresh`, `SyncDatabase`, `BatchSyncDatabases`, `SyncInstance`, `BatchSyncInstances`, `UpdateWorksheet`, `UpdateWorksheetOrganizer`, and `BatchUpdateWorksheetOrganizer` unaudited in this change.
+- Keep `Refresh`, `SyncDatabase`, `BatchSyncDatabases`, `SyncInstance`, `BatchSyncInstances`, `UpdateSavedQuery`, `UpdateSavedQueryOrganizer`, and `BatchUpdateSavedQueryOrganizer` unaudited in this change.
- Keep `SwitchWorkspace` unaudited because it changes session/token context rather than workspace resources or authorization grants.
- Keep `TestWebhook` unaudited because it sends a synthetic outbound probe without changing persisted project configuration.
- Keep POST-based searches, CEL parse/deparse, schema diffs, release checks, instance database discovery, and rollback previews unaudited.
-- Do not add blanket auditing to worksheet reads in the legacy service. The saved-query migration owns metadata-only search and conditional auditing for another user's private content.
+- Do not add blanket auditing to saved query reads. The saved-query privacy model owns metadata-only search and conditional auditing for another user's private content.
- Run the repository's proto workflow after every proto batch: `buf format -w proto`, `buf lint proto`, then `(cd proto && buf generate)` so later commands remain at the repository root.
- Run `gofmt -w` on modified Go files and the focused Go tests after each task. Run the full Go lint/build gates before completion.
@@ -30,7 +30,7 @@ Audit these 27 RPCs in this plan:
| Family | RPCs |
| --- | --- |
| Core lifecycle | `SetupSample`, `CreateProject`, `UpdateProject`, `RunPlanChecks`, `CancelPlanCheckRun`, `DeleteRelease`, `UndeleteRelease`, `BatchCreateRevisions`, `DeleteRevision` |
-| Content-bearing lifecycle | `CreateRelease`, `UpdateRelease`, `CreateWorksheet`, `DeleteWorksheet` |
+| Content-bearing lifecycle | `CreateRelease`, `UpdateRelease`, `CreateSavedQuery`, `DeleteSavedQuery` |
| Authentication | `RequestPasswordReset`, `ResetPassword` |
| Project webhooks | `AddWebhook`, `UpdateWebhook`, `RemoveWebhook` |
| Subscription | `UploadLicense`, `CreatePurchase`, `UpdatePurchase`, `CancelPurchase`, `ExportVCSProviderUsers` |
@@ -59,7 +59,7 @@ The password-reset RPCs have one deliberate limitation: when the unauthenticated
- Consumes: existing `getResourceFromSingleRequest`, `maskedString`, `proto.CloneOf`, and proto `bytebase.v1.audit` extension.
- Produces: audited descriptors, canonical resource names, and clone-first project payload redaction for nine lifecycle RPCs.
-- [ ] **Step 1: Extend the resource extraction test first**
+- [x] **Step 1: Extend the resource extraction test first**
Add cases to `TestProjectLifecycleAuditResource`, rename it to `TestLifecycleAuditResource`, and include the matching full RPC procedure in each case:
@@ -79,7 +79,7 @@ Add cases to `TestProjectLifecycleAuditResource`, rename it to `TestLifecycleAud
Change the assertion to `require.Equal(t, test.want, getRequestResource(test.request, test.method))`.
-- [ ] **Step 2: Run the unit test and verify the new cases fail**
+- [x] **Step 2: Run the unit test and verify the new cases fail**
Run:
@@ -89,7 +89,7 @@ go test ./backend/api/v1 -run '^TestLifecycleAuditResource$' -count=1
Expected: FAIL because `getRequestResource` does not yet accept the RPC method or use descriptor metadata for standard request shapes.
-- [ ] **Step 3: Make resource extraction method-aware**
+- [x] **Step 3: Make resource extraction method-aware**
Pass the full RPC procedure from the interceptor into `getRequestResource`. Preserve explicit cases only where descriptor metadata cannot express the audit resource: authentication email, canonical create names, and non-standard field or batch shapes such as `UpdateDatabaseCatalog.catalog` and `BatchUpdateDatabases.parent`. For all standard annotated requests, extract the short RPC method name and reuse `getResourceFromSingleRequest`:
@@ -108,7 +108,7 @@ case *v1pb.CreateProjectRequest:
This keeps the audit-specific switch small while preserving plan, release, revision, IdP, data-source, setting, and other annotated resource names through the shared reflection path.
-- [ ] **Step 4: Add failing project payload redaction tests**
+- [x] **Step 4: Add failing project payload redaction tests**
In `backend/api/v1/audit_redaction_test.go`, add request cases for both project mutations with `secretSentinel` in a nested webhook URL:
@@ -124,7 +124,7 @@ In `backend/api/v1/audit_redaction_test.go`, add request cases for both project
Add a response case for `Project` with the same nested webhook URL. Extend `TestAuditRedactionDoesNotMutateInput` with a project response and assert its original webhook URL remains `secretSentinel` after serialization.
-- [ ] **Step 5: Run the redaction tests and verify they fail**
+- [x] **Step 5: Run the redaction tests and verify they fail**
```bash
go test ./backend/api/v1 -run '^TestAudit(Request|Response)RedactsCredentials$' -count=1
@@ -132,7 +132,7 @@ go test ./backend/api/v1 -run '^TestAudit(Request|Response)RedactsCredentials$'
Expected: FAIL because project request and response payloads currently serialize webhook URLs unchanged.
-- [ ] **Step 6: Implement clone-first project redaction**
+- [x] **Step 6: Implement clone-first project redaction**
Add the nested webhook and project redactors to `backend/api/v1/audit.go`:
@@ -162,7 +162,7 @@ func redactProject(p *v1pb.Project) *v1pb.Project {
Register `CreateProjectRequest` and `UpdateProjectRequest` in `getRequestString`, cloning the outer request and replacing its nested project with `redactProject`. Register `Project` in `getResponseString`. Preserve project IDs, update masks, names, webhook names/types/titles, and all other non-secret fields.
-- [ ] **Step 7: Annotate the low-risk RPCs**
+- [x] **Step 7: Annotate the low-risk RPCs**
Add this option inside each RPC block for `SetupSample`, `CreateProject`, `UpdateProject`, `RunPlanChecks`, `CancelPlanCheckRun`, `DeleteRelease`, `UndeleteRelease`, `BatchCreateRevisions`, and `DeleteRevision`:
@@ -170,7 +170,7 @@ Add this option inside each RPC block for `SetupSample`, `CreateProject`, `Updat
option (bytebase.v1.audit) = true;
```
-- [ ] **Step 8: Generate and run focused unit tests**
+- [x] **Step 8: Generate and run focused unit tests**
Run:
@@ -184,7 +184,7 @@ go test ./backend/api/v1 -run '^(TestLifecycleAuditResource|TestAudit(Request|Re
Expected: all commands PASS.
-- [ ] **Step 9: Add persistence regression coverage for the original symptom**
+- [x] **Step 9: Add persistence regression coverage for the original symptom**
In `backend/tests/login_audit_test.go`, reuse `ctl.project`, which `StartServerWithExternalPg` already created through `ProjectService.CreateProject`. Query workspace audit logs with:
@@ -202,7 +202,7 @@ Filter: `method == "/bytebase.v1.InstanceService/CreateInstance"`,
Assert a row exists with `Resource == projectInstance.Name`. This pins the distinction between “descriptor is annotated” and “row was actually persisted.”
-- [ ] **Step 10: Run the lifecycle integration tests**
+- [x] **Step 10: Run the lifecycle integration tests**
Run:
@@ -212,7 +212,7 @@ go test -v -count=1 ./backend/tests -run '^(TestAuditLogFormat|TestProjectInstan
Expected: PASS, including persisted `CreateProject`, `UpdateProject`, and `CreateInstance` rows.
-- [ ] **Step 11: Commit the low-risk batch**
+- [x] **Step 11: Commit the low-risk batch**
```bash
git add proto/v1/v1/actuator_service.proto proto/v1/v1/project_service.proto proto/v1/v1/plan_service.proto proto/v1/v1/release_service.proto proto/v1/v1/revision_service.proto backend/api/v1/audit.go backend/api/v1/audit_test.go backend/api/v1/audit_redaction_test.go backend/tests/login_audit_test.go backend/tests/project_instance_test.go backend/generated-go/v1 frontend/src/types/proto-es/v1 proto/gen/grpc-doc backend/api/mcp/gen
@@ -221,11 +221,11 @@ git commit -m "feat: audit core lifecycle APIs"
---
-### Task 2: Release and Worksheet Content Redaction
+### Task 2: Release and Saved Query Content Redaction
**Files:**
- Modify: `proto/v1/v1/release_service.proto`
-- Modify: `proto/v1/v1/worksheet_service.proto`
+- Modify: `proto/v1/v1/saved_query_service.proto`
- Modify: `backend/api/v1/audit.go`
- Modify: `backend/api/v1/audit_redaction_test.go`
- Modify: `backend/api/v1/audit_test.go`
@@ -234,22 +234,24 @@ git commit -m "feat: audit core lifecycle APIs"
**Interfaces:**
- Consumes: `getRequestString`, `getResponseString`, `maskedString`, and `proto.CloneOf`.
-- Produces: `redactRelease`, `redactWorksheet`, and redacted create/update request handling.
+- Produces: `redactRelease`, `redactSavedQuery`, and redacted create/update request handling.
-- [ ] **Step 1: Add failing request and response redaction cases**
+- [x] **Step 1: Add failing request and response redaction cases**
-Add `secretSentinel` as a release statement and worksheet content in `TestAuditRequestRedactsCredentials`, and add a worksheet response case in `TestAuditResponseRedactsCredentials`:
+Add `secretSentinel` as a release statement and saved query content in `TestAuditRequestRedactsCredentials`, and add a saved query response case in `TestAuditResponseRedactsCredentials`:
```go
{"release SQL", &v1pb.CreateReleaseRequest{Release: &v1pb.Release{Files: []*v1pb.Release_File{{Statement: []byte(secretSentinel)}}}}},
-{"worksheet SQL", &v1pb.CreateWorksheetRequest{Worksheet: &v1pb.Worksheet{Content: []byte(secretSentinel)}}},
+{"saved query SQL", &v1pb.CreateSavedQueryRequest{SavedQuery: &v1pb.SavedQuery{Content: []byte(secretSentinel)}}},
```
```go
-{name: "worksheet response SQL", response: &v1pb.Worksheet{Content: []byte(secretSentinel)}},
+{name: "saved query response SQL", response: &v1pb.SavedQuery{Content: []byte(secretSentinel)}},
```
-- [ ] **Step 2: Run the redaction tests and verify they fail**
+Because protobuf `bytes` fields are base64-encoded by `protojson`, assert that neither `secretSentinel` nor its base64 representation appears in the serialized payload.
+
+- [x] **Step 2: Run the redaction tests and verify they fail**
```bash
go test ./backend/api/v1 -run '^TestAudit(Request|Response)RedactsCredentials$' -count=1
@@ -257,7 +259,7 @@ go test ./backend/api/v1 -run '^TestAudit(Request|Response)RedactsCredentials$'
Expected: FAIL because the sentinel appears in serialized audit payloads.
-- [ ] **Step 3: Implement clone-first content redactors**
+- [x] **Step 3: Implement clone-first content redactors**
Add these helpers to `audit.go`:
@@ -273,7 +275,7 @@ func redactRelease(r *v1pb.Release) *v1pb.Release {
return cloned
}
-func redactWorksheet(r *v1pb.Worksheet) *v1pb.Worksheet {
+func redactSavedQuery(r *v1pb.SavedQuery) *v1pb.SavedQuery {
if r == nil {
return nil
}
@@ -283,23 +285,23 @@ func redactWorksheet(r *v1pb.Worksheet) *v1pb.Worksheet {
}
```
-Add request switch cases for `CreateReleaseRequest`, `UpdateReleaseRequest`, and `CreateWorksheetRequest`, preserving all non-content fields and update masks. Add response switch cases for `Release` and `Worksheet` so future handler changes cannot expose statement/content fields through the audit response.
+Add request switch cases for `CreateReleaseRequest`, `UpdateReleaseRequest`, and `CreateSavedQueryRequest`, preserving all non-content fields and update masks. Add response switch cases for `Release` and `SavedQuery` so future handler changes cannot expose statement/content fields through the audit response.
-- [ ] **Step 4: Verify resource extraction, project ownership, and annotations**
+- [x] **Step 4: Verify resource extraction, project ownership, and annotations**
-Add method-aware `TestLifecycleAuditResource` cases for release and worksheet requests. Their annotated parent, name, and nested resource fields must be resolved by the shared reflection path without adding audit-specific type-switch branches.
+Add method-aware `TestLifecycleAuditResource` cases for release and saved query requests. Their annotated parent, name, and nested resource fields must be resolved by the shared reflection path without adding audit-specific type-switch branches. Declare `SavedQuery` as `bytebase.com/SavedQuery`, and annotate `CreateSavedQueryRequest.parent` and `DeleteSavedQueryRequest.name` with their canonical resource references.
-Add `audit = true` to `CreateRelease`, `UpdateRelease`, `CreateWorksheet`, and `DeleteWorksheet`.
+Add `audit = true` to `CreateRelease`, `UpdateRelease`, `CreateSavedQuery`, and `DeleteSavedQuery`.
-Ensure both worksheet lifecycle RPCs publish their owning project through the authorization context so the interceptor persists their audit rows under `projects/{project}`, not the workspace fallback. The implementation may use the existing declarative resource metadata or an equivalent project-resolution path; the required contract is project-scoped audit ownership.
+Ensure both saved query lifecycle RPCs publish their owning project through the authorization context so the interceptor persists their audit rows under `projects/{project}`, not the workspace fallback. The implementation may use the existing declarative resource metadata or an equivalent project-resolution path; the required contract is project-scoped audit ownership.
-- [ ] **Step 5: Verify redaction and persisted ownership**
+- [x] **Step 5: Verify redaction and persisted ownership**
-Extend `TestAuditRedactionDoesNotMutateInput` with a release and worksheet, call the corresponding audit serializer, and assert the original statement/content still equals `secretSentinel`.
+Extend `TestAuditRedactionDoesNotMutateInput` with a release and saved query, call the corresponding audit serializer, and assert the original statement/content still equals `secretSentinel`.
-Extend the audit integration coverage to create and delete a worksheet, then query the project audit stream and assert both rows use `projects/{project}` as their parent. This test must fail if either action is filed only in the workspace audit stream.
+Extend the audit integration coverage to create and delete a saved query, then query the project audit stream and assert both rows use `projects/{project}` as their parent. This test must fail if either action is filed only in the workspace audit stream.
-- [ ] **Step 6: Generate and test**
+- [x] **Step 6: Generate and test**
```bash
buf format -w proto
@@ -310,13 +312,13 @@ go test ./backend/api/v1 -run '^(TestAudit(Request|Response)RedactsCredentials|T
go test -v -count=1 ./backend/tests -run '^TestAuditLogFormat$' -timeout 10m
```
-Expected: PASS, no sentinel in any serialized payload, and worksheet lifecycle rows are discoverable in the owning project's audit stream.
+Expected: PASS, no sentinel in any serialized payload, and saved query lifecycle rows are discoverable in the owning project's audit stream.
-- [ ] **Step 7: Commit the content-bearing batch**
+- [x] **Step 7: Commit the content-bearing batch**
```bash
-git add proto/v1/v1/release_service.proto proto/v1/v1/worksheet_service.proto backend/api/v1/audit.go backend/api/v1/audit_redaction_test.go backend/api/v1/audit_test.go backend/tests/login_audit_test.go backend/generated-go/v1 frontend/src/types/proto-es/v1 proto/gen/grpc-doc backend/api/mcp/gen
-git commit -m "feat: audit release and worksheet lifecycle"
+git add proto/v1/v1/release_service.proto proto/v1/v1/saved_query_service.proto backend/api/v1/audit.go backend/api/v1/audit_redaction_test.go backend/api/v1/audit_test.go backend/tests/login_audit_test.go backend/generated-go/v1 frontend/src/types/proto-es/v1 proto/gen/grpc-doc backend/api/mcp/gen
+git commit -m "feat: audit release and saved query lifecycle"
```
---
@@ -335,11 +337,11 @@ git commit -m "feat: audit release and worksheet lifecycle"
- Consumes: `common.SetAuditWorkspaceID`, `parseOptionalWorkspace`, and existing `redactLoginResponse`.
- Produces: `redactResetPasswordRequest` and validated workspace attribution for password-reset events.
-- [ ] **Step 1: Add failing credential-redaction tests**
+- [x] **Step 1: Add failing credential-redaction tests**
Add a request case containing the sentinel in password-reset `code` and `new_password`. Assert the email remains visible while both secrets are absent.
-- [ ] **Step 2: Implement request redactors**
+- [x] **Step 2: Implement request redactors**
```go
func redactResetPasswordRequest(r *v1pb.ResetPasswordRequest) *v1pb.ResetPasswordRequest {
@@ -355,31 +357,36 @@ func redactResetPasswordRequest(r *v1pb.ResetPasswordRequest) *v1pb.ResetPasswor
Register the helper in `getRequestString`. Keep `RequestPasswordResetRequest` unchanged because email and workspace are audit identifiers, not credentials.
-- [ ] **Step 3: Attribute successful and target-valid auth events**
+- [x] **Step 3: Attribute successful and target-valid auth events**
For `RequestPasswordReset`, set the audit workspace only after establishing both of these facts:
- the normalized email belongs to an active `END_USER` account;
- the requested workspace is valid for that account under the existing membership rules.
+The password-reset delivery path must apply the same active `END_USER` check before resolving email configuration, storing a verification code, or sending email. Unknown, deleted, service-account, and workload-identity targets remain silent no-ops.
+
An `allUsers` workspace binding alone must not make an unknown, deleted, service-account, or workload-identity email auditable. Keep the endpoint's current always-success response and do not surface lookup failures; an absent, malformed, unknown, or invalid workspace produces no audit row.
+For both password-reset RPCs, the interceptor must accept only the workspace explicitly validated and announced by the handler. An authenticated caller's token workspace must not become a fallback audit parent when validation fails or no workspace was supplied.
+
For `ResetPassword`, attribute the event only to the validated non-empty workspace captured with the verification code. Set that workspace early enough that membership, password-policy, or update failures after successful code verification can be recorded. Do not invent or select an arbitrary workspace when the code has no workspace context; that path is the explicit no-workspace limitation described above.
-- [ ] **Step 4: Add audit annotations**
+- [x] **Step 4: Add audit annotations**
Add `audit = true` to `RequestPasswordReset` and `ResetPassword`.
-- [ ] **Step 5: Add auth persistence tests**
+- [x] **Step 5: Add auth persistence tests**
Extend `backend/tests/login_audit_test.go` to assert:
- a workspace-bound successful password reset row contains the email but neither the submitted code nor new password;
- a workspace-bound request for an active end user produces a row while preserving the endpoint's always-success response;
- unknown, deleted, service-account, and workload-identity emails do not create request audit rows, including when the workspace grants `allUsers`;
+- those exclusions also hold when the caller supplies a valid access token;
- no-workspace request and reset flows preserve their existing API behavior but create no audit row, documenting the storage limitation explicitly.
-- [ ] **Step 6: Generate and run auth tests**
+- [x] **Step 6: Generate and run auth tests**
```bash
buf format -w proto
@@ -394,6 +401,8 @@ Expected: PASS with no auth credential present in stored request/response JSON.
- [ ] **Step 7: Commit the authentication batch**
+Left uncommitted for the author to review and commit explicitly.
+
```bash
git add proto/v1/v1/auth_service.proto backend/api/v1/auth_service.go backend/api/v1/audit.go backend/api/v1/audit_redaction_test.go backend/tests/login_audit_test.go backend/generated-go/v1 frontend/src/types/proto-es/v1 proto/gen/grpc-doc backend/api/mcp/gen
git commit -m "feat: audit authentication security events"
@@ -401,6 +410,60 @@ git commit -m "feat: audit authentication security events"
---
+### Task 3A: Email-Code Login Audit Attribution
+
+**Files:**
+- Modify: `backend/api/v1/auth_service.go`
+- Modify: `backend/api/v1/audit.go`
+- Test: `backend/api/v1/audit_test.go`
+- Test: `backend/tests/login_audit_test.go`
+
+**Interfaces:**
+- Consumes: the existing `SendEmailLoginCode` audit annotation, `store.GetAccountByEmail`, `store.FindWorkspace`, and `common.SetAuditWorkspaceID`.
+- Produces: workspace attribution for `SendEmailLoginCode` without changing its delivery or signup behavior.
+
+- [x] **Step 1: Attribute requests for existing workspace users**
+
+Normalize the requested email and parse the optional workspace once. Announce that workspace to the audit interceptor only when the email belongs to an active `END_USER` account that is a member of the requested workspace under the existing membership rules.
+
+This lookup affects audit attribution only. The parsed workspace ID is still used by the existing email-setting and verification-code paths, and the RPC keeps its existing login and auto-signup behavior.
+
+- [x] **Step 2: Keep signup-capable requests out of the send audit**
+
+An email that does not yet have an active workspace account, including an invited email that may later sign up, does not create a `SendEmailLoginCode` audit row because there is no existing user membership to attribute. Supplying an authenticated caller token must not make such a target auditable.
+
+The successful `Login` request is audited after email-code authentication resolves or creates the user and determines the workspace. This provides the durable security event for email-code signup.
+
+Delivery eligibility and self-host email-code signup policy require separate design discussion and are explicitly outside this audit-only task.
+
+- [x] **Step 3: Constrain and define audit attribution**
+
+`SendEmailLoginCode` may use only the workspace explicitly validated and announced by the handler. Do not fall back to ACL resources or the caller token for this unauthenticated target operation.
+
+For an attributed workspace-bound request, the audit row contains:
+
+- `Parent`: the validated `workspaces/{workspace}`;
+- `Resource`: the normalized email address;
+- `Request`: email and workspace, with no verification code because this RPC does not accept one;
+- `Response`: the empty response on success;
+- the standard method, caller when authenticated, status, latency, request metadata, and MCP delegation fields.
+
+An unknown, inactive, non-user, non-member, or workspace-less target produces no row because there is no validated workspace parent. An authenticated caller's token workspace must not change that result.
+
+- [x] **Step 4: Add regression coverage**
+
+Extend resource extraction coverage for normalized `SendEmailLoginCodeRequest.email`. Extend the audit integration test to cover an active member, an invited email without an account, an authenticated unknown-address request, and the subsequent successful email-code `Login` audit row.
+
+```bash
+gofmt -w backend/api/v1/auth_service.go backend/api/v1/audit.go backend/api/v1/audit_test.go backend/tests/login_audit_test.go
+go test ./backend/api/v1 -run '^TestLifecycleAuditResource$' -count=1
+go test -v -count=1 ./backend/tests -run '^TestAuditLogFormat$' -timeout 10m
+```
+
+Expected: the existing member request creates a workspace `SendEmailLoginCode` audit row; signup-capable targets do not; and a successful email-code signup creates a workspace `Login` audit row with the code redacted.
+
+---
+
### Task 4: Subscription and Export Audit Coverage
**Files:**
@@ -613,8 +676,8 @@ func TestRequiredAPIAuditCoverage(t *testing.T) {
"bytebase.v1.SubscriptionService.ExportVCSProviderUsers",
"bytebase.v1.SubscriptionService.UpdatePurchase",
"bytebase.v1.SubscriptionService.UploadLicense",
- "bytebase.v1.WorksheetService.CreateWorksheet",
- "bytebase.v1.WorksheetService.DeleteWorksheet",
+ "bytebase.v1.SavedQueryService.CreateSavedQuery",
+ "bytebase.v1.SavedQueryService.DeleteSavedQuery",
} {
t.Run(method, func(t *testing.T) {
requireAuditedMethod(t, method)
@@ -652,9 +715,9 @@ func TestIntentionalAPIAuditExclusions(t *testing.T) {
"bytebase.v1.InstanceService.BatchSyncInstances",
"bytebase.v1.InstanceService.SyncInstance",
"bytebase.v1.ProjectService.TestWebhook",
- "bytebase.v1.WorksheetService.BatchUpdateWorksheetOrganizer",
- "bytebase.v1.WorksheetService.UpdateWorksheet",
- "bytebase.v1.WorksheetService.UpdateWorksheetOrganizer",
+ "bytebase.v1.SavedQueryService.BatchUpdateSavedQueryOrganizer",
+ "bytebase.v1.SavedQueryService.UpdateSavedQuery",
+ "bytebase.v1.SavedQueryService.UpdateSavedQueryOrganizer",
} {
t.Run(method, func(t *testing.T) {
requireUnauditedMethod(t, method)
@@ -680,7 +743,7 @@ Add an “Audit annotation coverage” section to `docs/design/v1-api-audit-2026
- the deliberate exclusions and their reasons, including session-only workspace switching and non-mutating webhook tests;
- the rule that serializers must redact credentials/content before annotations are enabled;
- the workspace-resolution limitation for both unauthenticated password-reset RPCs;
-- the legacy worksheet-read deferral to the saved-query privacy model.
+- the saved-query read deferral to the saved-query privacy model.
- [ ] **Step 5: Run all required verification gates**
diff --git a/frontend/src/types/proto-es/v1/auth_service_pb.js b/frontend/src/types/proto-es/v1/auth_service_pb.js
index 1e18fcd00c..b137a1d89b 100644
--- a/frontend/src/types/proto-es/v1/auth_service_pb.js
+++ b/frontend/src/types/proto-es/v1/auth_service_pb.js
@@ -12,7 +12,7 @@ import { file_v1_user_service } from "./user_service_pb";
* Describes the file v1/auth_service.proto.
*/
export const file_v1_auth_service = /*@__PURE__*/
- fileDesc("ChV2MS9hdXRoX3NlcnZpY2UucHJvdG8SC2J5dGViYXNlLnYxItkCCgxMb2dpblJlcXVlc3QSDQoFZW1haWwYASABKAkSEAoIcGFzc3dvcmQYAiABKAkSCwoDd2ViGAMgASgIEhAKCGlkcF9uYW1lGAQgASgJEjkKC2lkcF9jb250ZXh0GAUgASgLMiQuYnl0ZWJhc2UudjEuSWRlbnRpdHlQcm92aWRlckNvbnRleHQSFQoIb3RwX2NvZGUYBiABKAlIAIgBARIaCg1yZWNvdmVyeV9jb2RlGAcgASgJSAGIAQESGwoObWZhX3RlbXBfdG9rZW4YCCABKAlIAogBARIXCgplbWFpbF9jb2RlGAkgASgJSAOIAQESFgoJd29ya3NwYWNlGAogASgJSASIAQFCCwoJX290cF9jb2RlQhAKDl9yZWNvdmVyeV9jb2RlQhEKD19tZmFfdGVtcF90b2tlbkINCgtfZW1haWxfY29kZUIMCgpfd29ya3NwYWNlIqwBChdJZGVudGl0eVByb3ZpZGVyQ29udGV4dBJECg5vYXV0aDJfY29udGV4dBgBIAEoCzIqLmJ5dGViYXNlLnYxLk9BdXRoMklkZW50aXR5UHJvdmlkZXJDb250ZXh0SAASQAoMb2lkY19jb250ZXh0GAIgASgLMiguYnl0ZWJhc2UudjEuT0lEQ0lkZW50aXR5UHJvdmlkZXJDb250ZXh0SABCCQoHY29udGV4dCItCh1PQXV0aDJJZGVudGl0eVByb3ZpZGVyQ29udGV4dBIMCgRjb2RlGAEgASgJIisKG09JRENJZGVudGl0eVByb3Zp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vdG9idWYuRW1wdHkiMIDqMAGg6jADgtPkkwIiOgEqIh0vdjEvYXV0aDpyZXF1ZXN0UGFzc3dvcmRSZXNldBJ1Cg1SZXNldFBhc3N3b3JkEiEuYnl0ZWJhc2UudjEuUmVzZXRQYXNzd29yZFJlcXVlc3QaFi5nb29nbGUucHJvdG9idWYuRW1wdHkiKYDqMAGg6jADgtPkkwIbOgEqIhYvdjEvYXV0aDpyZXNldFBhc3N3b3JkEogBChJTZW5kRW1haWxMb2dpbkNvZGUSJi5ieXRlYmFzZS52MS5TZW5kRW1haWxMb2dpbkNvZGVSZXF1ZXN0GhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5IjKA6jABmOowAaDqMAOC0+STAiA6ASoiGy92MS9hdXRoOnNlbmRFbWFpbExvZ2luQ29kZUKmAQoPY29tLmJ5dGViYXNlLnYxQhBBdXRoU2VydmljZVByb3RvUAFaNGdpdGh1Yi5jb20vYnl0ZWJhc2UvYnl0ZWJhc2UvYmFja2VuZC9nZW5lcmF0ZWQtZ28vdjGiAgNCWFiqAgtCeXRlYmFzZS5WMcoCC0J5dGViYXNlXFYx4gIXQnl0ZWJhc2VcVjFcR1BCTWV0YWRhdGHqAgxCeXRlYmFzZTo6VjFiBnByb3RvMw", [file_google_api_annotations, file_google_protobuf_empty, file_v1_annotation, file_v1_user_service]);
+ fileDesc("ChV2MS9hdXRoX3NlcnZpY2UucHJvdG8SC2J5dGViYXNlLnYxItkCCgxMb2dpblJlcXVlc3QSDQoFZW1haWwYASABKAkSEAoIcGFzc3dvcmQYAiABKAkSCwoDd2ViGAMgASgIEhAKCGlkcF9uYW1lGAQgASgJEjkKC2lkcF9jb250ZXh0GAUgASgLMiQuYnl0ZWJhc2UudjEuSWRlbnRpdHlQcm92aWRlckNvbnRleHQSFQoIb3RwX2NvZGUYBiABKAlIAIgBARIaCg1yZWNvdmVyeV9jb2RlGAcgASgJSAGIAQESGwoObWZhX3RlbXBfdG9rZW4YCCABKAlIAogBARIXCgplbWFp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c2VcVjHiAhdCeXRlYmFzZVxWMVxHUEJNZXRhZGF0YeoCDEJ5dGViYXNlOjpWMWIGcHJvdG8z", [file_google_api_annotations, file_google_protobuf_empty, file_v1_annotation, file_v1_user_service]);
/**
* Describes the message bytebase.v1.LoginRequest.
diff --git a/frontend/src/types/proto-es/v1/release_service_pb.js b/frontend/src/types/proto-es/v1/release_service_pb.js
index b839bfdda5..fc4ea2df08 100644
--- a/frontend/src/types/proto-es/v1/release_service_pb.js
+++ b/frontend/src/types/proto-es/v1/release_service_pb.js
@@ -16,7 +16,7 @@ import { file_v1_sql_service } from "./sql_service_pb";
* Describes the file v1/release_service.proto.
*/
export const file_v1_release_service = /*@__PURE__*/
- fileDesc("Chh2MS9yZWxlYXNlX3NlcnZpY2UucHJvdG8SC2J5dGViYXNlLnYxIj8KEUdldFJlbGVhc2VSZXF1ZXN0EioKBG5hbWUYASABKAlCHOBBAvpBFgoUYnl0ZWJhc2UuY29tL1JlbGVhc2UikAEKE0xpc3RSZWxlYXNlc1JlcXVlc3QSLAoGcGFyZW50GAEgASgJQhzgQQL6QRYKFGJ5dGViYXNlLmNvbS9Qcm9qZWN0EhEKCXBhZ2Vfc2l6ZRgCIAEoBRISCgpwYWdlX3Rva2VuGAMgASgJEhQKDHNob3dfZGVsZXRlZBgEIAEoCBIOCgZmaWx0ZXIYBSABKAkiVwoUTGlzdFJlbGVhc2VzUmVzcG9uc2USJgoIcmVsZWFzZXMYASADKAsyFC5ieXRlYmFzZS52MS5SZWxlYXNlEhcKD25leHRfcGFnZV90b2tlbhgCIAEoCSKqAQoUQ3JlYXRlUmVsZWFzZVJlcXVlc3QSLAoGcGFyZW50GAEgASgJQhzgQQL6QRYKFGJ5dGViYXNlLmNvbS9Qcm9qZWN0EioKB3JlbGVhc2UYAiABKAsyFC5ieXRlYmFzZS52MS5SZWxlYXNlQgPgQQISGwoTcmVsZWFzZV9pZF90ZW1wbGF0ZRgDIAEoCRIbChNyZWxlYXNlX2lkX3RpbWV6b25l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behavior, file_google_api_resource, file_google_protobuf_empty, file_google_protobuf_field_mask, file_google_protobuf_timestamp, file_v1_annotation, file_v1_common, file_v1_sql_service]);
+ fileDesc("Chh2MS9yZWxlYXNlX3NlcnZpY2UucHJvdG8SC2J5dGViYXNlLnYxIj8KEUdldFJlbGVhc2VSZXF1ZXN0EioKBG5hbWUYASABKAlCHOBBAvpBFgoUYnl0ZWJhc2UuY29tL1JlbGVhc2UikAEKE0xpc3RSZWxlYXNlc1JlcXVlc3QSLAoGcGFyZW50GAEgASgJQhzgQQL6QRYKFGJ5dGViYXNlLmNvbS9Qcm9qZWN0EhEKCXBhZ2Vfc2l6ZRgCIAEoBRISCgpwYWdlX3Rva2VuGAMgASgJEhQKDHNob3dfZGVsZXRlZBgEIAEoCBIOCgZmaWx0ZXIYBSABKAkiVwoUTGlzdFJlbGVhc2VzUmVzcG9uc2USJgoIcmVsZWFzZXMYASADKAsyFC5ieXRlYmFzZS52MS5SZWxlYXNlEhcKD25leHRfcGFnZV90b2tlbhgCIAEoCSKqAQoUQ3JlYXRlUmVsZWFzZVJlcXVlc3QSLAoGcGFyZW50GAEgASgJQhzgQQL6QRYKFGJ5dGViYXNlLmNvbS9Qcm9qZWN0EioKB3JlbGVhc2UYAiABKAsyFC5ieXRlYmFzZS52MS5SZWxlYXNlQgPgQQISGwoTcmVsZWFzZV9pZF90ZW1wbGF0ZRgDIAEoCRIbChNyZWxlYXNlX2lkX3RpbWV6b25lGAQgASgJInMKFFVwZGF0ZVJlbGVhc2VSZXF1ZXN0EioKB3JlbGVhc2UYASABKAsyFC5ieXRlYmFzZS52MS5SZWxlYXNlQgPgQQISLwoLdXBkYXRlX21hc2sYAiABKAsyGi5nb29nbGUucHJvdG9idWYuRmllbGRNYXNrIkIKFERlbGV0ZVJlbGVhc2VSZXF1ZXN0EioKBG5hbWUYASABKAlCHOBBAvpBFgoUYnl0ZWJhc2UuY29tL1JlbGVhc2UiRAoWVW5kZWxldGVSZWxlYXNlUmVxdWVzdBIq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n06dW5kZWxldGUSnwEKDENoZWNrUmVsZWFzZRIgLmJ5dGViYXNlLnYxLkNoZWNrUmVsZWFzZVJlcXVlc3QaIS5ieXRlYmFzZS52MS5DaGVja1JlbGVhc2VSZXNwb25zZSJKiuowEWJiLnJlbGVhc2VzLmNoZWNrkOowAYLT5JMCKzoBKiImL3YxL3twYXJlbnQ9cHJvamVjdHMvKn0vcmVsZWFzZXM6Y2hlY2sSyAEKFUxpc3RSZWxlYXNlQ2F0ZWdvcmllcxIpLmJ5dGViYXNlLnYxLkxpc3RSZWxlYXNlQ2F0ZWdvcmllc1JlcXVlc3QaKi5ieXRlYmFzZS52MS5MaXN0UmVsZWFzZUNhdGVnb3JpZXNSZXNwb25zZSJY2kEGcGFyZW50iuowEGJiLnJlbGVhc2VzLmxpc3SQ6jABgtPkkwIxEi8vdjEve3BhcmVudD1wcm9qZWN0cy8qfS9yZWxlYXNlczpsaXN0Q2F0ZWdvcmllc0KpAQoPY29tLmJ5dGViYXNlLnYxQhNSZWxlYXNlU2VydmljZVByb3RvUAFaNGdpdGh1Yi5jb20vYnl0ZWJhc2UvYnl0ZWJhc2UvYmFja2VuZC9nZW5lcmF0ZWQtZ28vdjGiAgNCWFiqAgtCeXRlYmFzZS5WMcoCC0J5dGViYXNlXFYx4gIXQnl0ZWJhc2VcVjFcR1BCTWV0YWRhdGHqAgxCeXRlYmFzZTo6VjFiBnByb3RvMw", [file_google_api_annotations, file_google_api_client, file_google_api_field_behavior, file_google_api_resource, file_google_protobuf_empty, file_google_protobuf_field_mask, file_google_protobuf_timestamp, file_v1_annotation, file_v1_common, file_v1_sql_service]);
/**
* Describes the message bytebase.v1.GetReleaseRequest.
diff --git a/frontend/src/types/proto-es/v1/saved_query_service_pb.js b/frontend/src/types/proto-es/v1/saved_query_service_pb.js
index ebaa51d5f9..baa924cd45 100644
--- a/frontend/src/types/proto-es/v1/saved_query_service_pb.js
+++ b/frontend/src/types/proto-es/v1/saved_query_service_pb.js
@@ -15,7 +15,7 @@ import { file_v1_annotation } from "./annotation_pb";
* Describes the file v1/saved_query_service.proto.
*/
export const file_v1_saved_query_service = /*@__PURE__*/
- fileDesc("Chx2MS9zYXZlZF9xdWVyeV9zZXJ2aWNlLnByb3RvEgtieXRlYmFzZS52MSJhChdDcmVhdGVTYXZlZFF1ZXJ5UmVxdWVzdBITCgZwYXJlbnQYASABKAlCA+BBAhIxCgtzYXZlZF9xdWVyeRgCIAEoCzIXLmJ5dGViYXNlLnYxLlNhdmVkUXVlcnlCA+BBAiIpChRHZXRTYXZlZFF1ZXJ5UmVxdWVzdBIRCgRuYW1lGAEgASgJQgPgQQIifgoXTGlzdFNhdmVkUXVlcmllc1JlcXVlc3QSLAoGcGFyZW50GAEgASgJQhzgQQL6QRYKFGJ5dGViYXNlLmNvbS9Qcm9qZWN0Eg4KBmZpbHRlchgCIAEoCRIRCglwYWdlX3NpemUYAyABKAUSEgoKcGFnZV90b2tlbhgEIAEoCSJjChhMaXN0U2F2ZWRRdWVyaWVzUmVzcG9uc2USLgoNc2F2ZWRfcXVlcmllcxgBIAMoCzIXLmJ5dGViYXNlLnYxLlNhdmVkUXVlcnkSFwoPbmV4dF9wYWdlX3Rva2VuGAIgASgJIjMKHExpc3RTYXZlZFF1ZXJ5Rm9sZGVyc1JlcXVlc3QSEwoGcGFyZW50GAEgASgJQgPgQQIiTwodTGlzdFNhdmVkUXVlcnlGb2xkZXJzUmVzcG9uc2USLgoHZm9sZGVycxgBIAMoCzIdLmJ5dGViYXNlLnYxLlNhdmVkUXVlcnlGb2xkZXIimQEKEFNhdmVkUXVlcnlGb2xkZXISDwoHZm9sZGVycxgBIAMoCRI4CghjYXRlZ29yeRgCIAEoDjImLmJ5dGViYXNlLnYxLlNhdmVkUXVlcnlGb2xkZXIuQ2F0ZWdvcnkiOgoIQ2F0ZWdvcnkSGAoUQ0FURUdPUllfVU5TUEVDSUZJRUQQABIICgRNSU5FEAESCgoGU0hBUkVEEAIifQoXVXBkYXRlU2F2ZWRRdWVye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wZGF0ZVNhdmVkUXVlcnlPcmdhbml6ZXJSZXF1ZXN0GiAuYnl0ZWJhc2UudjEuU2F2ZWRRdWVyeU9yZ2FuaXplciJu2kEVb3JnYW5pemVyLHVwZGF0ZV9tYXNrkOowAoLT5JMCTDoJb3JnYW5pemVyMj8vdjEve29yZ2FuaXplci5zYXZlZF9xdWVyeT1wcm9qZWN0cy8qL3NhdmVkUXVlcmllcy8qfS9vcmdhbml6ZXIS9AEKHkJhdGNoVXBkYXRlU2F2ZWRRdWVyeU9yZ2FuaXplchIyLmJ5dGViYXNlLnYxLkJhdGNoVXBkYXRlU2F2ZWRRdWVyeU9yZ2FuaXplclJlcXVlc3QaMy5ieXRlYmFzZS52MS5CYXRjaFVwZGF0ZVNhdmVkUXVlcnlPcmdhbml6ZXJSZXNwb25zZSJp2kEccGFyZW50LG9yZ2FuaXplcix1cGRhdGVfbWFza5DqMAKC0+STAkA6ASoiOy92MS97cGFyZW50PXByb2plY3RzLyp9L3NhdmVkUXVlcmllcy9vcmdhbml6ZXJzOmJhdGNoVXBkYXRlEokBChBEZWxldGVTYXZlZFF1ZXJ5EiQuYnl0ZWJhc2UudjEuRGVsZXRlU2F2ZWRRdWVyeVJlcXVlc3QaFi5nb29nbGUucHJvdG9idWYuRW1wdHkiN9pBBG5hbWWQ6jACgtPkkwImKiQvdjEve25hbWU9cHJvamVjdHMvKi9zYXZlZFF1ZXJpZXMvKn1CrAEKD2NvbS5ieXRlYmFzZS52MUIWU2F2ZWRRdWVyeVNlcnZpY2VQcm90b1ABWjRnaXRodWIuY29tL2J5dGViYXNlL2J5dGViYXNlL2JhY2tlbmQvZ2VuZXJhdGVkLWdvL3YxogIDQlhYqgILQnl0ZWJhc2UuVjHKAgtCeXRlYmFzZVxWMeICF0J5dGViYXNlXFYxXEdQQk1ldGFkYXRh6gIMQnl0ZWJhc2U6OlYxYgZwcm90bzM", [file_buf_validate_validate, file_google_api_annotations, file_google_api_client, file_google_api_field_behavior, file_google_api_resource, file_google_prot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bmQvZ2VuZXJhdGVkLWdvL3YxogIDQlhYqgILQnl0ZWJhc2UuVjHKAgtCeXRlYmFzZVxWMeICF0J5dGViYXNlXFYxXEdQQk1ldGFkYXRh6gIMQnl0ZWJhc2U6OlYxYgZwcm90bzM", [file_buf_validate_validate, file_google_api_annotations, file_google_api_client, file_google_api_field_behavior, file_google_api_resource, file_google_protobuf_empty, file_google_protobuf_field_mask, file_google_protobuf_timestamp, file_v1_annotation]);
/**
* Describes the message bytebase.v1.CreateSavedQueryRequest.
diff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yaml
index e104dae372..d25e509bc0 100644
--- a/proto/gen/grpc-doc/openapi.yaml
+++ b/proto/gen/grpc-doc/openapi.yaml
@@ -15120,6 +15120,827 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/bytebase.v1.WorkloadIdentity'
+ /v1/projects/{project}/worksheetFolders:
+ get:
+ tags:
+ - WorksheetService
+ summary: ListWorksheetFolders
+ description: |-
+ List the caller's worksheet folders.
+ Only folders stored in the caller's worksheet organizer are returned.
+ operationId: WorksheetService_ListWorksheetFolders
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.ListWorksheetFoldersResponse'
+ /v1/projects/{project}/worksheets:
+ get:
+ tags:
+ - WorksheetService
+ summary: ListWorksheets
+ description: |-
+ List worksheets.
+ This is used for listing worksheets in a project, or across all projects by using `projects/-`.
+ Permissions required: bb.worksheets.list
+ operationId: WorksheetService_ListWorksheets
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: filter
+ in: query
+ description: |-
+ To filter the list result.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+ Supported filter:
+ - creator: the worksheet creator in "users/{email}" format, support "==" and "!=" operator.
+
+ For example:
+ creator == "users/{email}"
+ creator != "users/{email}"
+ schema:
+ type: string
+ title: filter
+ - name: pageSize
+ in: query
+ description: |-
+ The maximum number of worksheets to return. The service may return fewer than
+ this value.
+ If unspecified, at most 10 worksheets will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ schema:
+ type: integer
+ title: page_size
+ format: int32
+ - name: pageToken
+ in: query
+ description: |-
+ A page token, received from a previous `ListWorksheets` call.
+ Provide this to retrieve the subsequent page.
+
+ When paginating, all other parameters provided to `ListWorksheets` must match
+ the call that provided the page token.
+ schema:
+ type: string
+ title: page_token
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.ListWorksheetsResponse'
+ post:
+ tags:
+ - WorksheetService
+ summary: CreateWorksheet
+ description: |-
+ Creates a personal worksheet used in SQL Editor. Any authenticated user can create their own worksheets.
+ Permissions required: None (authenticated users only)
+ operationId: WorksheetService_CreateWorksheet
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ requestBody:
+ description: The worksheet to create.
+ content:
+ application/json:
+ schema:
+ title: worksheet
+ description: The worksheet to create.
+ $ref: '#/components/schemas/bytebase.v1.Worksheet'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Worksheet'
+ /v1/projects/{project}/worksheets/organizers:batchUpdate:
+ post:
+ tags:
+ - WorksheetService
+ summary: BatchUpdateWorksheetOrganizer
+ description: |-
+ Batch update the organizers of worksheets.
+ The access is the same as UpdateWorksheet method.
+ Permissions required: bb.worksheets.get (or creator, or project member for shared worksheets)
+ operationId: WorksheetService_BatchUpdateWorksheetOrganizer
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ filter:
+ type: string
+ title: filter
+ description: |-
+ To filter the batch update target.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+ Supported filter:
+ - name: the worksheet name in "projects/{project}/worksheets/{worksheet}" format, support "==" and "in [xx]" operator.
+ - creator: the worksheet creator in "users/{email}" format, support "==" and "!=" operator.
+ - starred: should be "true" or "false", filter starred/unstarred sheets, support "==" operator.
+ - visibility: check Visibility enum in the Worksheet message for values, support "==" and "in [xx]" operator.
+ - folder: the worksheet organizer folder path, support exact "==" operator.
+ organizer:
+ title: organizer
+ description: The organizer fields to update.
+ $ref: '#/components/schemas/bytebase.v1.WorksheetOrganizer'
+ updateMask:
+ title: update_mask
+ description: |-
+ The list of fields to be updated.
+ Fields are specified relative to the worksheet organizer.
+ Only support update the following fields for now:
+ - `starred`
+ - `folders`
+ $ref: '#/components/schemas/google.protobuf.FieldMask'
+ title: BatchUpdateWorksheetOrganizerRequest
+ required:
+ - organizer
+ - updateMask
+ additionalProperties: false
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.BatchUpdateWorksheetOrganizerResponse'
+ /v1/projects/{project}/worksheets/{worksheet}:
+ get:
+ tags:
+ - WorksheetService
+ summary: GetWorksheet
+ description: |-
+ Get a worksheet by name.
+ The users can access this method if,
+ - they are the creator of the worksheet;
+ - they have bb.worksheets.get permission on the workspace;
+ - the sheet is shared with them with PROJECT_READ and PROJECT_WRITE visibility, and they have bb.projects.get permission on the project.
+ Permissions required: bb.worksheets.get (or creator, or project member for shared worksheets)
+ operationId: WorksheetService_GetWorksheet
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: worksheet
+ in: path
+ description: The worksheet id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Worksheet'
+ delete:
+ tags:
+ - WorksheetService
+ summary: DeleteWorksheet
+ description: |-
+ Delete a worksheet.
+ The access is the same as UpdateWorksheet method.
+ Permissions required: bb.worksheets.manage (or creator, or project member for PROJECT_WRITE worksheets)
+ operationId: WorksheetService_DeleteWorksheet
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: worksheet
+ in: path
+ description: The worksheet id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/google.protobuf.Empty'
+ patch:
+ tags:
+ - WorksheetService
+ summary: UpdateWorksheet
+ description: |-
+ Update a worksheet.
+ The users can access this method if,
+ - they are the creator of the worksheet;
+ - they have bb.worksheets.manage permission on the workspace;
+ - the sheet is shared with them with PROJECT_WRITE visibility, and they have bb.projects.get permission on the project.
+ Permissions required: bb.worksheets.manage (or creator, or project member for PROJECT_WRITE worksheets)
+ operationId: WorksheetService_UpdateWorksheet
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: worksheet
+ in: path
+ description: The worksheet id.
+ required: true
+ schema:
+ type: string
+ - name: updateMask
+ in: query
+ description: |-
+ `FieldMask` represents a set of symbolic field paths, for example:
+
+ paths: "f.a"
+ paths: "f.b.d"
+
+ Here `f` represents a field in some root message, `a` and `b`
+ fields in the message found in `f`, and `d` a field found in the
+ message in `f.b`.
+
+ Field masks are used to specify a subset of fields that should be
+ returned by a get operation or modified by an update operation.
+ Field masks also have a custom JSON encoding (see below).
+
+ # Field Masks in Projections
+
+ When used in the context of a projection, a response message or
+ sub-message is filtered by the API to only contain those fields as
+ specified in the mask. For example, if the mask in the previous
+ example is applied to a response message as follows:
+
+ f {
+ a : 22
+ b {
+ d : 1
+ x : 2
+ }
+ y : 13
+ }
+ z: 8
+
+ The result will not contain specific values for fields x,y and z
+ (their value will be set to the default, and omitted in proto text
+ output):
+
+
+ f {
+ a : 22
+ b {
+ d : 1
+ }
+ }
+
+ A repeated field is not allowed except at the last position of a
+ paths string.
+
+ If a FieldMask object is not present in a get operation, the
+ operation applies to all fields (as if a FieldMask of all fields
+ had been specified).
+
+ Note that a field mask does not necessarily apply to the
+ top-level response message. In case of a REST get operation, the
+ field mask applies directly to the response, but in case of a REST
+ list operation, the mask instead applies to each individual message
+ in the returned resource list. In case of a REST custom method,
+ other definitions may be used. Where the mask applies will be
+ clearly documented together with its declaration in the API. In
+ any case, the effect on the returned resource/resources is required
+ behavior for APIs.
+
+ # Field Masks in Update Operations
+
+ A field mask in update operations specifies which fields of the
+ targeted resource are going to be updated. The API is required
+ to only change the values of the fields as specified in the mask
+ and leave the others untouched. If a resource is passed in to
+ describe the updated values, the API ignores the values of all
+ fields not covered by the mask.
+
+ If a repeated field is specified for an update operation, new values will
+ be appended to the existing repeated field in the target resource. Note that
+ a repeated field is only allowed in the last position of a `paths` string.
+
+ If a sub-message is specified in the last position of the field mask for an
+ update operation, then new value will be merged into the existing sub-message
+ in the target resource.
+
+ For example, given the target message:
+
+ f {
+ b {
+ d: 1
+ x: 2
+ }
+ c: [1]
+ }
+
+ And an update message:
+
+ f {
+ b {
+ d: 10
+ }
+ c: [2]
+ }
+
+ then if the field mask is:
+
+ paths: ["f.b", "f.c"]
+
+ then the result will be:
+
+ f {
+ b {
+ d: 10
+ x: 2
+ }
+ c: [1, 2]
+ }
+
+ An implementation may provide options to override this default behavior for
+ repeated and message fields.
+
+ In order to reset a field's value to the default, the field must
+ be in the mask and set to the default value in the provided resource.
+ Hence, in order to reset all fields of a resource, provide a default
+ instance of the resource and set all fields in the mask, or do
+ not provide a mask as described below.
+
+ If a field mask is not present on update, the operation applies to
+ all fields (as if a field mask of all fields has been specified).
+ Note that in the presence of schema evolution, this may mean that
+ fields the client does not know and has therefore not filled into
+ the request will be reset to their default. If this is unwanted
+ behavior, a specific service may require a client to always specify
+ a field mask, producing an error if not.
+
+ As with get operations, the location of the resource which
+ describes the updated values in the request message depends on the
+ operation kind. In any case, the effect of the field mask is
+ required to be honored by the API.
+
+ ## Considerations for HTTP REST
+
+ The HTTP kind of an update operation which uses a field mask must
+ be set to PATCH instead of PUT in order to satisfy HTTP semantics
+ (PUT must only be used for full updates).
+
+ # JSON Encoding of Field Masks
+
+ In JSON, a field mask is encoded as a single string where paths are
+ separated by a comma. Fields name in each path are converted
+ to/from lower-camel naming conventions.
+
+ As an example, consider the following message declarations:
+
+ message Profile {
+ User user = 1;
+ Photo photo = 2;
+ }
+ message User {
+ string display_name = 1;
+ string address = 2;
+ }
+
+ In proto a field mask for `Profile` may look as such:
+
+ mask {
+ paths: "user.display_name"
+ paths: "photo"
+ }
+
+ In JSON, the same mask is represented as below:
+
+ {
+ mask: "user.displayName,photo"
+ }
+
+ # Field Masks and Oneof Fields
+
+ Field masks treat fields in oneofs just as regular fields. Consider the
+ following message:
+
+ message SampleMessage {
+ oneof test_oneof {
+ string name = 4;
+ SubMessage sub_message = 9;
+ }
+ }
+
+ The field mask can be:
+
+ mask {
+ paths: "name"
+ }
+
+ Or:
+
+ mask {
+ paths: "sub_message"
+ }
+
+ Note that oneof type names ("test_oneof" in this case) cannot be used in
+ paths.
+
+ ## Field Mask Verification
+
+ The implementation of any API method which has a FieldMask type field in the
+ request should verify the included field paths, and return an
+ `INVALID_ARGUMENT` error if any path is unmappable.
+ schema:
+ type: string
+ requestBody:
+ description: |-
+ The worksheet to update.
+
+ The worksheet's `name` field is used to identify the worksheet to update.
+ Format: projects/{project}/worksheets/{worksheet}
+ content:
+ application/json:
+ schema:
+ title: worksheet
+ description: |-
+ The worksheet to update.
+
+ The worksheet's `name` field is used to identify the worksheet to update.
+ Format: projects/{project}/worksheets/{worksheet}
+ $ref: '#/components/schemas/bytebase.v1.Worksheet'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.Worksheet'
+ /v1/projects/{project}/worksheets/{worksheet}/organizer:
+ patch:
+ tags:
+ - WorksheetService
+ summary: UpdateWorksheetOrganizer
+ description: |-
+ Update the organizer of a worksheet.
+ The access is the same as UpdateWorksheet method.
+ Permissions required: bb.worksheets.get (or creator, or project member for shared worksheets)
+ operationId: WorksheetService_UpdateWorksheetOrganizer
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: worksheet
+ in: path
+ description: The worksheet id.
+ required: true
+ schema:
+ type: string
+ - name: updateMask
+ in: query
+ description: |-
+ `FieldMask` represents a set of symbolic field paths, for example:
+
+ paths: "f.a"
+ paths: "f.b.d"
+
+ Here `f` represents a field in some root message, `a` and `b`
+ fields in the message found in `f`, and `d` a field found in the
+ message in `f.b`.
+
+ Field masks are used to specify a subset of fields that should be
+ returned by a get operation or modified by an update operation.
+ Field masks also have a custom JSON encoding (see below).
+
+ # Field Masks in Projections
+
+ When used in the context of a projection, a response message or
+ sub-message is filtered by the API to only contain those fields as
+ specified in the mask. For example, if the mask in the previous
+ example is applied to a response message as follows:
+
+ f {
+ a : 22
+ b {
+ d : 1
+ x : 2
+ }
+ y : 13
+ }
+ z: 8
+
+ The result will not contain specific values for fields x,y and z
+ (their value will be set to the default, and omitted in proto text
+ output):
+
+
+ f {
+ a : 22
+ b {
+ d : 1
+ }
+ }
+
+ A repeated field is not allowed except at the last position of a
+ paths string.
+
+ If a FieldMask object is not present in a get operation, the
+ operation applies to all fields (as if a FieldMask of all fields
+ had been specified).
+
+ Note that a field mask does not necessarily apply to the
+ top-level response message. In case of a REST get operation, the
+ field mask applies directly to the response, but in case of a REST
+ list operation, the mask instead applies to each individual message
+ in the returned resource list. In case of a REST custom method,
+ other definitions may be used. Where the mask applies will be
+ clearly documented together with its declaration in the API. In
+ any case, the effect on the returned resource/resources is required
+ behavior for APIs.
+
+ # Field Masks in Update Operations
+
+ A field mask in update operations specifies which fields of the
+ targeted resource are going to be updated. The API is required
+ to only change the values of the fields as specified in the mask
+ and leave the others untouched. If a resource is passed in to
+ describe the updated values, the API ignores the values of all
+ fields not covered by the mask.
+
+ If a repeated field is specified for an update operation, new values will
+ be appended to the existing repeated field in the target resource. Note that
+ a repeated field is only allowed in the last position of a `paths` string.
+
+ If a sub-message is specified in the last position of the field mask for an
+ update operation, then new value will be merged into the existing sub-message
+ in the target resource.
+
+ For example, given the target message:
+
+ f {
+ b {
+ d: 1
+ x: 2
+ }
+ c: [1]
+ }
+
+ And an update message:
+
+ f {
+ b {
+ d: 10
+ }
+ c: [2]
+ }
+
+ then if the field mask is:
+
+ paths: ["f.b", "f.c"]
+
+ then the result will be:
+
+ f {
+ b {
+ d: 10
+ x: 2
+ }
+ c: [1, 2]
+ }
+
+ An implementation may provide options to override this default behavior for
+ repeated and message fields.
+
+ In order to reset a field's value to the default, the field must
+ be in the mask and set to the default value in the provided resource.
+ Hence, in order to reset all fields of a resource, provide a default
+ instance of the resource and set all fields in the mask, or do
+ not provide a mask as described below.
+
+ If a field mask is not present on update, the operation applies to
+ all fields (as if a field mask of all fields has been specified).
+ Note that in the presence of schema evolution, this may mean that
+ fields the client does not know and has therefore not filled into
+ the request will be reset to their default. If this is unwanted
+ behavior, a specific service may require a client to always specify
+ a field mask, producing an error if not.
+
+ As with get operations, the location of the resource which
+ describes the updated values in the request message depends on the
+ operation kind. In any case, the effect of the field mask is
+ required to be honored by the API.
+
+ ## Considerations for HTTP REST
+
+ The HTTP kind of an update operation which uses a field mask must
+ be set to PATCH instead of PUT in order to satisfy HTTP semantics
+ (PUT must only be used for full updates).
+
+ # JSON Encoding of Field Masks
+
+ In JSON, a field mask is encoded as a single string where paths are
+ separated by a comma. Fields name in each path are converted
+ to/from lower-camel naming conventions.
+
+ As an example, consider the following message declarations:
+
+ message Profile {
+ User user = 1;
+ Photo photo = 2;
+ }
+ message User {
+ string display_name = 1;
+ string address = 2;
+ }
+
+ In proto a field mask for `Profile` may look as such:
+
+ mask {
+ paths: "user.display_name"
+ paths: "photo"
+ }
+
+ In JSON, the same mask is represented as below:
+
+ {
+ mask: "user.displayName,photo"
+ }
+
+ # Field Masks and Oneof Fields
+
+ Field masks treat fields in oneofs just as regular fields. Consider the
+ following message:
+
+ message SampleMessage {
+ oneof test_oneof {
+ string name = 4;
+ SubMessage sub_message = 9;
+ }
+ }
+
+ The field mask can be:
+
+ mask {
+ paths: "name"
+ }
+
+ Or:
+
+ mask {
+ paths: "sub_message"
+ }
+
+ Note that oneof type names ("test_oneof" in this case) cannot be used in
+ paths.
+
+ ## Field Mask Verification
+
+ The implementation of any API method which has a FieldMask type field in the
+ request should verify the included field paths, and return an
+ `INVALID_ARGUMENT` error if any path is unmappable.
+ schema:
+ type: string
+ - name: allowMissing
+ in: query
+ description: |-
+ If set to true, and the worksheet organizer is not found, a new worksheet organizer will be created.
+ In this situation, `update_mask` is ignored.
+ schema:
+ type: boolean
+ title: allow_missing
+ requestBody:
+ description: |-
+ The organizer to update.
+
+ The organizer's `worksheet` field is used to identify the worksheet.
+ Format: projects/{project}/worksheets/{worksheet}
+ content:
+ application/json:
+ schema:
+ title: organizer
+ description: |-
+ The organizer to update.
+
+ The organizer's `worksheet` field is used to identify the worksheet.
+ Format: projects/{project}/worksheets/{worksheet}
+ $ref: '#/components/schemas/bytebase.v1.WorksheetOrganizer'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.WorksheetOrganizer'
+ /v1/projects/{project}/worksheets:search:
+ post:
+ tags:
+ - WorksheetService
+ summary: SearchWorksheets
+ description: |-
+ Search for worksheets.
+ This is used for finding my worksheets or worksheets shared by other people.
+ The sheet accessibility is the same as GetWorksheet().
+ Permissions required: bb.worksheets.get (or creator, or project member for shared worksheets)
+ operationId: WorksheetService_SearchWorksheets
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ filter:
+ type: string
+ title: filter
+ description: |-
+ To filter the search result.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+ Supported filter:
+ - name: the worksheet name in "projects/{project}/worksheets/{worksheet}" format, support "==" and "in [xx]" operator.
+ - title: the worksheet title, support "contains" operator.
+ - creator: the worksheet creator in "users/{email}" format, support "==" and "!=" operator.
+ - starred: should be "true" or "false", filter starred/unstarred sheets, support "==" operator.
+ - visibility: check Visibility enum in the Worksheet message for values, support "==" and "in [xx]" operator.
+ - folder: the worksheet organizer folder path, support "==" operator.
+
+ For example:
+ creator == "users/{email}"
+ title.contains("worksheet title")
+ creator != "users/{email}"
+ starred == true
+ starred == false
+ visibility in ["PRIVATE", "PROJECT_READ", "PROJECT_WRITE"]
+ visibility == "PRIVATE"
+ folder == "foo/bar"
+ pageSize:
+ type: integer
+ title: page_size
+ format: int32
+ description: |-
+ The maximum number of worksheets to return. The service may return fewer than
+ this value.
+ If unspecified, at most 10 worksheets will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ pageToken:
+ type: string
+ title: page_token
+ description: |-
+ A page token, received from a previous `SearchWorksheets` call.
+ Provide this to retrieve the subsequent page.
+ title: SearchWorksheetsRequest
+ additionalProperties: false
+ required: true
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.SearchWorksheetsResponse'
/v1/projects/{project}:addWebhook:
post:
tags:
@@ -20287,6 +21108,61 @@ components:
format: int32
title: BatchUpdateSavedQueryOrganizerResponse
additionalProperties: false
+ bytebase.v1.BatchUpdateWorksheetOrganizerRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: |-
+ The parent resource whose worksheets' organizers are updated.
+ Format: projects/{project}
+ filter:
+ type: string
+ title: filter
+ description: |-
+ To filter the batch update target.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+ Supported filter:
+ - name: the worksheet name in "projects/{project}/worksheets/{worksheet}" format, support "==" and "in [xx]" operator.
+ - creator: the worksheet creator in "users/{email}" format, support "==" and "!=" operator.
+ - starred: should be "true" or "false", filter starred/unstarred sheets, support "==" operator.
+ - visibility: check Visibility enum in the Worksheet message for values, support "==" and "in [xx]" operator.
+ - folder: the worksheet organizer folder path, support exact "==" operator.
+ organizer:
+ title: organizer
+ description: The organizer fields to update.
+ $ref: '#/components/schemas/bytebase.v1.WorksheetOrganizer'
+ updateMask:
+ title: update_mask
+ description: |-
+ The list of fields to be updated.
+ Fields are specified relative to the worksheet organizer.
+ Only support update the following fields for now:
+ - `starred`
+ - `folders`
+ $ref: '#/components/schemas/google.protobuf.FieldMask'
+ title: BatchUpdateWorksheetOrganizerRequest
+ required:
+ - parent
+ - organizer
+ - updateMask
+ additionalProperties: false
+ bytebase.v1.BatchUpdateWorksheetOrganizerResponse:
+ type: object
+ properties:
+ worksheetOrganizers:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.WorksheetOrganizer'
+ title: worksheet_organizers
+ updatedCount:
+ type: integer
+ title: updated_count
+ format: int32
+ title: BatchUpdateWorksheetOrganizerResponse
+ additionalProperties: false
bytebase.v1.BillingInterval:
type: string
title: BillingInterval
@@ -21257,6 +22133,24 @@ components:
- workloadIdentity
additionalProperties: false
description: Request message for creating a workload identity.
+ bytebase.v1.CreateWorksheetRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: |-
+ The parent resource where this worksheet will be created.
+ Format: projects/{project}
+ worksheet:
+ title: worksheet
+ description: The worksheet to create.
+ $ref: '#/components/schemas/bytebase.v1.Worksheet'
+ title: CreateWorksheetRequest
+ required:
+ - parent
+ - worksheet
+ additionalProperties: false
bytebase.v1.DataClassificationSetting:
type: object
properties:
@@ -22314,6 +23208,19 @@ components:
- name
additionalProperties: false
description: Request message for deleting a workload identity.
+ bytebase.v1.DeleteWorksheetRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the worksheet to delete.
+ Format: projects/{project}/worksheets/{worksheet}
+ title: DeleteWorksheetRequest
+ required:
+ - name
+ additionalProperties: false
bytebase.v1.DeleteWorkspaceRequest:
type: object
properties:
@@ -23600,20 +24507,33 @@ components:
required:
- name
additionalProperties: false
- bytebase.v1.GetWorkloadIdentityRequest:
+ bytebase.v1.GetWorkloadIdentityRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the workload identity to retrieve.
+ Format: workloadIdentities/{email}
+ title: GetWorkloadIdentityRequest
+ required:
+ - name
+ additionalProperties: false
+ description: Request message for getting a workload identity.
+ bytebase.v1.GetWorksheetRequest:
type: object
properties:
name:
type: string
title: name
description: |-
- The name of the workload identity to retrieve.
- Format: workloadIdentities/{email}
- title: GetWorkloadIdentityRequest
+ The name of the worksheet to retrieve.
+ Format: projects/{project}/worksheets/{worksheet}
+ title: GetWorksheetRequest
required:
- name
additionalProperties: false
- description: Request message for getting a workload identity.
bytebase.v1.GetWorkspaceRequest:
type: object
properties:
@@ -25999,6 +26919,93 @@ components:
title: ListWorkloadIdentitiesResponse
additionalProperties: false
description: Response message for listing workload identities.
+ bytebase.v1.ListWorksheetFoldersRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: |-
+ The parent resource of the worksheet folders.
+ Format: projects/{project}
+ title: ListWorksheetFoldersRequest
+ required:
+ - parent
+ additionalProperties: false
+ bytebase.v1.ListWorksheetFoldersResponse:
+ type: object
+ properties:
+ folders:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.WorksheetFolder'
+ title: folders
+ description: The caller's worksheet folders.
+ title: ListWorksheetFoldersResponse
+ additionalProperties: false
+ bytebase.v1.ListWorksheetsRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: |-
+ The parent resource of the worksheets.
+ Format: projects/{project}
+ Use "projects/-" to list worksheets across all projects.
+ filter:
+ type: string
+ title: filter
+ description: |-
+ To filter the list result.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+ Supported filter:
+ - creator: the worksheet creator in "users/{email}" format, support "==" and "!=" operator.
+
+ For example:
+ creator == "users/{email}"
+ creator != "users/{email}"
+ pageSize:
+ type: integer
+ title: page_size
+ format: int32
+ description: |-
+ The maximum number of worksheets to return. The service may return fewer than
+ this value.
+ If unspecified, at most 10 worksheets will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ pageToken:
+ type: string
+ title: page_token
+ description: |-
+ A page token, received from a previous `ListWorksheets` call.
+ Provide this to retrieve the subsequent page.
+
+ When paginating, all other parameters provided to `ListWorksheets` must match
+ the call that provided the page token.
+ title: ListWorksheetsRequest
+ required:
+ - parent
+ additionalProperties: false
+ bytebase.v1.ListWorksheetsResponse:
+ type: object
+ properties:
+ worksheets:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.Worksheet'
+ title: worksheets
+ description: The worksheets from the specified parent.
+ nextPageToken:
+ type: string
+ title: next_page_token
+ description: |-
+ A token to retrieve next page of worksheets.
+ Pass this value in the page_token field in the subsequent call to
+ `ListWorksheets` method to retrieve the next page of worksheets.
+ title: ListWorksheetsResponse
+ additionalProperties: false
bytebase.v1.ListWorkspacesRequest:
type: object
title: ListWorkspacesRequest
@@ -29618,6 +30625,76 @@ components:
`SearchSavedQueries` method to retrieve the next page of saved queries.
title: SearchSavedQueriesResponse
additionalProperties: false
+ bytebase.v1.SearchWorksheetsRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: |-
+ The parent resource of the worksheets.
+ Format: projects/{project}
+ filter:
+ type: string
+ title: filter
+ description: |-
+ To filter the search result.
+ The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+ Supported filter:
+ - name: the worksheet name in "projects/{project}/worksheets/{worksheet}" format, support "==" and "in [xx]" operator.
+ - title: the worksheet title, support "contains" operator.
+ - creator: the worksheet creator in "users/{email}" format, support "==" and "!=" operator.
+ - starred: should be "true" or "false", filter starred/unstarred sheets, support "==" operator.
+ - visibility: check Visibility enum in the Worksheet message for values, support "==" and "in [xx]" operator.
+ - folder: the worksheet organizer folder path, support "==" operator.
+
+ For example:
+ creator == "users/{email}"
+ title.contains("worksheet title")
+ creator != "users/{email}"
+ starred == true
+ starred == false
+ visibility in ["PRIVATE", "PROJECT_READ", "PROJECT_WRITE"]
+ visibility == "PRIVATE"
+ folder == "foo/bar"
+ pageSize:
+ type: integer
+ title: page_size
+ format: int32
+ description: |-
+ The maximum number of worksheets to return. The service may return fewer than
+ this value.
+ If unspecified, at most 10 worksheets will be returned.
+ The maximum value is 1000; values above 1000 will be coerced to 1000.
+ pageToken:
+ type: string
+ title: page_token
+ description: |-
+ A page token, received from a previous `SearchWorksheets` call.
+ Provide this to retrieve the subsequent page.
+ title: SearchWorksheetsRequest
+ required:
+ - parent
+ additionalProperties: false
+ bytebase.v1.SearchWorksheetsResponse:
+ type: object
+ properties:
+ worksheets:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.Worksheet'
+ title: worksheets
+ description: The worksheets that matched the search criteria.
+ nextPageToken:
+ type: string
+ title: next_page_token
+ description: |-
+ A token to retrieve next page of worksheets.
+ Pass this value in the page_token field in the subsequent call to
+ `SearchWorksheets` method to retrieve the next page of worksheets.
+ title: SearchWorksheetsResponse
+ additionalProperties: false
bytebase.v1.SemanticTypeSetting:
type: object
properties:
@@ -32204,6 +33281,62 @@ components:
- workloadIdentity
additionalProperties: false
description: Request message for updating a workload identity.
+ bytebase.v1.UpdateWorksheetOrganizerRequest:
+ type: object
+ properties:
+ organizer:
+ title: organizer
+ description: |-
+ The organizer to update.
+
+ The organizer's `worksheet` field is used to identify the worksheet.
+ Format: projects/{project}/worksheets/{worksheet}
+ $ref: '#/components/schemas/bytebase.v1.WorksheetOrganizer'
+ updateMask:
+ title: update_mask
+ description: |-
+ The list of fields to be updated.
+ Fields are specified relative to the worksheet organizer.
+ Only support update the following fields for now:
+ - `starred`
+ $ref: '#/components/schemas/google.protobuf.FieldMask'
+ allowMissing:
+ type: boolean
+ title: allow_missing
+ description: |-
+ If set to true, and the worksheet organizer is not found, a new worksheet organizer will be created.
+ In this situation, `update_mask` is ignored.
+ title: UpdateWorksheetOrganizerRequest
+ required:
+ - organizer
+ additionalProperties: false
+ bytebase.v1.UpdateWorksheetRequest:
+ type: object
+ properties:
+ worksheet:
+ title: worksheet
+ description: |-
+ The worksheet to update.
+
+ The worksheet's `name` field is used to identify the worksheet to update.
+ Format: projects/{project}/worksheets/{worksheet}
+ $ref: '#/components/schemas/bytebase.v1.Worksheet'
+ updateMask:
+ title: update_mask
+ description: |-
+ The list of fields to be updated.
+ Fields are specified relative to the worksheet.
+ (e.g., `title`, `statement`; *not* `worksheet.title` or `worksheet.statement`)
+ Only support update the following fields for now:
+ - `title`
+ - `statement`
+ - `starred`
+ - `visibility`
+ $ref: '#/components/schemas/google.protobuf.FieldMask'
+ title: UpdateWorksheetRequest
+ required:
+ - worksheet
+ additionalProperties: false
bytebase.v1.UpdateWorkspaceRequest:
type: object
properties:
@@ -32540,6 +33673,142 @@ components:
- GITHUB
- GITLAB
description: ProviderType identifies the CI/CD platform.
+ bytebase.v1.Worksheet:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ (IMMUTABLE) The name of the worksheet resource, generated by the server.
+ Canonical parent is project.
+ Format: projects/{project}/worksheets/{worksheet}
+ project:
+ type: string
+ title: project
+ description: |-
+ The project resource name.
+ Format: projects/{project}
+ readOnly: true
+ database:
+ type: string
+ title: database
+ description: |-
+ The database resource name.
+ Format: instances/{instance}/databases/{database}
+ If the database parent doesn't exist, the database field is empty.
+ title:
+ type: string
+ title: title
+ maxLength: 200
+ description: The title of the worksheet.
+ creator:
+ type: string
+ title: creator
+ description: |-
+ The creator of the Worksheet.
+ Format: users/{email}
+ readOnly: true
+ createTime:
+ title: create_time
+ description: The create time of the worksheet.
+ readOnly: true
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ updateTime:
+ title: update_time
+ description: The last update time of the worksheet.
+ readOnly: true
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ content:
+ type: string
+ title: content
+ format: byte
+ description: |-
+ The content of the worksheet.
+ By default, it will be cut off in SearchWorksheet() method. If it doesn't match the `content_size`, you can
+ use GetWorksheet() request to retrieve the full content.
+ contentSize:
+ type:
+ - integer
+ - string
+ title: content_size
+ format: int64
+ description: content_size is the full size of the content, may not match the size of the `content` field.
+ readOnly: true
+ visibility:
+ title: visibility
+ $ref: '#/components/schemas/bytebase.v1.Worksheet.Visibility'
+ starred:
+ type: boolean
+ title: starred
+ description: starred indicates whether the worksheet is starred by the current authenticated user.
+ readOnly: true
+ folders:
+ type: array
+ items:
+ type: string
+ readOnly: true
+ title: folders
+ readOnly: true
+ title: Worksheet
+ required:
+ - name
+ - title
+ - content
+ - visibility
+ additionalProperties: false
+ bytebase.v1.Worksheet.Visibility:
+ type: string
+ title: Visibility
+ enum:
+ - VISIBILITY_UNSPECIFIED
+ - PROJECT_READ
+ - PROJECT_WRITE
+ - PRIVATE
+ bytebase.v1.WorksheetFolder:
+ type: object
+ properties:
+ folders:
+ type: array
+ items:
+ type: string
+ title: folders
+ description: The folder path segments.
+ category:
+ title: category
+ description: The folder category.
+ $ref: '#/components/schemas/bytebase.v1.WorksheetFolder.Category'
+ title: WorksheetFolder
+ additionalProperties: false
+ bytebase.v1.WorksheetFolder.Category:
+ type: string
+ title: Category
+ enum:
+ - CATEGORY_UNSPECIFIED
+ - MINE
+ - SHARED
+ bytebase.v1.WorksheetOrganizer:
+ type: object
+ properties:
+ worksheet:
+ type: string
+ title: worksheet
+ description: |-
+ The name of the worksheet.
+ Format: projects/{project}/worksheets/{worksheet}
+ starred:
+ type: boolean
+ title: starred
+ description: starred means if the worksheet is starred.
+ folders:
+ type: array
+ items:
+ type: string
+ title: folders
+ title: WorksheetOrganizer
+ required:
+ - worksheet
+ additionalProperties: false
bytebase.v1.Workspace:
type: object
properties:
@@ -34211,5 +35480,7 @@ tags:
description: SubscriptionService manages enterprise subscriptions and licensing.
- name: WorkloadIdentityService
description: WorkloadIdentityService manages workload identities for external CI/CD integrations.
+ - name: WorksheetService
+ description: WorksheetService manages SQL worksheets for query development.
- name: WorkspaceService
description: WorkspaceService manages workspace-level operations and profile.
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index 0e720c28a9..c4b12d85ca 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -764,6 +764,29 @@
- [WorkloadIdentityService](#bytebase-v1-WorkloadIdentityService)
+- [v1/worksheet_service.proto](#v1_worksheet_service-proto)
+ - [BatchUpdateWorksheetOrganizerRequest](#bytebase-v1-BatchUpdateWorksheetOrganizerRequest)
+ - [BatchUpdateWorksheetOrganizerResponse](#bytebase-v1-BatchUpdateWorksheetOrganizerResponse)
+ - [CreateWorksheetRequest](#bytebase-v1-CreateWorksheetRequest)
+ - [DeleteWorksheetRequest](#bytebase-v1-DeleteWorksheetRequest)
+ - [GetWorksheetRequest](#bytebase-v1-GetWorksheetRequest)
+ - [ListWorksheetFoldersRequest](#bytebase-v1-ListWorksheetFoldersRequest)
+ - [ListWorksheetFoldersResponse](#bytebase-v1-ListWorksheetFoldersResponse)
+ - [ListWorksheetsRequest](#bytebase-v1-ListWorksheetsRequest)
+ - [ListWorksheetsResponse](#bytebase-v1-ListWorksheetsResponse)
+ - [SearchWorksheetsRequest](#bytebase-v1-SearchWorksheetsRequest)
+ - [SearchWorksheetsResponse](#bytebase-v1-SearchWorksheetsResponse)
+ - [UpdateWorksheetOrganizerRequest](#bytebase-v1-UpdateWorksheetOrganizerRequest)
+ - [UpdateWorksheetRequest](#bytebase-v1-UpdateWorksheetRequest)
+ - [Worksheet](#bytebase-v1-Worksheet)
+ - [WorksheetFolder](#bytebase-v1-WorksheetFolder)
+ - [WorksheetOrganizer](#bytebase-v1-WorksheetOrganizer)
+
+ - [Worksheet.Visibility](#bytebase-v1-Worksheet-Visibility)
+ - [WorksheetFolder.Category](#bytebase-v1-WorksheetFolder-Category)
+
+ - [WorksheetService](#bytebase-v1-WorksheetService)
+
- [v1/workspace_service.proto](#v1_workspace_service-proto)
- [DeleteWorkspaceRequest](#bytebase-v1-DeleteWorkspaceRequest)
- [GetWorkspaceRequest](#bytebase-v1-GetWorkspaceRequest)
@@ -12315,6 +12338,353 @@ WorkloadIdentityService manages workload identities for external CI/CD integrati
+<a name="v1_worksheet_service-proto"></a>
+<p align="right"><a href="#top">Top</a></p>
+
+## v1/worksheet_service.proto
+
+
+
+<a name="bytebase-v1-BatchUpdateWorksheetOrganizerRequest"></a>
+
+### BatchUpdateWorksheetOrganizerRequest
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| parent | [string](#string) | | The parent resource whose worksheets&#39; organizers are updated. Format: projects/{project} |
+| filter | [string](#string) | | To filter the batch update target. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+Supported filter: - name: the worksheet name in &#34;projects/{project}/worksheets/{worksheet}&#34; format, support &#34;==&#34; and &#34;in [xx]&#34; operator. - creator: the worksheet creator in &#34;users/{email}&#34; format, support &#34;==&#34; and &#34;!=&#34; operator. - starred: should be &#34;true&#34; or &#34;false&#34;, filter starred/unstarred sheets, support &#34;==&#34; operator. - visibility: check Visibility enum in the Worksheet message for values, support &#34;==&#34; and &#34;in [xx]&#34; operator. - folder: the worksheet organizer folder path, support exact &#34;==&#34; operator. |
+| organizer | [WorksheetOrganizer](#bytebase-v1-WorksheetOrganizer) | | The organizer fields to update. |
+| update_mask | [google.protobuf.FieldMask](#google-protobuf-FieldMask) | | The list of fields to be updated. Fields are specified relative to the worksheet organizer. Only support update the following fields for now: - `starred` - `folders` |
+
+
+
+
+
+
+<a name="bytebase-v1-BatchUpdateWorksheetOrganizerResponse"></a>
+
+### BatchUpdateWorksheetOrganizerResponse
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| worksheet_organizers | [WorksheetOrganizer](#bytebase-v1-WorksheetOrganizer) | repeated | |
+| updated_count | [int32](#int32) | | |
+
+
+
+
+
+
+<a name="bytebase-v1-CreateWorksheetRequest"></a>
+
+### CreateWorksheetRequest
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| parent | [string](#string) | | The parent resource where this worksheet will be created. Format: projects/{project} |
+| worksheet | [Worksheet](#bytebase-v1-Worksheet) | | The worksheet to create. |
+
+
+
+
+
+
+<a name="bytebase-v1-DeleteWorksheetRequest"></a>
+
+### DeleteWorksheetRequest
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| name | [string](#string) | | The name of the worksheet to delete. Format: projects/{project}/worksheets/{worksheet} |
+
+
+
+
+
+
+<a name="bytebase-v1-GetWorksheetRequest"></a>
+
+### GetWorksheetRequest
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| name | [string](#string) | | The name of the worksheet to retrieve. Format: projects/{project}/worksheets/{worksheet} |
+
+
+
+
+
+
+<a name="bytebase-v1-ListWorksheetFoldersRequest"></a>
+
+### ListWorksheetFoldersRequest
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| parent | [string](#string) | | The parent resource of the worksheet folders. Format: projects/{project} |
+
+
+
+
+
+
+<a name="bytebase-v1-ListWorksheetFoldersResponse"></a>
+
+### ListWorksheetFoldersResponse
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| folders | [WorksheetFolder](#bytebase-v1-WorksheetFolder) | repeated | The caller&#39;s worksheet folders. |
+
+
+
+
+
+
+<a name="bytebase-v1-ListWorksheetsRequest"></a>
+
+### ListWorksheetsRequest
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| parent | [string](#string) | | The parent resource of the worksheets. Format: projects/{project} Use &#34;projects/-&#34; to list worksheets across all projects. |
+| filter | [string](#string) | | To filter the list result. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+Supported filter: - creator: the worksheet creator in &#34;users/{email}&#34; format, support &#34;==&#34; and &#34;!=&#34; operator.
+
+For example: creator == &#34;users/{email}&#34; creator != &#34;users/{email}&#34; |
+| page_size | [int32](#int32) | | The maximum number of worksheets to return. The service may return fewer than this value. If unspecified, at most 10 worksheets 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 `ListWorksheets` call. Provide this to retrieve the subsequent page.
+
+When paginating, all other parameters provided to `ListWorksheets` must match the call that provided the page token. |
+
+
+
+
+
+
+<a name="bytebase-v1-ListWorksheetsResponse"></a>
+
+### ListWorksheetsResponse
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| worksheets | [Worksheet](#bytebase-v1-Worksheet) | repeated | The worksheets from the specified parent. |
+| next_page_token | [string](#string) | | A token to retrieve next page of worksheets. Pass this value in the page_token field in the subsequent call to `ListWorksheets` method to retrieve the next page of worksheets. |
+
+
+
+
+
+
+<a name="bytebase-v1-SearchWorksheetsRequest"></a>
+
+### SearchWorksheetsRequest
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| parent | [string](#string) | | The parent resource of the worksheets. Format: projects/{project} |
+| filter | [string](#string) | | To filter the search result. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+Supported filter: - name: the worksheet name in &#34;projects/{project}/worksheets/{worksheet}&#34; format, support &#34;==&#34; and &#34;in [xx]&#34; operator. - title: the worksheet title, support &#34;contains&#34; operator. - creator: the worksheet creator in &#34;users/{email}&#34; format, support &#34;==&#34; and &#34;!=&#34; operator. - starred: should be &#34;true&#34; or &#34;false&#34;, filter starred/unstarred sheets, support &#34;==&#34; operator. - visibility: check Visibility enum in the Worksheet message for values, support &#34;==&#34; and &#34;in [xx]&#34; operator. - folder: the worksheet organizer folder path, support &#34;==&#34; operator.
+
+For example: creator == &#34;users/{email}&#34; title.contains(&#34;worksheet title&#34;) creator != &#34;users/{email}&#34; starred == true starred == false visibility in [&#34;PRIVATE&#34;, &#34;PROJECT_READ&#34;, &#34;PROJECT_WRITE&#34;] visibility == &#34;PRIVATE&#34; folder == &#34;foo/bar&#34; |
+| page_size | [int32](#int32) | | The maximum number of worksheets to return. The service may return fewer than this value. If unspecified, at most 10 worksheets 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 `SearchWorksheets` call. Provide this to retrieve the subsequent page. |
+
+
+
+
+
+
+<a name="bytebase-v1-SearchWorksheetsResponse"></a>
+
+### SearchWorksheetsResponse
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| worksheets | [Worksheet](#bytebase-v1-Worksheet) | repeated | The worksheets that matched the search criteria. |
+| next_page_token | [string](#string) | | A token to retrieve next page of worksheets. Pass this value in the page_token field in the subsequent call to `SearchWorksheets` method to retrieve the next page of worksheets. |
+
+
+
+
+
+
+<a name="bytebase-v1-UpdateWorksheetOrganizerRequest"></a>
+
+### UpdateWorksheetOrganizerRequest
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| organizer | [WorksheetOrganizer](#bytebase-v1-WorksheetOrganizer) | | The organizer to update.
+
+The organizer&#39;s `worksheet` field is used to identify the worksheet. Format: projects/{project}/worksheets/{worksheet} |
+| update_mask | [google.protobuf.FieldMask](#google-protobuf-FieldMask) | | The list of fields to be updated. Fields are specified relative to the worksheet organizer. Only support update the following fields for now: - `starred` |
+| allow_missing | [bool](#bool) | | If set to true, and the worksheet organizer is not found, a new worksheet organizer will be created. In this situation, `update_mask` is ignored. |
+
+
+
+
+
+
+<a name="bytebase-v1-UpdateWorksheetRequest"></a>
+
+### UpdateWorksheetRequest
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| worksheet | [Worksheet](#bytebase-v1-Worksheet) | | The worksheet to update.
+
+The worksheet&#39;s `name` field is used to identify the worksheet to update. Format: projects/{project}/worksheets/{worksheet} |
+| update_mask | [google.protobuf.FieldMask](#google-protobuf-FieldMask) | | The list of fields to be updated. Fields are specified relative to the worksheet. (e.g., `title`, `statement`; *not* `worksheet.title` or `worksheet.statement`) Only support update the following fields for now: - `title` - `statement` - `starred` - `visibility` |
+
+
+
+
+
+
+<a name="bytebase-v1-Worksheet"></a>
+
+### Worksheet
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| name | [string](#string) | | The name of the worksheet resource, generated by the server. Canonical parent is project. Format: projects/{project}/worksheets/{worksheet} |
+| project | [string](#string) | | The project resource name. Format: projects/{project} |
+| database | [string](#string) | | The database resource name. Format: instances/{instance}/databases/{database} If the database parent doesn&#39;t exist, the database field is empty. |
+| title | [string](#string) | | The title of the worksheet. |
+| creator | [string](#string) | | The creator of the Worksheet. Format: users/{email} |
+| create_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | The create time of the worksheet. |
+| update_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | The last update time of the worksheet. |
+| content | [bytes](#bytes) | | The content of the worksheet. By default, it will be cut off in SearchWorksheet() method. If it doesn&#39;t match the `content_size`, you can use GetWorksheet() request to retrieve the full content. |
+| content_size | [int64](#int64) | | content_size is the full size of the content, may not match the size of the `content` field. |
+| visibility | [Worksheet.Visibility](#bytebase-v1-Worksheet-Visibility) | | |
+| starred | [bool](#bool) | | starred indicates whether the worksheet is starred by the current authenticated user. |
+| folders | [string](#string) | repeated | |
+
+
+
+
+
+
+<a name="bytebase-v1-WorksheetFolder"></a>
+
+### WorksheetFolder
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| folders | [string](#string) | repeated | The folder path segments. |
+| category | [WorksheetFolder.Category](#bytebase-v1-WorksheetFolder-Category) | | The folder category. |
+
+
+
+
+
+
+<a name="bytebase-v1-WorksheetOrganizer"></a>
+
+### WorksheetOrganizer
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| worksheet | [string](#string) | | The name of the worksheet. Format: projects/{project}/worksheets/{worksheet} |
+| starred | [bool](#bool) | | starred means if the worksheet is starred. |
+| folders | [string](#string) | repeated | |
+
+
+
+
+
+
+
+
+<a name="bytebase-v1-Worksheet-Visibility"></a>
+
+### Worksheet.Visibility
+
+
+| Name | Number | Description |
+| ---- | ------ | ----------- |
+| VISIBILITY_UNSPECIFIED | 0 | |
+| PROJECT_READ | 1 | Read access in project scope, worksheet OWNER/DBA and project OWNER can read/write, other project members can read. |
+| PROJECT_WRITE | 2 | Write access in project scope, worksheet OWNER/DBA and all members in the project can write the worksheet. |
+| PRIVATE | 3 | Private, only worksheet OWNER can read/write. |
+
+
+
+<a name="bytebase-v1-WorksheetFolder-Category"></a>
+
+### WorksheetFolder.Category
+
+
+| Name | Number | Description |
+| ---- | ------ | ----------- |
+| CATEGORY_UNSPECIFIED | 0 | |
+| MINE | 1 | |
+| SHARED | 2 | |
+
+
+
+
+
+
+
+<a name="bytebase-v1-WorksheetService"></a>
+
+### WorksheetService
+WorksheetService manages SQL worksheets for query development.
+
+| Method Name | Request Type | Response Type | Description |
+| ----------- | ------------ | ------------- | ------------|
+| CreateWorksheet | [CreateWorksheetRequest](#bytebase-v1-CreateWorksheetRequest) | [Worksheet](#bytebase-v1-Worksheet) | Creates a personal worksheet used in SQL Editor. Any authenticated user can create their own worksheets. Permissions required: None (authenticated users only) |
+| GetWorksheet | [GetWorksheetRequest](#bytebase-v1-GetWorksheetRequest) | [Worksheet](#bytebase-v1-Worksheet) | Get a worksheet by name. The users can access this method if, - they are the creator of the worksheet; - they have bb.worksheets.get permission on the workspace; - the sheet is shared with them with PROJECT_READ and PROJECT_WRITE visibility, and they have bb.projects.get permission on the project. Permissions required: bb.worksheets.get (or creator, or project member for shared worksheets) |
+| ListWorksheets | [ListWorksheetsRequest](#bytebase-v1-ListWorksheetsRequest) | [ListWorksheetsResponse](#bytebase-v1-ListWorksheetsResponse) | List worksheets. This is used for listing worksheets in a project, or across all projects by using `projects/-`. Permissions required: bb.worksheets.list |
+| ListWorksheetFolders | [ListWorksheetFoldersRequest](#bytebase-v1-ListWorksheetFoldersRequest) | [ListWorksheetFoldersResponse](#bytebase-v1-ListWorksheetFoldersResponse) | List the caller&#39;s worksheet folders. Only folders stored in the caller&#39;s worksheet organizer are returned. |
+| SearchWorksheets | [SearchWorksheetsRequest](#bytebase-v1-SearchWorksheetsRequest) | [SearchWorksheetsResponse](#bytebase-v1-SearchWorksheetsResponse) | Search for worksheets. This is used for finding my worksheets or worksheets shared by other people. The sheet accessibility is the same as GetWorksheet(). Permissions required: bb.worksheets.get (or creator, or project member for shared worksheets) |
+| UpdateWorksheet | [UpdateWorksheetRequest](#bytebase-v1-UpdateWorksheetRequest) | [Worksheet](#bytebase-v1-Worksheet) | Update a worksheet. The users can access this method if, - they are the creator of the worksheet; - they have bb.worksheets.manage permission on the workspace; - the sheet is shared with them with PROJECT_WRITE visibility, and they have bb.projects.get permission on the project. Permissions required: bb.worksheets.manage (or creator, or project member for PROJECT_WRITE worksheets) |
+| UpdateWorksheetOrganizer | [UpdateWorksheetOrganizerRequest](#bytebase-v1-UpdateWorksheetOrganizerRequest) | [WorksheetOrganizer](#bytebase-v1-WorksheetOrganizer) | Update the organizer of a worksheet. The access is the same as UpdateWorksheet method. Permissions required: bb.worksheets.get (or creator, or project member for shared worksheets) |
+| BatchUpdateWorksheetOrganizer | [BatchUpdateWorksheetOrganizerRequest](#bytebase-v1-BatchUpdateWorksheetOrganizerRequest) | [BatchUpdateWorksheetOrganizerResponse](#bytebase-v1-BatchUpdateWorksheetOrganizerResponse) | Batch update the organizers of worksheets. The access is the same as UpdateWorksheet method. Permissions required: bb.worksheets.get (or creator, or project member for shared worksheets) |
+| DeleteWorksheet | [DeleteWorksheetRequest](#bytebase-v1-DeleteWorksheetRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | Delete a worksheet. The access is the same as UpdateWorksheet method. Permissions required: bb.worksheets.manage (or creator, or project member for PROJECT_WRITE worksheets) |
+
+
+
+
+
<a name="v1_workspace_service-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 99855bf04e..8ea98d5afb 100644
--- a/proto/gen/grpc-doc/v1/index.html
+++ b/proto/gen/grpc-doc/v1/index.html
@@ -3083,6 +3083,93 @@
</li>
+ <li>
+ <a href="#v1%2fworksheet_service.proto">v1/worksheet_service.proto</a>
+ <ul>
+
+ <li>
+ <a href="#bytebase.v1.BatchUpdateWorksheetOrganizerRequest"><span class="badge">M</span>BatchUpdateWorksheetOrganizerRequest</a>
+ </li>
+
+ <li>
+ <a href="#bytebase.v1.BatchUpdateWorksheetOrganizerResponse"><span class="badge">M</span>BatchUpdateWorksheetOrganizerResponse</a>
+ </li>
+
+ <li>
+ <a href="#bytebase.v1.CreateWorksheetRequest"><span class="badge">M</span>CreateWorksheetRequest</a>
+ </li>
+
+ <li>
+ <a href="#bytebase.v1.DeleteWorksheetRequest"><span class="badge">M</span>DeleteWorksheetRequest</a>
+ </li>
+
+ <li>
+ <a href="#bytebase.v1.GetWorksheetRequest"><span class="badge">M</span>GetWorksheetRequest</a>
+ </li>
+
+ <li>
+ <a href="#bytebase.v1.ListWorksheetFoldersRequest"><span class="badge">M</span>ListWorksheetFoldersRequest</a>
+ </li>
+
+ <li>
+ <a href="#bytebase.v1.ListWorksheetFoldersResponse"><span class="badge">M</span>ListWorksheetFoldersResponse</a>
+ </li>
+
+ <li>
+ <a href="#bytebase.v1.ListWorksheetsRequest"><span class="badge">M</span>ListWorksheetsRequest</a>
+ </li>
+
+ <li>
+ <a href="#bytebase.v1.ListWorksheetsResponse"><span class="badge">M</span>ListWorksheetsResponse</a>
+ </li>
+
+ <li>
+ <a href="#bytebase.v1.SearchWorksheetsRequest"><span class="badge">M</span>SearchWorksheetsRequest</a>
+ </li>
+
+ <li>
+ <a href="#bytebase.v1.SearchWorksheetsResponse"><span class="badge">M</span>SearchWorksheetsResponse</a>
+ </li>
+
+ <li>
+ <a href="#bytebase.v1.UpdateWorksheetOrganizerRequest"><span class="badge">M</span>UpdateWorksheetOrganizerRequest</a>
+ </li>
+
+ <li>
+ <a href="#bytebase.v1.UpdateWorksheetRequest"><span class="badge">M</span>UpdateWorksheetRequest</a>
+ </li>
+
+ <li>
+ <a href="#bytebase.v1.Worksheet"><span class="badge">M</span>Worksheet</a>
+ </li>
+
+ <li>
+ <a href="#bytebase.v1.WorksheetFolder"><span class="badge">M</span>WorksheetFolder</a>
+ </li>
+
+ <li>
+ <a href="#bytebase.v1.WorksheetOrganizer"><span class="badge">M</span>WorksheetOrganizer</a>
+ </li>
+
+
+ <li>
+ <a href="#bytebase.v1.Worksheet.Visibility"><span class="badge">E</span>Worksheet.Visibility</a>
+ </li>
+
+ <li>
+ <a href="#bytebase.v1.WorksheetFolder.Category"><span class="badge">E</span>WorksheetFolder.Category</a>
+ </li>
+
+
+
+ <li>
+ <a href="#bytebase.v1.WorksheetService"><span class="badge">S</span>WorksheetService</a>
+ </li>
+
+ </ul>
+ </li>
+
+
<li>
<a href="#v1%2fworkspace_service.proto">v1/workspace_service.proto</a>
<ul>
@@ -35142,6 +35229,972 @@ Permissions required: bb.workloadIdentities.undelete</p></td>
+ <div class="file-heading">
+ <h2 id="v1/worksheet_service.proto">v1/worksheet_service.proto</h2><a href="#title">Top</a>
+ </div>
+ <p></p>
+
+
+ <h3 id="bytebase.v1.BatchUpdateWorksheetOrganizerRequest">BatchUpdateWorksheetOrganizerRequest</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>parent</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>The parent resource whose worksheets&#39; organizers are updated.
+Format: projects/{project} </p></td>
+ </tr>
+
+ <tr>
+ <td>filter</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>To filter the batch update target.
+The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+Supported filter:
+- name: the worksheet name in &#34;projects/{project}/worksheets/{worksheet}&#34; format, support &#34;==&#34; and &#34;in [xx]&#34; operator.
+- creator: the worksheet creator in &#34;users/{email}&#34; format, support &#34;==&#34; and &#34;!=&#34; operator.
+- starred: should be &#34;true&#34; or &#34;false&#34;, filter starred/unstarred sheets, support &#34;==&#34; operator.
+- visibility: check Visibility enum in the Worksheet message for values, support &#34;==&#34; and &#34;in [xx]&#34; operator.
+- folder: the worksheet organizer folder path, support exact &#34;==&#34; operator. </p></td>
+ </tr>
+
+ <tr>
+ <td>organizer</td>
+ <td><a href="#bytebase.v1.WorksheetOrganizer">WorksheetOrganizer</a></td>
+ <td></td>
+ <td><p>The organizer fields to update. </p></td>
+ </tr>
+
+ <tr>
+ <td>update_mask</td>
+ <td><a href="#google.protobuf.FieldMask">google.protobuf.FieldMask</a></td>
+ <td></td>
+ <td><p>The list of fields to be updated.
+Fields are specified relative to the worksheet organizer.
+Only support update the following fields for now:
+- `starred`
+- `folders` </p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+
+
+
+
+ <h3 id="bytebase.v1.BatchUpdateWorksheetOrganizerResponse">BatchUpdateWorksheetOrganizerResponse</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>worksheet_organizers</td>
+ <td><a href="#bytebase.v1.WorksheetOrganizer">WorksheetOrganizer</a></td>
+ <td>repeated</td>
+ <td><p> </p></td>
+ </tr>
+
+ <tr>
+ <td>updated_count</td>
+ <td><a href="#int32">int32</a></td>
+ <td></td>
+ <td><p> </p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+
+
+
+
+ <h3 id="bytebase.v1.CreateWorksheetRequest">CreateWorksheetRequest</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>parent</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>The parent resource where this worksheet will be created.
+Format: projects/{project} </p></td>
+ </tr>
+
+ <tr>
+ <td>worksheet</td>
+ <td><a href="#bytebase.v1.Worksheet">Worksheet</a></td>
+ <td></td>
+ <td><p>The worksheet to create. </p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+
+
+
+
+ <h3 id="bytebase.v1.DeleteWorksheetRequest">DeleteWorksheetRequest</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 worksheet to delete.
+Format: projects/{project}/worksheets/{worksheet} </p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+
+
+
+
+ <h3 id="bytebase.v1.GetWorksheetRequest">GetWorksheetRequest</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 worksheet to retrieve.
+Format: projects/{project}/worksheets/{worksheet} </p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+
+
+
+
+ <h3 id="bytebase.v1.ListWorksheetFoldersRequest">ListWorksheetFoldersRequest</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>parent</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>The parent resource of the worksheet folders.
+Format: projects/{project} </p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+
+
+
+
+ <h3 id="bytebase.v1.ListWorksheetFoldersResponse">ListWorksheetFoldersResponse</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>folders</td>
+ <td><a href="#bytebase.v1.WorksheetFolder">WorksheetFolder</a></td>
+ <td>repeated</td>
+ <td><p>The caller&#39;s worksheet folders. </p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+
+
+
+
+ <h3 id="bytebase.v1.ListWorksheetsRequest">ListWorksheetsRequest</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>parent</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>The parent resource of the worksheets.
+Format: projects/{project}
+Use &#34;projects/-&#34; to list worksheets across all projects. </p></td>
+ </tr>
+
+ <tr>
+ <td>filter</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>To filter the list result.
+The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+Supported filter:
+- creator: the worksheet creator in &#34;users/{email}&#34; format, support &#34;==&#34; and &#34;!=&#34; operator.
+
+For example:
+creator == &#34;users/{email}&#34;
+creator != &#34;users/{email}&#34; </p></td>
+ </tr>
+
+ <tr>
+ <td>page_size</td>
+ <td><a href="#int32">int32</a></td>
+ <td></td>
+ <td><p>The maximum number of worksheets to return. The service may return fewer than
+this value.
+If unspecified, at most 10 worksheets 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 `ListWorksheets` call.
+Provide this to retrieve the subsequent page.
+
+When paginating, all other parameters provided to `ListWorksheets` must match
+the call that provided the page token. </p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+
+
+
+
+ <h3 id="bytebase.v1.ListWorksheetsResponse">ListWorksheetsResponse</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>worksheets</td>
+ <td><a href="#bytebase.v1.Worksheet">Worksheet</a></td>
+ <td>repeated</td>
+ <td><p>The worksheets from the specified parent. </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 worksheets.
+Pass this value in the page_token field in the subsequent call to
+`ListWorksheets` method to retrieve the next page of worksheets. </p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+
+
+
+
+ <h3 id="bytebase.v1.SearchWorksheetsRequest">SearchWorksheetsRequest</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>parent</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>The parent resource of the worksheets.
+Format: projects/{project} </p></td>
+ </tr>
+
+ <tr>
+ <td>filter</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>To filter the search result.
+The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
+
+Supported filter:
+- name: the worksheet name in &#34;projects/{project}/worksheets/{worksheet}&#34; format, support &#34;==&#34; and &#34;in [xx]&#34; operator.
+- title: the worksheet title, support &#34;contains&#34; operator.
+- creator: the worksheet creator in &#34;users/{email}&#34; format, support &#34;==&#34; and &#34;!=&#34; operator.
+- starred: should be &#34;true&#34; or &#34;false&#34;, filter starred/unstarred sheets, support &#34;==&#34; operator.
+- visibility: check Visibility enum in the Worksheet message for values, support &#34;==&#34; and &#34;in [xx]&#34; operator.
+- folder: the worksheet organizer folder path, support &#34;==&#34; operator.
+
+For example:
+creator == &#34;users/{email}&#34;
+title.contains(&#34;worksheet title&#34;)
+creator != &#34;users/{email}&#34;
+starred == true
+starred == false
+visibility in [&#34;PRIVATE&#34;, &#34;PROJECT_READ&#34;, &#34;PROJECT_WRITE&#34;]
+visibility == &#34;PRIVATE&#34;
+folder == &#34;foo/bar&#34; </p></td>
+ </tr>
+
+ <tr>
+ <td>page_size</td>
+ <td><a href="#int32">int32</a></td>
+ <td></td>
+ <td><p>The maximum number of worksheets to return. The service may return fewer than
+this value.
+If unspecified, at most 10 worksheets 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 `SearchWorksheets` call.
+Provide this to retrieve the subsequent page. </p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+
+
+
+
+ <h3 id="bytebase.v1.SearchWorksheetsResponse">SearchWorksheetsResponse</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>worksheets</td>
+ <td><a href="#bytebase.v1.Worksheet">Worksheet</a></td>
+ <td>repeated</td>
+ <td><p>The worksheets that matched the search criteria. </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 worksheets.
+Pass this value in the page_token field in the subsequent call to
+`SearchWorksheets` method to retrieve the next page of worksheets. </p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+
+
+
+
+ <h3 id="bytebase.v1.UpdateWorksheetOrganizerRequest">UpdateWorksheetOrganizerRequest</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>organizer</td>
+ <td><a href="#bytebase.v1.WorksheetOrganizer">WorksheetOrganizer</a></td>
+ <td></td>
+ <td><p>The organizer to update.
+
+The organizer&#39;s `worksheet` field is used to identify the worksheet.
+Format: projects/{project}/worksheets/{worksheet} </p></td>
+ </tr>
+
+ <tr>
+ <td>update_mask</td>
+ <td><a href="#google.protobuf.FieldMask">google.protobuf.FieldMask</a></td>
+ <td></td>
+ <td><p>The list of fields to be updated.
+Fields are specified relative to the worksheet organizer.
+Only support update the following fields for now:
+- `starred` </p></td>
+ </tr>
+
+ <tr>
+ <td>allow_missing</td>
+ <td><a href="#bool">bool</a></td>
+ <td></td>
+ <td><p>If set to true, and the worksheet organizer is not found, a new worksheet organizer will be created.
+In this situation, `update_mask` is ignored. </p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+
+
+
+
+ <h3 id="bytebase.v1.UpdateWorksheetRequest">UpdateWorksheetRequest</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>worksheet</td>
+ <td><a href="#bytebase.v1.Worksheet">Worksheet</a></td>
+ <td></td>
+ <td><p>The worksheet to update.
+
+The worksheet&#39;s `name` field is used to identify the worksheet to update.
+Format: projects/{project}/worksheets/{worksheet} </p></td>
+ </tr>
+
+ <tr>
+ <td>update_mask</td>
+ <td><a href="#google.protobuf.FieldMask">google.protobuf.FieldMask</a></td>
+ <td></td>
+ <td><p>The list of fields to be updated.
+Fields are specified relative to the worksheet.
+(e.g., `title`, `statement`; *not* `worksheet.title` or `worksheet.statement`)
+Only support update the following fields for now:
+- `title`
+- `statement`
+- `starred`
+- `visibility` </p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+
+
+
+
+ <h3 id="bytebase.v1.Worksheet">Worksheet</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 worksheet resource, generated by the server.
+Canonical parent is project.
+Format: projects/{project}/worksheets/{worksheet} </p></td>
+ </tr>
+
+ <tr>
+ <td>project</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>The project resource name.
+Format: projects/{project} </p></td>
+ </tr>
+
+ <tr>
+ <td>database</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>The database resource name.
+Format: instances/{instance}/databases/{database}
+If the database parent doesn&#39;t exist, the database field is empty. </p></td>
+ </tr>
+
+ <tr>
+ <td>title</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>The title of the worksheet. </p></td>
+ </tr>
+
+ <tr>
+ <td>creator</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>The creator of the Worksheet.
+Format: users/{email} </p></td>
+ </tr>
+
+ <tr>
+ <td>create_time</td>
+ <td><a href="#google.protobuf.Timestamp">google.protobuf.Timestamp</a></td>
+ <td></td>
+ <td><p>The create time of the worksheet. </p></td>
+ </tr>
+
+ <tr>
+ <td>update_time</td>
+ <td><a href="#google.protobuf.Timestamp">google.protobuf.Timestamp</a></td>
+ <td></td>
+ <td><p>The last update time of the worksheet. </p></td>
+ </tr>
+
+ <tr>
+ <td>content</td>
+ <td><a href="#bytes">bytes</a></td>
+ <td></td>
+ <td><p>The content of the worksheet.
+By default, it will be cut off in SearchWorksheet() method. If it doesn&#39;t match the `content_size`, you can
+use GetWorksheet() request to retrieve the full content. </p></td>
+ </tr>
+
+ <tr>
+ <td>content_size</td>
+ <td><a href="#int64">int64</a></td>
+ <td></td>
+ <td><p>content_size is the full size of the content, may not match the size of the `content` field. </p></td>
+ </tr>
+
+ <tr>
+ <td>visibility</td>
+ <td><a href="#bytebase.v1.Worksheet.Visibility">Worksheet.Visibility</a></td>
+ <td></td>
+ <td><p> </p></td>
+ </tr>
+
+ <tr>
+ <td>starred</td>
+ <td><a href="#bool">bool</a></td>
+ <td></td>
+ <td><p>starred indicates whether the worksheet is starred by the current authenticated user. </p></td>
+ </tr>
+
+ <tr>
+ <td>folders</td>
+ <td><a href="#string">string</a></td>
+ <td>repeated</td>
+ <td><p> </p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+
+
+
+
+ <h3 id="bytebase.v1.WorksheetFolder">WorksheetFolder</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>folders</td>
+ <td><a href="#string">string</a></td>
+ <td>repeated</td>
+ <td><p>The folder path segments. </p></td>
+ </tr>
+
+ <tr>
+ <td>category</td>
+ <td><a href="#bytebase.v1.WorksheetFolder.Category">WorksheetFolder.Category</a></td>
+ <td></td>
+ <td><p>The folder category. </p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+
+
+
+
+ <h3 id="bytebase.v1.WorksheetOrganizer">WorksheetOrganizer</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>worksheet</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>The name of the worksheet.
+Format: projects/{project}/worksheets/{worksheet} </p></td>
+ </tr>
+
+ <tr>
+ <td>starred</td>
+ <td><a href="#bool">bool</a></td>
+ <td></td>
+ <td><p>starred means if the worksheet is starred. </p></td>
+ </tr>
+
+ <tr>
+ <td>folders</td>
+ <td><a href="#string">string</a></td>
+ <td>repeated</td>
+ <td><p> </p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+
+
+
+
+
+
+ <h3 id="bytebase.v1.Worksheet.Visibility">Worksheet.Visibility</h3>
+ <p></p>
+ <table class="enum-table">
+ <thead>
+ <tr><td>Name</td><td>Number</td><td>Description</td></tr>
+ </thead>
+ <tbody>
+
+ <tr>
+ <td>VISIBILITY_UNSPECIFIED</td>
+ <td>0</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>PROJECT_READ</td>
+ <td>1</td>
+ <td><p>Read access in project scope, worksheet OWNER/DBA and project OWNER can read/write, other project members can read.</p></td>
+ </tr>
+
+ <tr>
+ <td>PROJECT_WRITE</td>
+ <td>2</td>
+ <td><p>Write access in project scope, worksheet OWNER/DBA and all members in the project can write the worksheet.</p></td>
+ </tr>
+
+ <tr>
+ <td>PRIVATE</td>
+ <td>3</td>
+ <td><p>Private, only worksheet OWNER can read/write.</p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+ <h3 id="bytebase.v1.WorksheetFolder.Category">WorksheetFolder.Category</h3>
+ <p></p>
+ <table class="enum-table">
+ <thead>
+ <tr><td>Name</td><td>Number</td><td>Description</td></tr>
+ </thead>
+ <tbody>
+
+ <tr>
+ <td>CATEGORY_UNSPECIFIED</td>
+ <td>0</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>MINE</td>
+ <td>1</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>SHARED</td>
+ <td>2</td>
+ <td><p></p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+
+
+
+
+ <h3 id="bytebase.v1.WorksheetService">WorksheetService</h3>
+ <p>WorksheetService manages SQL worksheets for query development.</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>CreateWorksheet</td>
+ <td><a href="#bytebase.v1.CreateWorksheetRequest">CreateWorksheetRequest</a></td>
+ <td><a href="#bytebase.v1.Worksheet">Worksheet</a></td>
+ <td><p>Creates a personal worksheet used in SQL Editor. Any authenticated user can create their own worksheets.
+Permissions required: None (authenticated users only)</p></td>
+ </tr>
+
+ <tr>
+ <td>GetWorksheet</td>
+ <td><a href="#bytebase.v1.GetWorksheetRequest">GetWorksheetRequest</a></td>
+ <td><a href="#bytebase.v1.Worksheet">Worksheet</a></td>
+ <td><p>Get a worksheet by name.
+The users can access this method if,
+- they are the creator of the worksheet;
+- they have bb.worksheets.get permission on the workspace;
+- the sheet is shared with them with PROJECT_READ and PROJECT_WRITE visibility, and they have bb.projects.get permission on the project.
+Permissions required: bb.worksheets.get (or creator, or project member for shared worksheets)</p></td>
+ </tr>
+
+ <tr>
+ <td>ListWorksheets</td>
+ <td><a href="#bytebase.v1.ListWorksheetsRequest">ListWorksheetsRequest</a></td>
+ <td><a href="#bytebase.v1.ListWorksheetsResponse">ListWorksheetsResponse</a></td>
+ <td><p>List worksheets.
+This is used for listing worksheets in a project, or across all projects by using `projects/-`.
+Permissions required: bb.worksheets.list</p></td>
+ </tr>
+
+ <tr>
+ <td>ListWorksheetFolders</td>
+ <td><a href="#bytebase.v1.ListWorksheetFoldersRequest">ListWorksheetFoldersRequest</a></td>
+ <td><a href="#bytebase.v1.ListWorksheetFoldersResponse">ListWorksheetFoldersResponse</a></td>
+ <td><p>List the caller&#39;s worksheet folders.
+Only folders stored in the caller&#39;s worksheet organizer are returned.</p></td>
+ </tr>
+
+ <tr>
+ <td>SearchWorksheets</td>
+ <td><a href="#bytebase.v1.SearchWorksheetsRequest">SearchWorksheetsRequest</a></td>
+ <td><a href="#bytebase.v1.SearchWorksheetsResponse">SearchWorksheetsResponse</a></td>
+ <td><p>Search for worksheets.
+This is used for finding my worksheets or worksheets shared by other people.
+The sheet accessibility is the same as GetWorksheet().
+Permissions required: bb.worksheets.get (or creator, or project member for shared worksheets)</p></td>
+ </tr>
+
+ <tr>
+ <td>UpdateWorksheet</td>
+ <td><a href="#bytebase.v1.UpdateWorksheetRequest">UpdateWorksheetRequest</a></td>
+ <td><a href="#bytebase.v1.Worksheet">Worksheet</a></td>
+ <td><p>Update a worksheet.
+The users can access this method if,
+- they are the creator of the worksheet;
+- they have bb.worksheets.manage permission on the workspace;
+- the sheet is shared with them with PROJECT_WRITE visibility, and they have bb.projects.get permission on the project.
+Permissions required: bb.worksheets.manage (or creator, or project member for PROJECT_WRITE worksheets)</p></td>
+ </tr>
+
+ <tr>
+ <td>UpdateWorksheetOrganizer</td>
+ <td><a href="#bytebase.v1.UpdateWorksheetOrganizerRequest">UpdateWorksheetOrganizerRequest</a></td>
+ <td><a href="#bytebase.v1.WorksheetOrganizer">WorksheetOrganizer</a></td>
+ <td><p>Update the organizer of a worksheet.
+The access is the same as UpdateWorksheet method.
+Permissions required: bb.worksheets.get (or creator, or project member for shared worksheets)</p></td>
+ </tr>
+
+ <tr>
+ <td>BatchUpdateWorksheetOrganizer</td>
+ <td><a href="#bytebase.v1.BatchUpdateWorksheetOrganizerRequest">BatchUpdateWorksheetOrganizerRequest</a></td>
+ <td><a href="#bytebase.v1.BatchUpdateWorksheetOrganizerResponse">BatchUpdateWorksheetOrganizerResponse</a></td>
+ <td><p>Batch update the organizers of worksheets.
+The access is the same as UpdateWorksheet method.
+Permissions required: bb.worksheets.get (or creator, or project member for shared worksheets)</p></td>
+ </tr>
+
+ <tr>
+ <td>DeleteWorksheet</td>
+ <td><a href="#bytebase.v1.DeleteWorksheetRequest">DeleteWorksheetRequest</a></td>
+ <td><a href="#google.protobuf.Empty">.google.protobuf.Empty</a></td>
+ <td><p>Delete a worksheet.
+The access is the same as UpdateWorksheet method.
+Permissions required: bb.worksheets.manage (or creator, or project member for PROJECT_WRITE worksheets)</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>CreateWorksheet</td>
+ <td>POST</td>
+ <td>/v1/{parent=projects/*}/worksheets</td>
+ <td>worksheet</td>
+ </tr>
+
+
+
+
+ <tr>
+ <td>GetWorksheet</td>
+ <td>GET</td>
+ <td>/v1/{name=projects/*/worksheets/*}</td>
+ <td></td>
+ </tr>
+
+
+
+
+ <tr>
+ <td>ListWorksheets</td>
+ <td>GET</td>
+ <td>/v1/{parent=projects/*}/worksheets</td>
+ <td></td>
+ </tr>
+
+
+
+
+ <tr>
+ <td>ListWorksheetFolders</td>
+ <td>GET</td>
+ <td>/v1/{parent=projects/*}/worksheetFolders</td>
+ <td></td>
+ </tr>
+
+
+
+
+ <tr>
+ <td>SearchWorksheets</td>
+ <td>POST</td>
+ <td>/v1/{parent=projects/*}/worksheets:search</td>
+ <td>*</td>
+ </tr>
+
+
+
+
+ <tr>
+ <td>UpdateWorksheet</td>
+ <td>PATCH</td>
+ <td>/v1/{worksheet.name=projects/*/worksheets/*}</td>
+ <td>worksheet</td>
+ </tr>
+
+
+
+
+ <tr>
+ <td>UpdateWorksheetOrganizer</td>
+ <td>PATCH</td>
+ <td>/v1/{organizer.worksheet=projects/*/worksheets/*}/organizer</td>
+ <td>organizer</td>
+ </tr>
+
+
+
+
+ <tr>
+ <td>BatchUpdateWorksheetOrganizer</td>
+ <td>POST</td>
+ <td>/v1/{parent=projects/*}/worksheets/organizers:batchUpdate</td>
+ <td>*</td>
+ </tr>
+
+
+
+
+ <tr>
+ <td>DeleteWorksheet</td>
+ <td>DELETE</td>
+ <td>/v1/{name=projects/*/worksheets/*}</td>
+ <td></td>
+ </tr>
+
+
+ </tbody>
+ </table>
+
+
+
+
<div class="file-heading">
<h2 id="v1/workspace_service.proto">v1/workspace_service.proto</h2><a href="#title">Top</a>
</div>
diff --git a/proto/v1/v1/auth_service.proto b/proto/v1/v1/auth_service.proto
index 1de3c9b612..b5945d2886 100644
--- a/proto/v1/v1/auth_service.proto
+++ b/proto/v1/v1/auth_service.proto
@@ -94,6 +94,7 @@ service AuthService {
};
option (bytebase.v1.allow_without_credential) = true;
option (bytebase.v1.mcp_method_class) = FORBIDDEN;
+ option (bytebase.v1.audit) = true;
}
// Resets the user's password using a password reset token from email.
@@ -105,6 +106,7 @@ service AuthService {
};
option (bytebase.v1.allow_without_credential) = true;
option (bytebase.v1.mcp_method_class) = FORBIDDEN;
+ option (bytebase.v1.audit) = true;
}
// Sends a 6-digit verification code to the email for login/signup.
diff --git a/proto/v1/v1/release_service.proto b/proto/v1/v1/release_service.proto
index bc1d42e75f..1c8b39ac99 100644
--- a/proto/v1/v1/release_service.proto
+++ b/proto/v1/v1/release_service.proto
@@ -45,6 +45,7 @@ service ReleaseService {
option (google.api.method_signature) = "parent,release";
option (bytebase.v1.permission) = "bb.releases.create";
option (bytebase.v1.auth_method) = IAM;
+ option (bytebase.v1.audit) = true;
}
// Updates an existing release.
@@ -58,6 +59,7 @@ service ReleaseService {
option (google.api.method_signature) = "release,update_mask";
option (bytebase.v1.permission) = "bb.releases.update";
option (bytebase.v1.auth_method) = IAM;
+ option (bytebase.v1.audit) = true;
}
// Deletes a release.
diff --git a/proto/v1/v1/saved_query_service.proto b/proto/v1/v1/saved_query_service.proto
index d96ef61043..f2634dfeb2 100644
--- a/proto/v1/v1/saved_query_service.proto
+++ b/proto/v1/v1/saved_query_service.proto
@@ -27,6 +27,7 @@ service SavedQueryService {
};
option (google.api.method_signature) = "parent,saved_query";
option (bytebase.v1.auth_method) = CUSTOM;
+ option (bytebase.v1.audit) = true;
}
// Get a saved query by name.
@@ -113,13 +114,17 @@ service SavedQueryService {
option (google.api.http) = {delete: "/v1/{name=projects/*/savedQueries/*}"};
option (google.api.method_signature) = "name";
option (bytebase.v1.auth_method) = CUSTOM;
+ option (bytebase.v1.audit) = true;
}
}
message CreateSavedQueryRequest {
// The parent resource where this saved query will be created.
// Format: projects/{project}
- string parent = 1 [(google.api.field_behavior) = REQUIRED];
+ string parent = 1 [
+ (google.api.field_behavior) = REQUIRED,
+ (google.api.resource_reference) = {type: "bytebase.com/Project"}
+ ];
// The saved query to create.
SavedQuery saved_query = 2 [(google.api.field_behavior) = REQUIRED];
@@ -281,7 +286,10 @@ message SavedQueryOrganizer {
message DeleteSavedQueryRequest {
// The name of the saved query to delete.
// Format: projects/{project}/savedQueries/{savedQuery}
- string name = 1 [(google.api.field_behavior) = REQUIRED];
+ string name = 1 [
+ (google.api.field_behavior) = REQUIRED,
+ (google.api.resource_reference) = {type: "bytebase.com/SavedQuery"}
+ ];
}
message SearchSavedQueriesRequest {
@@ -330,6 +338,11 @@ message SearchSavedQueriesResponse {
}
message SavedQuery {
+ option (google.api.resource) = {
+ type: "bytebase.com/SavedQuery"
+ pattern: "projects/{project}/savedQueries/{saved_query}"
+ };
+
// The name of the saved query resource, generated by the server.
// Canonical parent is project.
// Format: projects/{project}/savedQueries/{savedQuery}