Skip to content

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

feat: add AccessGrant API proto for temporary access management (#19296)

rebelice6bf891c8863c
diff --git a/backend/api/mcp/gen/openapi.yaml b/backend/api/mcp/gen/openapi.yaml
index 843ced8009..69f47e1d78 100644
--- a/backend/api/mcp/gen/openapi.yaml
+++ b/backend/api/mcp/gen/openapi.yaml
@@ -1,6 +1,186 @@
openapi: 3.1.0
info: {}
paths:
+ /bytebase.v1.AccessGrantService/ActivateAccessGrant:
+ post:
+ tags:
+ - bytebase.v1.AccessGrantService
+ summary: ActivateAccessGrant
+ description: Activates a pending access grant.
+ operationId: bytebase.v1.AccessGrantService.ActivateAccessGrant
+ 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.ActivateAccessGrantRequest'
+ 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.AccessGrant'
+ /bytebase.v1.AccessGrantService/CreateAccessGrant:
+ post:
+ tags:
+ - bytebase.v1.AccessGrantService
+ summary: CreateAccessGrant
+ description: Creates an access grant.
+ operationId: bytebase.v1.AccessGrantService.CreateAccessGrant
+ 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.CreateAccessGrantRequest'
+ 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.AccessGrant'
+ /bytebase.v1.AccessGrantService/GetAccessGrant:
+ post:
+ tags:
+ - bytebase.v1.AccessGrantService
+ summary: GetAccessGrant
+ description: Gets an access grant by name.
+ operationId: bytebase.v1.AccessGrantService.GetAccessGrant
+ 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.GetAccessGrantRequest'
+ 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.AccessGrant'
+ /bytebase.v1.AccessGrantService/ListAccessGrants:
+ post:
+ tags:
+ - bytebase.v1.AccessGrantService
+ summary: ListAccessGrants
+ description: Lists access grants in a project.
+ operationId: bytebase.v1.AccessGrantService.ListAccessGrants
+ 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.ListAccessGrantsRequest'
+ 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.ListAccessGrantsResponse'
+ /bytebase.v1.AccessGrantService/RevokeAccessGrant:
+ post:
+ tags:
+ - bytebase.v1.AccessGrantService
+ summary: RevokeAccessGrant
+ description: Revokes an active access grant.
+ operationId: bytebase.v1.AccessGrantService.RevokeAccessGrant
+ 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.RevokeAccessGrantRequest'
+ 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.AccessGrant'
/bytebase.v1.ActuatorService/DeleteCache:
post:
tags:
@@ -6743,6 +6923,88 @@ components:
- CLAUDE
- GEMINI
- AZURE_OPENAI
+ bytebase.v1.AccessGrant:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the access grant, generated by the server.
+ Format: projects/{project}/accessGrants/{access_grant}
+ The {access_grant} segment is a server-generated unique ID.
+ creator:
+ type: string
+ title: creator
+ description: |-
+ The creator of the access grant.
+ Format: users/{email}
+ status:
+ title: status
+ description: |-
+ The status of the access grant.
+ An ACTIVE grant with `expire_time` in the past is effectively expired
+ and no longer authorizes access. Use `expire_time` to determine
+ whether an ACTIVE grant has expired.
+ $ref: '#/components/schemas/bytebase.v1.AccessGrant.Status'
+ expireTime:
+ title: expire_time
+ description: |-
+ The expiration time of the access grant.
+ When the current time exceeds this value, an ACTIVE grant is
+ considered expired and no longer authorizes access.
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ issue:
+ type: string
+ title: issue
+ description: |-
+ The issue associated with the access grant.
+ Can be empty.
+ Format: projects/{project}/issues/{issue}
+ targets:
+ type: array
+ items:
+ type: string
+ title: targets
+ description: |-
+ The target databases for this access grant.
+ Format: instances/{instance}/databases/{database}
+ query:
+ type: string
+ title: query
+ description: The query permission granted.
+ unmask:
+ type: boolean
+ title: unmask
+ description: Whether the grant allows unmasking sensitive data.
+ createTime:
+ title: create_time
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ updateTime:
+ title: update_time
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ title: AccessGrant
+ additionalProperties: false
+ bytebase.v1.AccessGrant.Status:
+ type: string
+ title: Status
+ enum:
+ - STATUS_UNSPECIFIED
+ - PENDING
+ - ACTIVE
+ - REVOKED
+ description: The status of the access grant.
+ bytebase.v1.ActivateAccessGrantRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the access grant to activate.
+ Format: projects/{project}/accessGrants/{access_grant}
+ title: ActivateAccessGrantRequest
+ additionalProperties: false
bytebase.v1.Activity:
type: object
title: Activity
@@ -8310,6 +8572,21 @@ components:
- IDENTITY_GENERATION_UNSPECIFIED
- ALWAYS
- BY_DEFAULT
+ bytebase.v1.CreateAccessGrantRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: |-
+ The parent project for the access grant.
+ Format: projects/{project}
+ accessGrant:
+ title: access_grant
+ description: The access grant to create.
+ $ref: '#/components/schemas/bytebase.v1.AccessGrant'
+ title: CreateAccessGrantRequest
+ additionalProperties: false
bytebase.v1.CreateDatabaseGroupRequest:
type: object
properties:
@@ -10201,6 +10478,17 @@ components:
- TYPE_UNSPECIFIED
- VIRTUAL
- STORED
+ bytebase.v1.GetAccessGrantRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the access grant to retrieve.
+ Format: projects/{project}/accessGrants/{access_grant}
+ title: GetAccessGrantRequest
+ additionalProperties: false
bytebase.v1.GetActuatorInfoRequest:
type: object
title: GetActuatorInfoRequest
@@ -11210,6 +11498,12 @@ components:
approvalStatus:
title: approval_status
$ref: '#/components/schemas/bytebase.v1.Issue.ApprovalStatus'
+ accessGrant:
+ type: string
+ title: access_grant
+ description: |-
+ The access grant associated with this issue.
+ Format: projects/{project}/accessGrants/{access_grant}
title: Issue
additionalProperties: false
bytebase.v1.Issue.ApprovalStatus:
@@ -11254,6 +11548,7 @@ components:
- DATABASE_CHANGE
- GRANT_REQUEST
- DATABASE_EXPORT
+ - ACCESS_GRANT
description: The type of issue.
bytebase.v1.IssueComment:
type: object
@@ -11525,6 +11820,55 @@ components:
title: Label
additionalProperties: false
description: A label for categorizing and organizing issues.
+ bytebase.v1.ListAccessGrantsRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: |-
+ The parent project of the access grants.
+ Format: projects/{project}
+ pageSize:
+ type: integer
+ title: page_size
+ format: int32
+ description: The maximum number of access grants to return.
+ pageToken:
+ type: string
+ title: page_token
+ description: A page token from a previous ListAccessGrants call.
+ filter:
+ type: string
+ title: filter
+ description: |-
+ Filter expression using AIP-160 syntax.
+ Supported fields: creator, status, issue, expire_time, create_time
+ Examples:
+ - 'creator = "users/[email protected]"'
+ - 'status = "ACTIVE"'
+ - 'creator = "users/[email protected]" AND status = "ACTIVE"'
+ - 'issue = "projects/x/issues/123"'
+ - 'status = "ACTIVE" AND expire_time > "2024-02-01T00:00:00Z"'
+ title: ListAccessGrantsRequest
+ additionalProperties: false
+ bytebase.v1.ListAccessGrantsResponse:
+ type: object
+ properties:
+ accessGrants:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.AccessGrant'
+ title: access_grants
+ description: The access grants from the specified request.
+ nextPageToken:
+ type: string
+ title: next_page_token
+ description: |-
+ A token, which can be sent as `page_token` to retrieve the next page.
+ If this field is omitted, there are no subsequent pages.
+ title: ListAccessGrantsResponse
+ additionalProperties: false
bytebase.v1.ListChangelogsRequest:
type: object
properties:
@@ -14665,6 +15009,17 @@ components:
- VERSIONED
- DECLARATIVE
description: The type of schema revision.
+ bytebase.v1.RevokeAccessGrantRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the access grant to revoke.
+ Format: projects/{project}/accessGrants/{access_grant}
+ title: RevokeAccessGrantRequest
+ additionalProperties: false
bytebase.v1.RiskLevel:
type: string
title: RiskLevel
@@ -19623,6 +19978,8 @@ components:
documentation for additional information.
security: []
tags:
+ - name: bytebase.v1.AccessGrantService
+ description: AccessGrantService manages temporary access grants within projects.
- name: bytebase.v1.IssueService
description: IssueService manages issues for tracking database changes and tasks.
- name: bytebase.v1.SettingService
diff --git a/backend/generated-go/v1/access_grant_service.pb.go b/backend/generated-go/v1/access_grant_service.pb.go
new file mode 100644
index 0000000000..fb55194e48
--- /dev/null
+++ b/backend/generated-go/v1/access_grant_service.pb.go
@@ -0,0 +1,677 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// protoc-gen-go v1.36.11
+// protoc (unknown)
+// source: v1/access_grant_service.proto
+
+package v1
+
+import (
+ _ "google.golang.org/genproto/googleapis/api/annotations"
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+ timestamppb "google.golang.org/protobuf/types/known/timestamppb"
+ reflect "reflect"
+ sync "sync"
+ unsafe "unsafe"
+)
+
+const (
+ // Verify that this generated code is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+// The status of the access grant.
+type AccessGrant_Status int32
+
+const (
+ AccessGrant_STATUS_UNSPECIFIED AccessGrant_Status = 0
+ // The access grant is pending approval.
+ AccessGrant_PENDING AccessGrant_Status = 1
+ // The access grant is active. Check `expire_time` to determine
+ // whether the grant is still valid or has expired.
+ AccessGrant_ACTIVE AccessGrant_Status = 2
+ // The access grant has been revoked.
+ AccessGrant_REVOKED AccessGrant_Status = 3
+)
+
+// Enum value maps for AccessGrant_Status.
+var (
+ AccessGrant_Status_name = map[int32]string{
+ 0: "STATUS_UNSPECIFIED",
+ 1: "PENDING",
+ 2: "ACTIVE",
+ 3: "REVOKED",
+ }
+ AccessGrant_Status_value = map[string]int32{
+ "STATUS_UNSPECIFIED": 0,
+ "PENDING": 1,
+ "ACTIVE": 2,
+ "REVOKED": 3,
+ }
+)
+
+func (x AccessGrant_Status) Enum() *AccessGrant_Status {
+ p := new(AccessGrant_Status)
+ *p = x
+ return p
+}
+
+func (x AccessGrant_Status) String() string {
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (AccessGrant_Status) Descriptor() protoreflect.EnumDescriptor {
+ return file_v1_access_grant_service_proto_enumTypes[0].Descriptor()
+}
+
+func (AccessGrant_Status) Type() protoreflect.EnumType {
+ return &file_v1_access_grant_service_proto_enumTypes[0]
+}
+
+func (x AccessGrant_Status) Number() protoreflect.EnumNumber {
+ return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use AccessGrant_Status.Descriptor instead.
+func (AccessGrant_Status) EnumDescriptor() ([]byte, []int) {
+ return file_v1_access_grant_service_proto_rawDescGZIP(), []int{0, 0}
+}
+
+type AccessGrant struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ // The name of the access grant, generated by the server.
+ // Format: projects/{project}/accessGrants/{access_grant}
+ // The {access_grant} segment is a server-generated unique ID.
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+ // The creator of the access grant.
+ // Format: users/{email}
+ Creator string `protobuf:"bytes,2,opt,name=creator,proto3" json:"creator,omitempty"`
+ // The status of the access grant.
+ // An ACTIVE grant with `expire_time` in the past is effectively expired
+ // and no longer authorizes access. Use `expire_time` to determine
+ // whether an ACTIVE grant has expired.
+ Status AccessGrant_Status `protobuf:"varint,3,opt,name=status,proto3,enum=bytebase.v1.AccessGrant_Status" json:"status,omitempty"`
+ // The expiration time of the access grant.
+ // When the current time exceeds this value, an ACTIVE grant is
+ // considered expired and no longer authorizes access.
+ ExpireTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=expire_time,json=expireTime,proto3" json:"expire_time,omitempty"`
+ // The issue associated with the access grant.
+ // Can be empty.
+ // Format: projects/{project}/issues/{issue}
+ Issue string `protobuf:"bytes,5,opt,name=issue,proto3" json:"issue,omitempty"`
+ // The target databases for this access grant.
+ // Format: instances/{instance}/databases/{database}
+ Targets []string `protobuf:"bytes,6,rep,name=targets,proto3" json:"targets,omitempty"`
+ // The query permission granted.
+ Query string `protobuf:"bytes,7,opt,name=query,proto3" json:"query,omitempty"`
+ // Whether the grant allows unmasking sensitive data.
+ Unmask bool `protobuf:"varint,8,opt,name=unmask,proto3" json:"unmask,omitempty"`
+ CreateTime *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
+ UpdateTime *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *AccessGrant) Reset() {
+ *x = AccessGrant{}
+ mi := &file_v1_access_grant_service_proto_msgTypes[0]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *AccessGrant) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*AccessGrant) ProtoMessage() {}
+
+func (x *AccessGrant) ProtoReflect() protoreflect.Message {
+ mi := &file_v1_access_grant_service_proto_msgTypes[0]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use AccessGrant.ProtoReflect.Descriptor instead.
+func (*AccessGrant) Descriptor() ([]byte, []int) {
+ return file_v1_access_grant_service_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *AccessGrant) GetName() string {
+ if x != nil {
+ return x.Name
+ }
+ return ""
+}
+
+func (x *AccessGrant) GetCreator() string {
+ if x != nil {
+ return x.Creator
+ }
+ return ""
+}
+
+func (x *AccessGrant) GetStatus() AccessGrant_Status {
+ if x != nil {
+ return x.Status
+ }
+ return AccessGrant_STATUS_UNSPECIFIED
+}
+
+func (x *AccessGrant) GetExpireTime() *timestamppb.Timestamp {
+ if x != nil {
+ return x.ExpireTime
+ }
+ return nil
+}
+
+func (x *AccessGrant) GetIssue() string {
+ if x != nil {
+ return x.Issue
+ }
+ return ""
+}
+
+func (x *AccessGrant) GetTargets() []string {
+ if x != nil {
+ return x.Targets
+ }
+ return nil
+}
+
+func (x *AccessGrant) GetQuery() string {
+ if x != nil {
+ return x.Query
+ }
+ return ""
+}
+
+func (x *AccessGrant) GetUnmask() bool {
+ if x != nil {
+ return x.Unmask
+ }
+ return false
+}
+
+func (x *AccessGrant) GetCreateTime() *timestamppb.Timestamp {
+ if x != nil {
+ return x.CreateTime
+ }
+ return nil
+}
+
+func (x *AccessGrant) GetUpdateTime() *timestamppb.Timestamp {
+ if x != nil {
+ return x.UpdateTime
+ }
+ return nil
+}
+
+type GetAccessGrantRequest struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ // The name of the access grant to retrieve.
+ // Format: projects/{project}/accessGrants/{access_grant}
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *GetAccessGrantRequest) Reset() {
+ *x = GetAccessGrantRequest{}
+ mi := &file_v1_access_grant_service_proto_msgTypes[1]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *GetAccessGrantRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*GetAccessGrantRequest) ProtoMessage() {}
+
+func (x *GetAccessGrantRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_v1_access_grant_service_proto_msgTypes[1]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use GetAccessGrantRequest.ProtoReflect.Descriptor instead.
+func (*GetAccessGrantRequest) Descriptor() ([]byte, []int) {
+ return file_v1_access_grant_service_proto_rawDescGZIP(), []int{1}
+}
+
+func (x *GetAccessGrantRequest) GetName() string {
+ if x != nil {
+ return x.Name
+ }
+ return ""
+}
+
+type ListAccessGrantsRequest struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ // The parent project of the access grants.
+ // Format: projects/{project}
+ Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
+ // The maximum number of access grants to return.
+ PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
+ // A page token from a previous ListAccessGrants call.
+ PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
+ // Filter expression using AIP-160 syntax.
+ // Supported fields: creator, status, issue, expire_time, create_time
+ // Examples:
+ // - 'creator = "users/[email protected]"'
+ // - 'status = "ACTIVE"'
+ // - 'creator = "users/[email protected]" AND status = "ACTIVE"'
+ // - 'issue = "projects/x/issues/123"'
+ // - 'status = "ACTIVE" AND expire_time > "2024-02-01T00:00:00Z"'
+ Filter string `protobuf:"bytes,4,opt,name=filter,proto3" json:"filter,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *ListAccessGrantsRequest) Reset() {
+ *x = ListAccessGrantsRequest{}
+ mi := &file_v1_access_grant_service_proto_msgTypes[2]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *ListAccessGrantsRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ListAccessGrantsRequest) ProtoMessage() {}
+
+func (x *ListAccessGrantsRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_v1_access_grant_service_proto_msgTypes[2]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use ListAccessGrantsRequest.ProtoReflect.Descriptor instead.
+func (*ListAccessGrantsRequest) Descriptor() ([]byte, []int) {
+ return file_v1_access_grant_service_proto_rawDescGZIP(), []int{2}
+}
+
+func (x *ListAccessGrantsRequest) GetParent() string {
+ if x != nil {
+ return x.Parent
+ }
+ return ""
+}
+
+func (x *ListAccessGrantsRequest) GetPageSize() int32 {
+ if x != nil {
+ return x.PageSize
+ }
+ return 0
+}
+
+func (x *ListAccessGrantsRequest) GetPageToken() string {
+ if x != nil {
+ return x.PageToken
+ }
+ return ""
+}
+
+func (x *ListAccessGrantsRequest) GetFilter() string {
+ if x != nil {
+ return x.Filter
+ }
+ return ""
+}
+
+type ListAccessGrantsResponse struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ // The access grants from the specified request.
+ AccessGrants []*AccessGrant `protobuf:"bytes,1,rep,name=access_grants,json=accessGrants,proto3" json:"access_grants,omitempty"`
+ // A token, which can be sent as `page_token` to retrieve the next page.
+ // If this field is omitted, there are no subsequent pages.
+ NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *ListAccessGrantsResponse) Reset() {
+ *x = ListAccessGrantsResponse{}
+ mi := &file_v1_access_grant_service_proto_msgTypes[3]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *ListAccessGrantsResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ListAccessGrantsResponse) ProtoMessage() {}
+
+func (x *ListAccessGrantsResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_v1_access_grant_service_proto_msgTypes[3]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use ListAccessGrantsResponse.ProtoReflect.Descriptor instead.
+func (*ListAccessGrantsResponse) Descriptor() ([]byte, []int) {
+ return file_v1_access_grant_service_proto_rawDescGZIP(), []int{3}
+}
+
+func (x *ListAccessGrantsResponse) GetAccessGrants() []*AccessGrant {
+ if x != nil {
+ return x.AccessGrants
+ }
+ return nil
+}
+
+func (x *ListAccessGrantsResponse) GetNextPageToken() string {
+ if x != nil {
+ return x.NextPageToken
+ }
+ return ""
+}
+
+type CreateAccessGrantRequest struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ // The parent project for the access grant.
+ // Format: projects/{project}
+ Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
+ // The access grant to create.
+ AccessGrant *AccessGrant `protobuf:"bytes,2,opt,name=access_grant,json=accessGrant,proto3" json:"access_grant,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *CreateAccessGrantRequest) Reset() {
+ *x = CreateAccessGrantRequest{}
+ mi := &file_v1_access_grant_service_proto_msgTypes[4]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *CreateAccessGrantRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*CreateAccessGrantRequest) ProtoMessage() {}
+
+func (x *CreateAccessGrantRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_v1_access_grant_service_proto_msgTypes[4]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use CreateAccessGrantRequest.ProtoReflect.Descriptor instead.
+func (*CreateAccessGrantRequest) Descriptor() ([]byte, []int) {
+ return file_v1_access_grant_service_proto_rawDescGZIP(), []int{4}
+}
+
+func (x *CreateAccessGrantRequest) GetParent() string {
+ if x != nil {
+ return x.Parent
+ }
+ return ""
+}
+
+func (x *CreateAccessGrantRequest) GetAccessGrant() *AccessGrant {
+ if x != nil {
+ return x.AccessGrant
+ }
+ return nil
+}
+
+type ActivateAccessGrantRequest struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ // The name of the access grant to activate.
+ // Format: projects/{project}/accessGrants/{access_grant}
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *ActivateAccessGrantRequest) Reset() {
+ *x = ActivateAccessGrantRequest{}
+ mi := &file_v1_access_grant_service_proto_msgTypes[5]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *ActivateAccessGrantRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ActivateAccessGrantRequest) ProtoMessage() {}
+
+func (x *ActivateAccessGrantRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_v1_access_grant_service_proto_msgTypes[5]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use ActivateAccessGrantRequest.ProtoReflect.Descriptor instead.
+func (*ActivateAccessGrantRequest) Descriptor() ([]byte, []int) {
+ return file_v1_access_grant_service_proto_rawDescGZIP(), []int{5}
+}
+
+func (x *ActivateAccessGrantRequest) GetName() string {
+ if x != nil {
+ return x.Name
+ }
+ return ""
+}
+
+type RevokeAccessGrantRequest struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ // The name of the access grant to revoke.
+ // Format: projects/{project}/accessGrants/{access_grant}
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *RevokeAccessGrantRequest) Reset() {
+ *x = RevokeAccessGrantRequest{}
+ mi := &file_v1_access_grant_service_proto_msgTypes[6]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *RevokeAccessGrantRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*RevokeAccessGrantRequest) ProtoMessage() {}
+
+func (x *RevokeAccessGrantRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_v1_access_grant_service_proto_msgTypes[6]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use RevokeAccessGrantRequest.ProtoReflect.Descriptor instead.
+func (*RevokeAccessGrantRequest) Descriptor() ([]byte, []int) {
+ return file_v1_access_grant_service_proto_rawDescGZIP(), []int{6}
+}
+
+func (x *RevokeAccessGrantRequest) GetName() string {
+ if x != nil {
+ return x.Name
+ }
+ return ""
+}
+
+var File_v1_access_grant_service_proto protoreflect.FileDescriptor
+
+const file_v1_access_grant_service_proto_rawDesc = "" +
+ "\n" +
+ "\x1dv1/access_grant_service.proto\x12\vbytebase.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x13v1/annotation.proto\"\xbe\x04\n" +
+ "\vAccessGrant\x12\x12\n" +
+ "\x04name\x18\x01 \x01(\tR\x04name\x12\x1d\n" +
+ "\acreator\x18\x02 \x01(\tB\x03\xe0A\x02R\acreator\x12<\n" +
+ "\x06status\x18\x03 \x01(\x0e2\x1f.bytebase.v1.AccessGrant.StatusB\x03\xe0A\x03R\x06status\x12;\n" +
+ "\vexpire_time\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\n" +
+ "expireTime\x12\x19\n" +
+ "\x05issue\x18\x05 \x01(\tB\x03\xe0A\x03R\x05issue\x12\x1d\n" +
+ "\atargets\x18\x06 \x03(\tB\x03\xe0A\x02R\atargets\x12\x14\n" +
+ "\x05query\x18\a \x01(\tR\x05query\x12\x16\n" +
+ "\x06unmask\x18\b \x01(\bR\x06unmask\x12@\n" +
+ "\vcreate_time\x18\t \x01(\v2\x1a.google.protobuf.TimestampB\x03\xe0A\x03R\n" +
+ "createTime\x12@\n" +
+ "\vupdate_time\x18\n" +
+ " \x01(\v2\x1a.google.protobuf.TimestampB\x03\xe0A\x03R\n" +
+ "updateTime\"F\n" +
+ "\x06Status\x12\x16\n" +
+ "\x12STATUS_UNSPECIFIED\x10\x00\x12\v\n" +
+ "\aPENDING\x10\x01\x12\n" +
+ "\n" +
+ "\x06ACTIVE\x10\x02\x12\v\n" +
+ "\aREVOKED\x10\x03:M\xeaAJ\n" +
+ "\x18bytebase.com/AccessGrant\x12.projects/{project}/accessGrants/{access_grant}\"M\n" +
+ "\x15GetAccessGrantRequest\x124\n" +
+ "\x04name\x18\x01 \x01(\tB \xe0A\x02\xfaA\x1a\n" +
+ "\x18bytebase.com/AccessGrantR\x04name\"\xa3\x01\n" +
+ "\x17ListAccessGrantsRequest\x124\n" +
+ "\x06parent\x18\x01 \x01(\tB\x1c\xe0A\x02\xfaA\x16\n" +
+ "\x14bytebase.com/ProjectR\x06parent\x12\x1b\n" +
+ "\tpage_size\x18\x02 \x01(\x05R\bpageSize\x12\x1d\n" +
+ "\n" +
+ "page_token\x18\x03 \x01(\tR\tpageToken\x12\x16\n" +
+ "\x06filter\x18\x04 \x01(\tR\x06filter\"\x81\x01\n" +
+ "\x18ListAccessGrantsResponse\x12=\n" +
+ "\raccess_grants\x18\x01 \x03(\v2\x18.bytebase.v1.AccessGrantR\faccessGrants\x12&\n" +
+ "\x0fnext_page_token\x18\x02 \x01(\tR\rnextPageToken\"\x92\x01\n" +
+ "\x18CreateAccessGrantRequest\x124\n" +
+ "\x06parent\x18\x01 \x01(\tB\x1c\xe0A\x02\xfaA\x16\n" +
+ "\x14bytebase.com/ProjectR\x06parent\x12@\n" +
+ "\faccess_grant\x18\x02 \x01(\v2\x18.bytebase.v1.AccessGrantB\x03\xe0A\x02R\vaccessGrant\"R\n" +
+ "\x1aActivateAccessGrantRequest\x124\n" +
+ "\x04name\x18\x01 \x01(\tB \xe0A\x02\xfaA\x1a\n" +
+ "\x18bytebase.com/AccessGrantR\x04name\"P\n" +
+ "\x18RevokeAccessGrantRequest\x124\n" +
+ "\x04name\x18\x01 \x01(\tB \xe0A\x02\xfaA\x1a\n" +
+ "\x18bytebase.com/AccessGrantR\x04name2\xad\a\n" +
+ "\x12AccessGrantService\x12\x9e\x01\n" +
+ "\x0eGetAccessGrant\x12\".bytebase.v1.GetAccessGrantRequest\x1a\x18.bytebase.v1.AccessGrant\"N\xdaA\x04name\x8a\xea0\x13bb.accessGrants.get\x90\xea0\x01\x82\xd3\xe4\x93\x02&\x12$/v1/{name=projects/*/accessGrants/*}\x12\xb2\x01\n" +
+ "\x10ListAccessGrants\x12$.bytebase.v1.ListAccessGrantsRequest\x1a%.bytebase.v1.ListAccessGrantsResponse\"Q\xdaA\x06parent\x8a\xea0\x14bb.accessGrants.list\x90\xea0\x01\x82\xd3\xe4\x93\x02&\x12$/v1/{parent=projects/*}/accessGrants\x12\xc8\x01\n" +
+ "\x11CreateAccessGrant\x12%.bytebase.v1.CreateAccessGrantRequest\x1a\x18.bytebase.v1.AccessGrant\"r\xdaA\x13parent,access_grant\x8a\xea0\x16bb.accessGrants.create\x90\xea0\x01\x98\xea0\x01\x82\xd3\xe4\x93\x024:\faccess_grant\"$/v1/{parent=projects/*}/accessGrants\x12\xbd\x01\n" +
+ "\x13ActivateAccessGrant\x12'.bytebase.v1.ActivateAccessGrantRequest\x1a\x18.bytebase.v1.AccessGrant\"c\xdaA\x04name\x8a\xea0\x18bb.accessGrants.activate\x90\xea0\x01\x98\xea0\x01\x82\xd3\xe4\x93\x022:\x01*\"-/v1/{name=projects/*/accessGrants/*}:activate\x12\xb5\x01\n" +
+ "\x11RevokeAccessGrant\x12%.bytebase.v1.RevokeAccessGrantRequest\x1a\x18.bytebase.v1.AccessGrant\"_\xdaA\x04name\x8a\xea0\x16bb.accessGrants.revoke\x90\xea0\x01\x98\xea0\x01\x82\xd3\xe4\x93\x020:\x01*\"+/v1/{name=projects/*/accessGrants/*}:revokeB\xad\x01\n" +
+ "\x0fcom.bytebase.v1B\x17AccessGrantServiceProtoP\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 (
+ file_v1_access_grant_service_proto_rawDescOnce sync.Once
+ file_v1_access_grant_service_proto_rawDescData []byte
+)
+
+func file_v1_access_grant_service_proto_rawDescGZIP() []byte {
+ file_v1_access_grant_service_proto_rawDescOnce.Do(func() {
+ file_v1_access_grant_service_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_v1_access_grant_service_proto_rawDesc), len(file_v1_access_grant_service_proto_rawDesc)))
+ })
+ return file_v1_access_grant_service_proto_rawDescData
+}
+
+var file_v1_access_grant_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
+var file_v1_access_grant_service_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
+var file_v1_access_grant_service_proto_goTypes = []any{
+ (AccessGrant_Status)(0), // 0: bytebase.v1.AccessGrant.Status
+ (*AccessGrant)(nil), // 1: bytebase.v1.AccessGrant
+ (*GetAccessGrantRequest)(nil), // 2: bytebase.v1.GetAccessGrantRequest
+ (*ListAccessGrantsRequest)(nil), // 3: bytebase.v1.ListAccessGrantsRequest
+ (*ListAccessGrantsResponse)(nil), // 4: bytebase.v1.ListAccessGrantsResponse
+ (*CreateAccessGrantRequest)(nil), // 5: bytebase.v1.CreateAccessGrantRequest
+ (*ActivateAccessGrantRequest)(nil), // 6: bytebase.v1.ActivateAccessGrantRequest
+ (*RevokeAccessGrantRequest)(nil), // 7: bytebase.v1.RevokeAccessGrantRequest
+ (*timestamppb.Timestamp)(nil), // 8: google.protobuf.Timestamp
+}
+var file_v1_access_grant_service_proto_depIdxs = []int32{
+ 0, // 0: bytebase.v1.AccessGrant.status:type_name -> bytebase.v1.AccessGrant.Status
+ 8, // 1: bytebase.v1.AccessGrant.expire_time:type_name -> google.protobuf.Timestamp
+ 8, // 2: bytebase.v1.AccessGrant.create_time:type_name -> google.protobuf.Timestamp
+ 8, // 3: bytebase.v1.AccessGrant.update_time:type_name -> google.protobuf.Timestamp
+ 1, // 4: bytebase.v1.ListAccessGrantsResponse.access_grants:type_name -> bytebase.v1.AccessGrant
+ 1, // 5: bytebase.v1.CreateAccessGrantRequest.access_grant:type_name -> bytebase.v1.AccessGrant
+ 2, // 6: bytebase.v1.AccessGrantService.GetAccessGrant:input_type -> bytebase.v1.GetAccessGrantRequest
+ 3, // 7: bytebase.v1.AccessGrantService.ListAccessGrants:input_type -> bytebase.v1.ListAccessGrantsRequest
+ 5, // 8: bytebase.v1.AccessGrantService.CreateAccessGrant:input_type -> bytebase.v1.CreateAccessGrantRequest
+ 6, // 9: bytebase.v1.AccessGrantService.ActivateAccessGrant:input_type -> bytebase.v1.ActivateAccessGrantRequest
+ 7, // 10: bytebase.v1.AccessGrantService.RevokeAccessGrant:input_type -> bytebase.v1.RevokeAccessGrantRequest
+ 1, // 11: bytebase.v1.AccessGrantService.GetAccessGrant:output_type -> bytebase.v1.AccessGrant
+ 4, // 12: bytebase.v1.AccessGrantService.ListAccessGrants:output_type -> bytebase.v1.ListAccessGrantsResponse
+ 1, // 13: bytebase.v1.AccessGrantService.CreateAccessGrant:output_type -> bytebase.v1.AccessGrant
+ 1, // 14: bytebase.v1.AccessGrantService.ActivateAccessGrant:output_type -> bytebase.v1.AccessGrant
+ 1, // 15: bytebase.v1.AccessGrantService.RevokeAccessGrant:output_type -> bytebase.v1.AccessGrant
+ 11, // [11:16] is the sub-list for method output_type
+ 6, // [6:11] is the sub-list for method input_type
+ 6, // [6:6] is the sub-list for extension type_name
+ 6, // [6:6] is the sub-list for extension extendee
+ 0, // [0:6] is the sub-list for field type_name
+}
+
+func init() { file_v1_access_grant_service_proto_init() }
+func file_v1_access_grant_service_proto_init() {
+ if File_v1_access_grant_service_proto != nil {
+ return
+ }
+ file_v1_annotation_proto_init()
+ type x struct{}
+ out := protoimpl.TypeBuilder{
+ File: protoimpl.DescBuilder{
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+ RawDescriptor: unsafe.Slice(unsafe.StringData(file_v1_access_grant_service_proto_rawDesc), len(file_v1_access_grant_service_proto_rawDesc)),
+ NumEnums: 1,
+ NumMessages: 7,
+ NumExtensions: 0,
+ NumServices: 1,
+ },
+ GoTypes: file_v1_access_grant_service_proto_goTypes,
+ DependencyIndexes: file_v1_access_grant_service_proto_depIdxs,
+ EnumInfos: file_v1_access_grant_service_proto_enumTypes,
+ MessageInfos: file_v1_access_grant_service_proto_msgTypes,
+ }.Build()
+ File_v1_access_grant_service_proto = out.File
+ file_v1_access_grant_service_proto_goTypes = nil
+ file_v1_access_grant_service_proto_depIdxs = nil
+}
diff --git a/backend/generated-go/v1/access_grant_service.pb.gw.go b/backend/generated-go/v1/access_grant_service.pb.gw.go
new file mode 100644
index 0000000000..9766eb8d5e
--- /dev/null
+++ b/backend/generated-go/v1/access_grant_service.pb.gw.go
@@ -0,0 +1,513 @@
+// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
+// source: v1/access_grant_service.proto
+
+/*
+Package v1 is a reverse proxy.
+
+It translates gRPC into RESTful JSON APIs.
+*/
+package v1
+
+import (
+ "context"
+ "errors"
+ "io"
+ "net/http"
+
+ "github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
+ "github.com/grpc-ecosystem/grpc-gateway/v2/utilities"
+ "google.golang.org/grpc"
+ "google.golang.org/grpc/codes"
+ "google.golang.org/grpc/grpclog"
+ "google.golang.org/grpc/metadata"
+ "google.golang.org/grpc/status"
+ "google.golang.org/protobuf/proto"
+)
+
+// Suppress "imported and not used" errors
+var (
+ _ codes.Code
+ _ io.Reader
+ _ status.Status
+ _ = errors.New
+ _ = runtime.String
+ _ = utilities.NewDoubleArray
+ _ = metadata.Join
+)
+
+func request_AccessGrantService_GetAccessGrant_0(ctx context.Context, marshaler runtime.Marshaler, client AccessGrantServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var (
+ protoReq GetAccessGrantRequest
+ metadata runtime.ServerMetadata
+ err error
+ )
+ if req.Body != nil {
+ _, _ = io.Copy(io.Discard, req.Body)
+ }
+ val, ok := pathParams["name"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
+ }
+ protoReq.Name, err = runtime.String(val)
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
+ }
+ msg, err := client.GetAccessGrant(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+}
+
+func local_request_AccessGrantService_GetAccessGrant_0(ctx context.Context, marshaler runtime.Marshaler, server AccessGrantServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var (
+ protoReq GetAccessGrantRequest
+ metadata runtime.ServerMetadata
+ err error
+ )
+ val, ok := pathParams["name"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
+ }
+ protoReq.Name, err = runtime.String(val)
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
+ }
+ msg, err := server.GetAccessGrant(ctx, &protoReq)
+ return msg, metadata, err
+}
+
+var filter_AccessGrantService_ListAccessGrants_0 = &utilities.DoubleArray{Encoding: map[string]int{"parent": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
+
+func request_AccessGrantService_ListAccessGrants_0(ctx context.Context, marshaler runtime.Marshaler, client AccessGrantServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var (
+ protoReq ListAccessGrantsRequest
+ metadata runtime.ServerMetadata
+ err error
+ )
+ if req.Body != nil {
+ _, _ = io.Copy(io.Discard, req.Body)
+ }
+ val, ok := pathParams["parent"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent")
+ }
+ protoReq.Parent, err = runtime.String(val)
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err)
+ }
+ if err := req.ParseForm(); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AccessGrantService_ListAccessGrants_0); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ msg, err := client.ListAccessGrants(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+}
+
+func local_request_AccessGrantService_ListAccessGrants_0(ctx context.Context, marshaler runtime.Marshaler, server AccessGrantServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var (
+ protoReq ListAccessGrantsRequest
+ metadata runtime.ServerMetadata
+ err error
+ )
+ val, ok := pathParams["parent"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent")
+ }
+ protoReq.Parent, err = runtime.String(val)
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err)
+ }
+ if err := req.ParseForm(); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AccessGrantService_ListAccessGrants_0); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ msg, err := server.ListAccessGrants(ctx, &protoReq)
+ return msg, metadata, err
+}
+
+func request_AccessGrantService_CreateAccessGrant_0(ctx context.Context, marshaler runtime.Marshaler, client AccessGrantServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var (
+ protoReq CreateAccessGrantRequest
+ metadata runtime.ServerMetadata
+ err error
+ )
+ if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.AccessGrant); err != nil && !errors.Is(err, io.EOF) {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ if req.Body != nil {
+ _, _ = io.Copy(io.Discard, req.Body)
+ }
+ val, ok := pathParams["parent"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent")
+ }
+ protoReq.Parent, err = runtime.String(val)
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err)
+ }
+ msg, err := client.CreateAccessGrant(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+}
+
+func local_request_AccessGrantService_CreateAccessGrant_0(ctx context.Context, marshaler runtime.Marshaler, server AccessGrantServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var (
+ protoReq CreateAccessGrantRequest
+ metadata runtime.ServerMetadata
+ err error
+ )
+ if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.AccessGrant); err != nil && !errors.Is(err, io.EOF) {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ val, ok := pathParams["parent"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent")
+ }
+ protoReq.Parent, err = runtime.String(val)
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err)
+ }
+ msg, err := server.CreateAccessGrant(ctx, &protoReq)
+ return msg, metadata, err
+}
+
+func request_AccessGrantService_ActivateAccessGrant_0(ctx context.Context, marshaler runtime.Marshaler, client AccessGrantServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var (
+ protoReq ActivateAccessGrantRequest
+ metadata runtime.ServerMetadata
+ err error
+ )
+ if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ if req.Body != nil {
+ _, _ = io.Copy(io.Discard, req.Body)
+ }
+ val, ok := pathParams["name"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
+ }
+ protoReq.Name, err = runtime.String(val)
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
+ }
+ msg, err := client.ActivateAccessGrant(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+}
+
+func local_request_AccessGrantService_ActivateAccessGrant_0(ctx context.Context, marshaler runtime.Marshaler, server AccessGrantServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var (
+ protoReq ActivateAccessGrantRequest
+ metadata runtime.ServerMetadata
+ err error
+ )
+ if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ val, ok := pathParams["name"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
+ }
+ protoReq.Name, err = runtime.String(val)
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
+ }
+ msg, err := server.ActivateAccessGrant(ctx, &protoReq)
+ return msg, metadata, err
+}
+
+func request_AccessGrantService_RevokeAccessGrant_0(ctx context.Context, marshaler runtime.Marshaler, client AccessGrantServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var (
+ protoReq RevokeAccessGrantRequest
+ metadata runtime.ServerMetadata
+ err error
+ )
+ if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ if req.Body != nil {
+ _, _ = io.Copy(io.Discard, req.Body)
+ }
+ val, ok := pathParams["name"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
+ }
+ protoReq.Name, err = runtime.String(val)
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
+ }
+ msg, err := client.RevokeAccessGrant(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+}
+
+func local_request_AccessGrantService_RevokeAccessGrant_0(ctx context.Context, marshaler runtime.Marshaler, server AccessGrantServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var (
+ protoReq RevokeAccessGrantRequest
+ metadata runtime.ServerMetadata
+ err error
+ )
+ if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ val, ok := pathParams["name"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
+ }
+ protoReq.Name, err = runtime.String(val)
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
+ }
+ msg, err := server.RevokeAccessGrant(ctx, &protoReq)
+ return msg, metadata, err
+}
+
+// RegisterAccessGrantServiceHandlerServer registers the http handlers for service AccessGrantService to "mux".
+// UnaryRPC :call AccessGrantServiceServer directly.
+// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
+// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterAccessGrantServiceHandlerFromEndpoint instead.
+// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.
+func RegisterAccessGrantServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AccessGrantServiceServer) error {
+ mux.Handle(http.MethodGet, pattern_AccessGrantService_GetAccessGrant_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ var stream runtime.ServerTransportStream
+ ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.AccessGrantService/GetAccessGrant", runtime.WithHTTPPathPattern("/v1/{name=projects/*/accessGrants/*}"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := local_request_AccessGrantService_GetAccessGrant_0(annotatedContext, inboundMarshaler, server, req, pathParams)
+ md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ forward_AccessGrantService_GetAccessGrant_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+ })
+ mux.Handle(http.MethodGet, pattern_AccessGrantService_ListAccessGrants_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ var stream runtime.ServerTransportStream
+ ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.AccessGrantService/ListAccessGrants", runtime.WithHTTPPathPattern("/v1/{parent=projects/*}/accessGrants"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := local_request_AccessGrantService_ListAccessGrants_0(annotatedContext, inboundMarshaler, server, req, pathParams)
+ md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ forward_AccessGrantService_ListAccessGrants_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+ })
+ mux.Handle(http.MethodPost, pattern_AccessGrantService_CreateAccessGrant_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ var stream runtime.ServerTransportStream
+ ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.AccessGrantService/CreateAccessGrant", runtime.WithHTTPPathPattern("/v1/{parent=projects/*}/accessGrants"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := local_request_AccessGrantService_CreateAccessGrant_0(annotatedContext, inboundMarshaler, server, req, pathParams)
+ md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ forward_AccessGrantService_CreateAccessGrant_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+ })
+ mux.Handle(http.MethodPost, pattern_AccessGrantService_ActivateAccessGrant_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ var stream runtime.ServerTransportStream
+ ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.AccessGrantService/ActivateAccessGrant", runtime.WithHTTPPathPattern("/v1/{name=projects/*/accessGrants/*}:activate"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := local_request_AccessGrantService_ActivateAccessGrant_0(annotatedContext, inboundMarshaler, server, req, pathParams)
+ md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ forward_AccessGrantService_ActivateAccessGrant_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+ })
+ mux.Handle(http.MethodPost, pattern_AccessGrantService_RevokeAccessGrant_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ var stream runtime.ServerTransportStream
+ ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.AccessGrantService/RevokeAccessGrant", runtime.WithHTTPPathPattern("/v1/{name=projects/*/accessGrants/*}:revoke"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := local_request_AccessGrantService_RevokeAccessGrant_0(annotatedContext, inboundMarshaler, server, req, pathParams)
+ md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ forward_AccessGrantService_RevokeAccessGrant_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+ })
+
+ return nil
+}
+
+// RegisterAccessGrantServiceHandlerFromEndpoint is same as RegisterAccessGrantServiceHandler but
+// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
+func RegisterAccessGrantServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
+ conn, err := grpc.NewClient(endpoint, opts...)
+ if err != nil {
+ return err
+ }
+ defer func() {
+ if err != nil {
+ if cerr := conn.Close(); cerr != nil {
+ grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr)
+ }
+ return
+ }
+ go func() {
+ <-ctx.Done()
+ if cerr := conn.Close(); cerr != nil {
+ grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr)
+ }
+ }()
+ }()
+ return RegisterAccessGrantServiceHandler(ctx, mux, conn)
+}
+
+// RegisterAccessGrantServiceHandler registers the http handlers for service AccessGrantService to "mux".
+// The handlers forward requests to the grpc endpoint over "conn".
+func RegisterAccessGrantServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
+ return RegisterAccessGrantServiceHandlerClient(ctx, mux, NewAccessGrantServiceClient(conn))
+}
+
+// RegisterAccessGrantServiceHandlerClient registers the http handlers for service AccessGrantService
+// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AccessGrantServiceClient".
+// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AccessGrantServiceClient"
+// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
+// "AccessGrantServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares.
+func RegisterAccessGrantServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AccessGrantServiceClient) error {
+ mux.Handle(http.MethodGet, pattern_AccessGrantService_GetAccessGrant_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.AccessGrantService/GetAccessGrant", runtime.WithHTTPPathPattern("/v1/{name=projects/*/accessGrants/*}"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := request_AccessGrantService_GetAccessGrant_0(annotatedContext, inboundMarshaler, client, req, pathParams)
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ forward_AccessGrantService_GetAccessGrant_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+ })
+ mux.Handle(http.MethodGet, pattern_AccessGrantService_ListAccessGrants_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.AccessGrantService/ListAccessGrants", runtime.WithHTTPPathPattern("/v1/{parent=projects/*}/accessGrants"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := request_AccessGrantService_ListAccessGrants_0(annotatedContext, inboundMarshaler, client, req, pathParams)
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ forward_AccessGrantService_ListAccessGrants_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+ })
+ mux.Handle(http.MethodPost, pattern_AccessGrantService_CreateAccessGrant_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.AccessGrantService/CreateAccessGrant", runtime.WithHTTPPathPattern("/v1/{parent=projects/*}/accessGrants"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := request_AccessGrantService_CreateAccessGrant_0(annotatedContext, inboundMarshaler, client, req, pathParams)
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ forward_AccessGrantService_CreateAccessGrant_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+ })
+ mux.Handle(http.MethodPost, pattern_AccessGrantService_ActivateAccessGrant_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.AccessGrantService/ActivateAccessGrant", runtime.WithHTTPPathPattern("/v1/{name=projects/*/accessGrants/*}:activate"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := request_AccessGrantService_ActivateAccessGrant_0(annotatedContext, inboundMarshaler, client, req, pathParams)
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ forward_AccessGrantService_ActivateAccessGrant_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+ })
+ mux.Handle(http.MethodPost, pattern_AccessGrantService_RevokeAccessGrant_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.AccessGrantService/RevokeAccessGrant", runtime.WithHTTPPathPattern("/v1/{name=projects/*/accessGrants/*}:revoke"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := request_AccessGrantService_RevokeAccessGrant_0(annotatedContext, inboundMarshaler, client, req, pathParams)
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ forward_AccessGrantService_RevokeAccessGrant_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+ })
+ return nil
+}
+
+var (
+ pattern_AccessGrantService_GetAccessGrant_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3}, []string{"v1", "projects", "accessGrants", "name"}, ""))
+ pattern_AccessGrantService_ListAccessGrants_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2, 2, 3}, []string{"v1", "projects", "parent", "accessGrants"}, ""))
+ pattern_AccessGrantService_CreateAccessGrant_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2, 2, 3}, []string{"v1", "projects", "parent", "accessGrants"}, ""))
+ pattern_AccessGrantService_ActivateAccessGrant_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3}, []string{"v1", "projects", "accessGrants", "name"}, "activate"))
+ pattern_AccessGrantService_RevokeAccessGrant_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3}, []string{"v1", "projects", "accessGrants", "name"}, "revoke"))
+)
+
+var (
+ forward_AccessGrantService_GetAccessGrant_0 = runtime.ForwardResponseMessage
+ forward_AccessGrantService_ListAccessGrants_0 = runtime.ForwardResponseMessage
+ forward_AccessGrantService_CreateAccessGrant_0 = runtime.ForwardResponseMessage
+ forward_AccessGrantService_ActivateAccessGrant_0 = runtime.ForwardResponseMessage
+ forward_AccessGrantService_RevokeAccessGrant_0 = runtime.ForwardResponseMessage
+)
diff --git a/backend/generated-go/v1/access_grant_service_equal.pb.go b/backend/generated-go/v1/access_grant_service_equal.pb.go
new file mode 100644
index 0000000000..adf66c52ff
--- /dev/null
+++ b/backend/generated-go/v1/access_grant_service_equal.pb.go
@@ -0,0 +1,147 @@
+// Code generated by protoc-gen-equal-go. DO NOT EDIT.
+// source: v1/access_grant_service.proto
+
+package v1
+
+func (x *AccessGrant) Equal(y *AccessGrant) bool {
+ if x == y {
+ return true
+ }
+ if x == nil || y == nil {
+ return x == nil && y == nil
+ }
+ if x.Name != y.Name {
+ return false
+ }
+ if x.Creator != y.Creator {
+ return false
+ }
+ if x.Status != y.Status {
+ return false
+ }
+ if p, q := x.ExpireTime, y.ExpireTime; (p == nil && q != nil) || (p != nil && (q == nil || p.Seconds != q.Seconds || p.Nanos != q.Nanos)) {
+ return false
+ }
+ if x.Issue != y.Issue {
+ return false
+ }
+ if len(x.Targets) != len(y.Targets) {
+ return false
+ }
+ for i := 0; i < len(x.Targets); i++ {
+ if x.Targets[i] != y.Targets[i] {
+ return false
+ }
+ }
+ if x.Query != y.Query {
+ return false
+ }
+ if x.Unmask != y.Unmask {
+ return false
+ }
+ if p, q := x.CreateTime, y.CreateTime; (p == nil && q != nil) || (p != nil && (q == nil || p.Seconds != q.Seconds || p.Nanos != q.Nanos)) {
+ return false
+ }
+ if p, q := x.UpdateTime, y.UpdateTime; (p == nil && q != nil) || (p != nil && (q == nil || p.Seconds != q.Seconds || p.Nanos != q.Nanos)) {
+ return false
+ }
+ return true
+}
+
+func (x *GetAccessGrantRequest) Equal(y *GetAccessGrantRequest) bool {
+ if x == y {
+ return true
+ }
+ if x == nil || y == nil {
+ return x == nil && y == nil
+ }
+ if x.Name != y.Name {
+ return false
+ }
+ return true
+}
+
+func (x *ListAccessGrantsRequest) Equal(y *ListAccessGrantsRequest) bool {
+ if x == y {
+ return true
+ }
+ if x == nil || y == nil {
+ return x == nil && y == nil
+ }
+ if x.Parent != y.Parent {
+ return false
+ }
+ if x.PageSize != y.PageSize {
+ return false
+ }
+ if x.PageToken != y.PageToken {
+ return false
+ }
+ if x.Filter != y.Filter {
+ return false
+ }
+ return true
+}
+
+func (x *ListAccessGrantsResponse) Equal(y *ListAccessGrantsResponse) bool {
+ if x == y {
+ return true
+ }
+ if x == nil || y == nil {
+ return x == nil && y == nil
+ }
+ if len(x.AccessGrants) != len(y.AccessGrants) {
+ return false
+ }
+ for i := 0; i < len(x.AccessGrants); i++ {
+ if !x.AccessGrants[i].Equal(y.AccessGrants[i]) {
+ return false
+ }
+ }
+ if x.NextPageToken != y.NextPageToken {
+ return false
+ }
+ return true
+}
+
+func (x *CreateAccessGrantRequest) Equal(y *CreateAccessGrantRequest) bool {
+ if x == y {
+ return true
+ }
+ if x == nil || y == nil {
+ return x == nil && y == nil
+ }
+ if x.Parent != y.Parent {
+ return false
+ }
+ if !x.AccessGrant.Equal(y.AccessGrant) {
+ return false
+ }
+ return true
+}
+
+func (x *ActivateAccessGrantRequest) Equal(y *ActivateAccessGrantRequest) bool {
+ if x == y {
+ return true
+ }
+ if x == nil || y == nil {
+ return x == nil && y == nil
+ }
+ if x.Name != y.Name {
+ return false
+ }
+ return true
+}
+
+func (x *RevokeAccessGrantRequest) Equal(y *RevokeAccessGrantRequest) bool {
+ if x == y {
+ return true
+ }
+ if x == nil || y == nil {
+ return x == nil && y == nil
+ }
+ if x.Name != y.Name {
+ return false
+ }
+ return true
+}
diff --git a/backend/generated-go/v1/access_grant_service_grpc.pb.go b/backend/generated-go/v1/access_grant_service_grpc.pb.go
new file mode 100644
index 0000000000..f3a7fccfb8
--- /dev/null
+++ b/backend/generated-go/v1/access_grant_service_grpc.pb.go
@@ -0,0 +1,287 @@
+// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
+// versions:
+// - protoc-gen-go-grpc v1.6.1
+// - protoc (unknown)
+// source: v1/access_grant_service.proto
+
+package v1
+
+import (
+ context "context"
+ grpc "google.golang.org/grpc"
+ codes "google.golang.org/grpc/codes"
+ status "google.golang.org/grpc/status"
+)
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the grpc package it is being compiled against.
+// Requires gRPC-Go v1.64.0 or later.
+const _ = grpc.SupportPackageIsVersion9
+
+const (
+ AccessGrantService_GetAccessGrant_FullMethodName = "/bytebase.v1.AccessGrantService/GetAccessGrant"
+ AccessGrantService_ListAccessGrants_FullMethodName = "/bytebase.v1.AccessGrantService/ListAccessGrants"
+ AccessGrantService_CreateAccessGrant_FullMethodName = "/bytebase.v1.AccessGrantService/CreateAccessGrant"
+ AccessGrantService_ActivateAccessGrant_FullMethodName = "/bytebase.v1.AccessGrantService/ActivateAccessGrant"
+ AccessGrantService_RevokeAccessGrant_FullMethodName = "/bytebase.v1.AccessGrantService/RevokeAccessGrant"
+)
+
+// AccessGrantServiceClient is the client API for AccessGrantService service.
+//
+// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
+//
+// AccessGrantService manages temporary access grants within projects.
+type AccessGrantServiceClient interface {
+ // Gets an access grant by name.
+ GetAccessGrant(ctx context.Context, in *GetAccessGrantRequest, opts ...grpc.CallOption) (*AccessGrant, error)
+ // Lists access grants in a project.
+ ListAccessGrants(ctx context.Context, in *ListAccessGrantsRequest, opts ...grpc.CallOption) (*ListAccessGrantsResponse, error)
+ // Creates an access grant.
+ CreateAccessGrant(ctx context.Context, in *CreateAccessGrantRequest, opts ...grpc.CallOption) (*AccessGrant, error)
+ // Activates a pending access grant.
+ ActivateAccessGrant(ctx context.Context, in *ActivateAccessGrantRequest, opts ...grpc.CallOption) (*AccessGrant, error)
+ // Revokes an active access grant.
+ RevokeAccessGrant(ctx context.Context, in *RevokeAccessGrantRequest, opts ...grpc.CallOption) (*AccessGrant, error)
+}
+
+type accessGrantServiceClient struct {
+ cc grpc.ClientConnInterface
+}
+
+func NewAccessGrantServiceClient(cc grpc.ClientConnInterface) AccessGrantServiceClient {
+ return &accessGrantServiceClient{cc}
+}
+
+func (c *accessGrantServiceClient) GetAccessGrant(ctx context.Context, in *GetAccessGrantRequest, opts ...grpc.CallOption) (*AccessGrant, error) {
+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
+ out := new(AccessGrant)
+ err := c.cc.Invoke(ctx, AccessGrantService_GetAccessGrant_FullMethodName, in, out, cOpts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *accessGrantServiceClient) ListAccessGrants(ctx context.Context, in *ListAccessGrantsRequest, opts ...grpc.CallOption) (*ListAccessGrantsResponse, error) {
+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
+ out := new(ListAccessGrantsResponse)
+ err := c.cc.Invoke(ctx, AccessGrantService_ListAccessGrants_FullMethodName, in, out, cOpts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *accessGrantServiceClient) CreateAccessGrant(ctx context.Context, in *CreateAccessGrantRequest, opts ...grpc.CallOption) (*AccessGrant, error) {
+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
+ out := new(AccessGrant)
+ err := c.cc.Invoke(ctx, AccessGrantService_CreateAccessGrant_FullMethodName, in, out, cOpts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *accessGrantServiceClient) ActivateAccessGrant(ctx context.Context, in *ActivateAccessGrantRequest, opts ...grpc.CallOption) (*AccessGrant, error) {
+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
+ out := new(AccessGrant)
+ err := c.cc.Invoke(ctx, AccessGrantService_ActivateAccessGrant_FullMethodName, in, out, cOpts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *accessGrantServiceClient) RevokeAccessGrant(ctx context.Context, in *RevokeAccessGrantRequest, opts ...grpc.CallOption) (*AccessGrant, error) {
+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
+ out := new(AccessGrant)
+ err := c.cc.Invoke(ctx, AccessGrantService_RevokeAccessGrant_FullMethodName, in, out, cOpts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+// AccessGrantServiceServer is the server API for AccessGrantService service.
+// All implementations must embed UnimplementedAccessGrantServiceServer
+// for forward compatibility.
+//
+// AccessGrantService manages temporary access grants within projects.
+type AccessGrantServiceServer interface {
+ // Gets an access grant by name.
+ GetAccessGrant(context.Context, *GetAccessGrantRequest) (*AccessGrant, error)
+ // Lists access grants in a project.
+ ListAccessGrants(context.Context, *ListAccessGrantsRequest) (*ListAccessGrantsResponse, error)
+ // Creates an access grant.
+ CreateAccessGrant(context.Context, *CreateAccessGrantRequest) (*AccessGrant, error)
+ // Activates a pending access grant.
+ ActivateAccessGrant(context.Context, *ActivateAccessGrantRequest) (*AccessGrant, error)
+ // Revokes an active access grant.
+ RevokeAccessGrant(context.Context, *RevokeAccessGrantRequest) (*AccessGrant, error)
+ mustEmbedUnimplementedAccessGrantServiceServer()
+}
+
+// UnimplementedAccessGrantServiceServer must be embedded to have
+// forward compatible implementations.
+//
+// NOTE: this should be embedded by value instead of pointer to avoid a nil
+// pointer dereference when methods are called.
+type UnimplementedAccessGrantServiceServer struct{}
+
+func (UnimplementedAccessGrantServiceServer) GetAccessGrant(context.Context, *GetAccessGrantRequest) (*AccessGrant, error) {
+ return nil, status.Error(codes.Unimplemented, "method GetAccessGrant not implemented")
+}
+func (UnimplementedAccessGrantServiceServer) ListAccessGrants(context.Context, *ListAccessGrantsRequest) (*ListAccessGrantsResponse, error) {
+ return nil, status.Error(codes.Unimplemented, "method ListAccessGrants not implemented")
+}
+func (UnimplementedAccessGrantServiceServer) CreateAccessGrant(context.Context, *CreateAccessGrantRequest) (*AccessGrant, error) {
+ return nil, status.Error(codes.Unimplemented, "method CreateAccessGrant not implemented")
+}
+func (UnimplementedAccessGrantServiceServer) ActivateAccessGrant(context.Context, *ActivateAccessGrantRequest) (*AccessGrant, error) {
+ return nil, status.Error(codes.Unimplemented, "method ActivateAccessGrant not implemented")
+}
+func (UnimplementedAccessGrantServiceServer) RevokeAccessGrant(context.Context, *RevokeAccessGrantRequest) (*AccessGrant, error) {
+ return nil, status.Error(codes.Unimplemented, "method RevokeAccessGrant not implemented")
+}
+func (UnimplementedAccessGrantServiceServer) mustEmbedUnimplementedAccessGrantServiceServer() {}
+func (UnimplementedAccessGrantServiceServer) testEmbeddedByValue() {}
+
+// UnsafeAccessGrantServiceServer may be embedded to opt out of forward compatibility for this service.
+// Use of this interface is not recommended, as added methods to AccessGrantServiceServer will
+// result in compilation errors.
+type UnsafeAccessGrantServiceServer interface {
+ mustEmbedUnimplementedAccessGrantServiceServer()
+}
+
+func RegisterAccessGrantServiceServer(s grpc.ServiceRegistrar, srv AccessGrantServiceServer) {
+ // If the following call panics, it indicates UnimplementedAccessGrantServiceServer was
+ // embedded by pointer and is nil. This will cause panics if an
+ // unimplemented method is ever invoked, so we test this at initialization
+ // time to prevent it from happening at runtime later due to I/O.
+ if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
+ t.testEmbeddedByValue()
+ }
+ s.RegisterService(&AccessGrantService_ServiceDesc, srv)
+}
+
+func _AccessGrantService_GetAccessGrant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(GetAccessGrantRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(AccessGrantServiceServer).GetAccessGrant(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: AccessGrantService_GetAccessGrant_FullMethodName,
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(AccessGrantServiceServer).GetAccessGrant(ctx, req.(*GetAccessGrantRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _AccessGrantService_ListAccessGrants_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(ListAccessGrantsRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(AccessGrantServiceServer).ListAccessGrants(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: AccessGrantService_ListAccessGrants_FullMethodName,
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(AccessGrantServiceServer).ListAccessGrants(ctx, req.(*ListAccessGrantsRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _AccessGrantService_CreateAccessGrant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(CreateAccessGrantRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(AccessGrantServiceServer).CreateAccessGrant(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: AccessGrantService_CreateAccessGrant_FullMethodName,
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(AccessGrantServiceServer).CreateAccessGrant(ctx, req.(*CreateAccessGrantRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _AccessGrantService_ActivateAccessGrant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(ActivateAccessGrantRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(AccessGrantServiceServer).ActivateAccessGrant(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: AccessGrantService_ActivateAccessGrant_FullMethodName,
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(AccessGrantServiceServer).ActivateAccessGrant(ctx, req.(*ActivateAccessGrantRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _AccessGrantService_RevokeAccessGrant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(RevokeAccessGrantRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(AccessGrantServiceServer).RevokeAccessGrant(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: AccessGrantService_RevokeAccessGrant_FullMethodName,
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(AccessGrantServiceServer).RevokeAccessGrant(ctx, req.(*RevokeAccessGrantRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+// AccessGrantService_ServiceDesc is the grpc.ServiceDesc for AccessGrantService service.
+// It's only intended for direct use with grpc.RegisterService,
+// and not to be introspected or modified (even as a copy)
+var AccessGrantService_ServiceDesc = grpc.ServiceDesc{
+ ServiceName: "bytebase.v1.AccessGrantService",
+ HandlerType: (*AccessGrantServiceServer)(nil),
+ Methods: []grpc.MethodDesc{
+ {
+ MethodName: "GetAccessGrant",
+ Handler: _AccessGrantService_GetAccessGrant_Handler,
+ },
+ {
+ MethodName: "ListAccessGrants",
+ Handler: _AccessGrantService_ListAccessGrants_Handler,
+ },
+ {
+ MethodName: "CreateAccessGrant",
+ Handler: _AccessGrantService_CreateAccessGrant_Handler,
+ },
+ {
+ MethodName: "ActivateAccessGrant",
+ Handler: _AccessGrantService_ActivateAccessGrant_Handler,
+ },
+ {
+ MethodName: "RevokeAccessGrant",
+ Handler: _AccessGrantService_RevokeAccessGrant_Handler,
+ },
+ },
+ Streams: []grpc.StreamDesc{},
+ Metadata: "v1/access_grant_service.proto",
+}
diff --git a/backend/generated-go/v1/issue_service.pb.go b/backend/generated-go/v1/issue_service.pb.go
index 5607f53e93..a03247762f 100644
--- a/backend/generated-go/v1/issue_service.pb.go
+++ b/backend/generated-go/v1/issue_service.pb.go
@@ -96,6 +96,8 @@ const (
Issue_GRANT_REQUEST Issue_Type = 2
// Database data export request.
Issue_DATABASE_EXPORT Issue_Type = 3
+ // Temporary access grant request.
+ Issue_ACCESS_GRANT Issue_Type = 4
)
// Enum value maps for Issue_Type.
@@ -105,12 +107,14 @@ var (
1: "DATABASE_CHANGE",
2: "GRANT_REQUEST",
3: "DATABASE_EXPORT",
+ 4: "ACCESS_GRANT",
}
Issue_Type_value = map[string]int32{
"TYPE_UNSPECIFIED": 0,
"DATABASE_CHANGE": 1,
"GRANT_REQUEST": 2,
"DATABASE_EXPORT": 3,
+ "ACCESS_GRANT": 4,
}
)
@@ -1110,8 +1114,11 @@ type Issue struct {
// Labels attached to the issue for categorization and filtering.
Labels []string `protobuf:"bytes,17,rep,name=labels,proto3" json:"labels,omitempty"`
ApprovalStatus Issue_ApprovalStatus `protobuf:"varint,18,opt,name=approval_status,json=approvalStatus,proto3,enum=bytebase.v1.Issue_ApprovalStatus" json:"approval_status,omitempty"`
- unknownFields protoimpl.UnknownFields
- sizeCache protoimpl.SizeCache
+ // The access grant associated with this issue.
+ // Format: projects/{project}/accessGrants/{access_grant}
+ AccessGrant string `protobuf:"bytes,19,opt,name=access_grant,json=accessGrant,proto3" json:"access_grant,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *Issue) Reset() {
@@ -1249,6 +1256,13 @@ func (x *Issue) GetApprovalStatus() Issue_ApprovalStatus {
return Issue_APPROVAL_STATUS_UNSPECIFIED
}
+func (x *Issue) GetAccessGrant() string {
+ if x != nil {
+ return x.AccessGrant
+ }
+ return ""
+}
+
type GrantRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
// The requested role.
@@ -2168,7 +2182,7 @@ const file_v1_issue_service_proto_rawDesc = "" +
"\x13RequestIssueRequest\x12.\n" +
"\x04name\x18\x01 \x01(\tB\x1a\xe0A\x02\xfaA\x14\n" +
"\x12bytebase.com/IssueR\x04name\x12\x18\n" +
- "\acomment\x18\x02 \x01(\tR\acomment\"\xa4\t\n" +
+ "\acomment\x18\x02 \x01(\tR\acomment\"\xfb\t\n" +
"\x05Issue\x12\x12\n" +
"\x04name\x18\x01 \x01(\tR\x04name\x12\x1e\n" +
"\x05title\x18\x02 \x01(\tB\b\xbaH\x05r\x03\x18\xc8\x01R\x05title\x12*\n" +
@@ -2188,7 +2202,9 @@ const file_v1_issue_service_proto_rawDesc = "" +
"\n" +
"risk_level\x18\x0f \x01(\x0e2\x16.bytebase.v1.RiskLevelR\triskLevel\x12\x16\n" +
"\x06labels\x18\x11 \x03(\tR\x06labels\x12O\n" +
- "\x0fapproval_status\x18\x12 \x01(\x0e2!.bytebase.v1.Issue.ApprovalStatusB\x03\xe0A\x03R\x0eapprovalStatus\x1a\xaf\x01\n" +
+ "\x0fapproval_status\x18\x12 \x01(\x0e2!.bytebase.v1.Issue.ApprovalStatusB\x03\xe0A\x03R\x0eapprovalStatus\x12C\n" +
+ "\faccess_grant\x18\x13 \x01(\tB \xe0A\x03\xfaA\x1a\n" +
+ "\x18bytebase.com/AccessGrantR\vaccessGrant\x1a\xaf\x01\n" +
"\bApprover\x12:\n" +
"\x06status\x18\x01 \x01(\x0e2\".bytebase.v1.Issue.Approver.StatusR\x06status\x12\x1c\n" +
"\tprincipal\x18\x02 \x01(\tR\tprincipal\"I\n" +
@@ -2196,12 +2212,13 @@ const file_v1_issue_service_proto_rawDesc = "" +
"\x12STATUS_UNSPECIFIED\x10\x00\x12\v\n" +
"\aPENDING\x10\x01\x12\f\n" +
"\bAPPROVED\x10\x02\x12\f\n" +
- "\bREJECTED\x10\x03\"Y\n" +
+ "\bREJECTED\x10\x03\"k\n" +
"\x04Type\x12\x14\n" +
"\x10TYPE_UNSPECIFIED\x10\x00\x12\x13\n" +
"\x0fDATABASE_CHANGE\x10\x01\x12\x11\n" +
"\rGRANT_REQUEST\x10\x02\x12\x13\n" +
- "\x0fDATABASE_EXPORT\x10\x03\"u\n" +
+ "\x0fDATABASE_EXPORT\x10\x03\x12\x10\n" +
+ "\fACCESS_GRANT\x10\x04\"u\n" +
"\x0eApprovalStatus\x12\x1f\n" +
"\x1bAPPROVAL_STATUS_UNSPECIFIED\x10\x00\x12\f\n" +
"\bCHECKING\x10\x01\x12\v\n" +
diff --git a/backend/generated-go/v1/issue_service_equal.pb.go b/backend/generated-go/v1/issue_service_equal.pb.go
index 6ba0689056..d623a327eb 100644
--- a/backend/generated-go/v1/issue_service_equal.pb.go
+++ b/backend/generated-go/v1/issue_service_equal.pb.go
@@ -319,6 +319,9 @@ func (x *Issue) Equal(y *Issue) bool {
if x.ApprovalStatus != y.ApprovalStatus {
return false
}
+ if x.AccessGrant != y.AccessGrant {
+ return false
+ }
return true
}
diff --git a/backend/generated-go/v1/v1connect/access_grant_service.connect.go b/backend/generated-go/v1/v1connect/access_grant_service.connect.go
new file mode 100644
index 0000000000..ede3ebfb3e
--- /dev/null
+++ b/backend/generated-go/v1/v1connect/access_grant_service.connect.go
@@ -0,0 +1,235 @@
+// Code generated by protoc-gen-connect-go. DO NOT EDIT.
+//
+// Source: v1/access_grant_service.proto
+
+package v1connect
+
+import (
+ connect "connectrpc.com/connect"
+ context "context"
+ errors "errors"
+ v1 "github.com/bytebase/bytebase/backend/generated-go/v1"
+ http "net/http"
+ strings "strings"
+)
+
+// This is a compile-time assertion to ensure that this generated file and the connect package are
+// compatible. If you get a compiler error that this constant is not defined, this code was
+// generated with a version of connect newer than the one compiled into your binary. You can fix the
+// problem by either regenerating this code with an older version of connect or updating the connect
+// version compiled into your binary.
+const _ = connect.IsAtLeastVersion1_13_0
+
+const (
+ // AccessGrantServiceName is the fully-qualified name of the AccessGrantService service.
+ AccessGrantServiceName = "bytebase.v1.AccessGrantService"
+)
+
+// These constants are the fully-qualified names of the RPCs defined in this package. They're
+// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.
+//
+// Note that these are different from the fully-qualified method names used by
+// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to
+// reflection-formatted method names, remove the leading slash and convert the remaining slash to a
+// period.
+const (
+ // AccessGrantServiceGetAccessGrantProcedure is the fully-qualified name of the AccessGrantService's
+ // GetAccessGrant RPC.
+ AccessGrantServiceGetAccessGrantProcedure = "/bytebase.v1.AccessGrantService/GetAccessGrant"
+ // AccessGrantServiceListAccessGrantsProcedure is the fully-qualified name of the
+ // AccessGrantService's ListAccessGrants RPC.
+ AccessGrantServiceListAccessGrantsProcedure = "/bytebase.v1.AccessGrantService/ListAccessGrants"
+ // AccessGrantServiceCreateAccessGrantProcedure is the fully-qualified name of the
+ // AccessGrantService's CreateAccessGrant RPC.
+ AccessGrantServiceCreateAccessGrantProcedure = "/bytebase.v1.AccessGrantService/CreateAccessGrant"
+ // AccessGrantServiceActivateAccessGrantProcedure is the fully-qualified name of the
+ // AccessGrantService's ActivateAccessGrant RPC.
+ AccessGrantServiceActivateAccessGrantProcedure = "/bytebase.v1.AccessGrantService/ActivateAccessGrant"
+ // AccessGrantServiceRevokeAccessGrantProcedure is the fully-qualified name of the
+ // AccessGrantService's RevokeAccessGrant RPC.
+ AccessGrantServiceRevokeAccessGrantProcedure = "/bytebase.v1.AccessGrantService/RevokeAccessGrant"
+)
+
+// AccessGrantServiceClient is a client for the bytebase.v1.AccessGrantService service.
+type AccessGrantServiceClient interface {
+ // Gets an access grant by name.
+ GetAccessGrant(context.Context, *connect.Request[v1.GetAccessGrantRequest]) (*connect.Response[v1.AccessGrant], error)
+ // Lists access grants in a project.
+ ListAccessGrants(context.Context, *connect.Request[v1.ListAccessGrantsRequest]) (*connect.Response[v1.ListAccessGrantsResponse], error)
+ // Creates an access grant.
+ CreateAccessGrant(context.Context, *connect.Request[v1.CreateAccessGrantRequest]) (*connect.Response[v1.AccessGrant], error)
+ // Activates a pending access grant.
+ ActivateAccessGrant(context.Context, *connect.Request[v1.ActivateAccessGrantRequest]) (*connect.Response[v1.AccessGrant], error)
+ // Revokes an active access grant.
+ RevokeAccessGrant(context.Context, *connect.Request[v1.RevokeAccessGrantRequest]) (*connect.Response[v1.AccessGrant], error)
+}
+
+// NewAccessGrantServiceClient constructs a client for the bytebase.v1.AccessGrantService service.
+// By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped
+// responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the
+// connect.WithGRPC() or connect.WithGRPCWeb() options.
+//
+// The URL supplied here should be the base URL for the Connect or gRPC server (for example,
+// http://api.acme.com or https://acme.com/grpc).
+func NewAccessGrantServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) AccessGrantServiceClient {
+ baseURL = strings.TrimRight(baseURL, "/")
+ accessGrantServiceMethods := v1.File_v1_access_grant_service_proto.Services().ByName("AccessGrantService").Methods()
+ return &accessGrantServiceClient{
+ getAccessGrant: connect.NewClient[v1.GetAccessGrantRequest, v1.AccessGrant](
+ httpClient,
+ baseURL+AccessGrantServiceGetAccessGrantProcedure,
+ connect.WithSchema(accessGrantServiceMethods.ByName("GetAccessGrant")),
+ connect.WithClientOptions(opts...),
+ ),
+ listAccessGrants: connect.NewClient[v1.ListAccessGrantsRequest, v1.ListAccessGrantsResponse](
+ httpClient,
+ baseURL+AccessGrantServiceListAccessGrantsProcedure,
+ connect.WithSchema(accessGrantServiceMethods.ByName("ListAccessGrants")),
+ connect.WithClientOptions(opts...),
+ ),
+ createAccessGrant: connect.NewClient[v1.CreateAccessGrantRequest, v1.AccessGrant](
+ httpClient,
+ baseURL+AccessGrantServiceCreateAccessGrantProcedure,
+ connect.WithSchema(accessGrantServiceMethods.ByName("CreateAccessGrant")),
+ connect.WithClientOptions(opts...),
+ ),
+ activateAccessGrant: connect.NewClient[v1.ActivateAccessGrantRequest, v1.AccessGrant](
+ httpClient,
+ baseURL+AccessGrantServiceActivateAccessGrantProcedure,
+ connect.WithSchema(accessGrantServiceMethods.ByName("ActivateAccessGrant")),
+ connect.WithClientOptions(opts...),
+ ),
+ revokeAccessGrant: connect.NewClient[v1.RevokeAccessGrantRequest, v1.AccessGrant](
+ httpClient,
+ baseURL+AccessGrantServiceRevokeAccessGrantProcedure,
+ connect.WithSchema(accessGrantServiceMethods.ByName("RevokeAccessGrant")),
+ connect.WithClientOptions(opts...),
+ ),
+ }
+}
+
+// accessGrantServiceClient implements AccessGrantServiceClient.
+type accessGrantServiceClient struct {
+ getAccessGrant *connect.Client[v1.GetAccessGrantRequest, v1.AccessGrant]
+ listAccessGrants *connect.Client[v1.ListAccessGrantsRequest, v1.ListAccessGrantsResponse]
+ createAccessGrant *connect.Client[v1.CreateAccessGrantRequest, v1.AccessGrant]
+ activateAccessGrant *connect.Client[v1.ActivateAccessGrantRequest, v1.AccessGrant]
+ revokeAccessGrant *connect.Client[v1.RevokeAccessGrantRequest, v1.AccessGrant]
+}
+
+// GetAccessGrant calls bytebase.v1.AccessGrantService.GetAccessGrant.
+func (c *accessGrantServiceClient) GetAccessGrant(ctx context.Context, req *connect.Request[v1.GetAccessGrantRequest]) (*connect.Response[v1.AccessGrant], error) {
+ return c.getAccessGrant.CallUnary(ctx, req)
+}
+
+// ListAccessGrants calls bytebase.v1.AccessGrantService.ListAccessGrants.
+func (c *accessGrantServiceClient) ListAccessGrants(ctx context.Context, req *connect.Request[v1.ListAccessGrantsRequest]) (*connect.Response[v1.ListAccessGrantsResponse], error) {
+ return c.listAccessGrants.CallUnary(ctx, req)
+}
+
+// CreateAccessGrant calls bytebase.v1.AccessGrantService.CreateAccessGrant.
+func (c *accessGrantServiceClient) CreateAccessGrant(ctx context.Context, req *connect.Request[v1.CreateAccessGrantRequest]) (*connect.Response[v1.AccessGrant], error) {
+ return c.createAccessGrant.CallUnary(ctx, req)
+}
+
+// ActivateAccessGrant calls bytebase.v1.AccessGrantService.ActivateAccessGrant.
+func (c *accessGrantServiceClient) ActivateAccessGrant(ctx context.Context, req *connect.Request[v1.ActivateAccessGrantRequest]) (*connect.Response[v1.AccessGrant], error) {
+ return c.activateAccessGrant.CallUnary(ctx, req)
+}
+
+// RevokeAccessGrant calls bytebase.v1.AccessGrantService.RevokeAccessGrant.
+func (c *accessGrantServiceClient) RevokeAccessGrant(ctx context.Context, req *connect.Request[v1.RevokeAccessGrantRequest]) (*connect.Response[v1.AccessGrant], error) {
+ return c.revokeAccessGrant.CallUnary(ctx, req)
+}
+
+// AccessGrantServiceHandler is an implementation of the bytebase.v1.AccessGrantService service.
+type AccessGrantServiceHandler interface {
+ // Gets an access grant by name.
+ GetAccessGrant(context.Context, *connect.Request[v1.GetAccessGrantRequest]) (*connect.Response[v1.AccessGrant], error)
+ // Lists access grants in a project.
+ ListAccessGrants(context.Context, *connect.Request[v1.ListAccessGrantsRequest]) (*connect.Response[v1.ListAccessGrantsResponse], error)
+ // Creates an access grant.
+ CreateAccessGrant(context.Context, *connect.Request[v1.CreateAccessGrantRequest]) (*connect.Response[v1.AccessGrant], error)
+ // Activates a pending access grant.
+ ActivateAccessGrant(context.Context, *connect.Request[v1.ActivateAccessGrantRequest]) (*connect.Response[v1.AccessGrant], error)
+ // Revokes an active access grant.
+ RevokeAccessGrant(context.Context, *connect.Request[v1.RevokeAccessGrantRequest]) (*connect.Response[v1.AccessGrant], error)
+}
+
+// NewAccessGrantServiceHandler builds an HTTP handler from the service implementation. It returns
+// the path on which to mount the handler and the handler itself.
+//
+// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf
+// and JSON codecs. They also support gzip compression.
+func NewAccessGrantServiceHandler(svc AccessGrantServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {
+ accessGrantServiceMethods := v1.File_v1_access_grant_service_proto.Services().ByName("AccessGrantService").Methods()
+ accessGrantServiceGetAccessGrantHandler := connect.NewUnaryHandler(
+ AccessGrantServiceGetAccessGrantProcedure,
+ svc.GetAccessGrant,
+ connect.WithSchema(accessGrantServiceMethods.ByName("GetAccessGrant")),
+ connect.WithHandlerOptions(opts...),
+ )
+ accessGrantServiceListAccessGrantsHandler := connect.NewUnaryHandler(
+ AccessGrantServiceListAccessGrantsProcedure,
+ svc.ListAccessGrants,
+ connect.WithSchema(accessGrantServiceMethods.ByName("ListAccessGrants")),
+ connect.WithHandlerOptions(opts...),
+ )
+ accessGrantServiceCreateAccessGrantHandler := connect.NewUnaryHandler(
+ AccessGrantServiceCreateAccessGrantProcedure,
+ svc.CreateAccessGrant,
+ connect.WithSchema(accessGrantServiceMethods.ByName("CreateAccessGrant")),
+ connect.WithHandlerOptions(opts...),
+ )
+ accessGrantServiceActivateAccessGrantHandler := connect.NewUnaryHandler(
+ AccessGrantServiceActivateAccessGrantProcedure,
+ svc.ActivateAccessGrant,
+ connect.WithSchema(accessGrantServiceMethods.ByName("ActivateAccessGrant")),
+ connect.WithHandlerOptions(opts...),
+ )
+ accessGrantServiceRevokeAccessGrantHandler := connect.NewUnaryHandler(
+ AccessGrantServiceRevokeAccessGrantProcedure,
+ svc.RevokeAccessGrant,
+ connect.WithSchema(accessGrantServiceMethods.ByName("RevokeAccessGrant")),
+ connect.WithHandlerOptions(opts...),
+ )
+ return "/bytebase.v1.AccessGrantService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ switch r.URL.Path {
+ case AccessGrantServiceGetAccessGrantProcedure:
+ accessGrantServiceGetAccessGrantHandler.ServeHTTP(w, r)
+ case AccessGrantServiceListAccessGrantsProcedure:
+ accessGrantServiceListAccessGrantsHandler.ServeHTTP(w, r)
+ case AccessGrantServiceCreateAccessGrantProcedure:
+ accessGrantServiceCreateAccessGrantHandler.ServeHTTP(w, r)
+ case AccessGrantServiceActivateAccessGrantProcedure:
+ accessGrantServiceActivateAccessGrantHandler.ServeHTTP(w, r)
+ case AccessGrantServiceRevokeAccessGrantProcedure:
+ accessGrantServiceRevokeAccessGrantHandler.ServeHTTP(w, r)
+ default:
+ http.NotFound(w, r)
+ }
+ })
+}
+
+// UnimplementedAccessGrantServiceHandler returns CodeUnimplemented from all methods.
+type UnimplementedAccessGrantServiceHandler struct{}
+
+func (UnimplementedAccessGrantServiceHandler) GetAccessGrant(context.Context, *connect.Request[v1.GetAccessGrantRequest]) (*connect.Response[v1.AccessGrant], error) {
+ return nil, connect.NewError(connect.CodeUnimplemented, errors.New("bytebase.v1.AccessGrantService.GetAccessGrant is not implemented"))
+}
+
+func (UnimplementedAccessGrantServiceHandler) ListAccessGrants(context.Context, *connect.Request[v1.ListAccessGrantsRequest]) (*connect.Response[v1.ListAccessGrantsResponse], error) {
+ return nil, connect.NewError(connect.CodeUnimplemented, errors.New("bytebase.v1.AccessGrantService.ListAccessGrants is not implemented"))
+}
+
+func (UnimplementedAccessGrantServiceHandler) CreateAccessGrant(context.Context, *connect.Request[v1.CreateAccessGrantRequest]) (*connect.Response[v1.AccessGrant], error) {
+ return nil, connect.NewError(connect.CodeUnimplemented, errors.New("bytebase.v1.AccessGrantService.CreateAccessGrant is not implemented"))
+}
+
+func (UnimplementedAccessGrantServiceHandler) ActivateAccessGrant(context.Context, *connect.Request[v1.ActivateAccessGrantRequest]) (*connect.Response[v1.AccessGrant], error) {
+ return nil, connect.NewError(connect.CodeUnimplemented, errors.New("bytebase.v1.AccessGrantService.ActivateAccessGrant is not implemented"))
+}
+
+func (UnimplementedAccessGrantServiceHandler) RevokeAccessGrant(context.Context, *connect.Request[v1.RevokeAccessGrantRequest]) (*connect.Response[v1.AccessGrant], error) {
+ return nil, connect.NewError(connect.CodeUnimplemented, errors.New("bytebase.v1.AccessGrantService.RevokeAccessGrant is not implemented"))
+}
diff --git a/frontend/src/types/proto-es/v1/access_grant_service_pb.d.ts b/frontend/src/types/proto-es/v1/access_grant_service_pb.d.ts
new file mode 100644
index 0000000000..9c225c752f
--- /dev/null
+++ b/frontend/src/types/proto-es/v1/access_grant_service_pb.d.ts
@@ -0,0 +1,354 @@
+// @generated by protoc-gen-es v2.5.2
+// @generated from file v1/access_grant_service.proto (package bytebase.v1, syntax proto3)
+/* eslint-disable */
+
+import type { GenEnum, GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2";
+import type { Message } from "@bufbuild/protobuf";
+import type { Timestamp } from "@bufbuild/protobuf/wkt";
+
+/**
+ * Describes the file v1/access_grant_service.proto.
+ */
+export declare const file_v1_access_grant_service: GenFile;
+
+/**
+ * @generated from message bytebase.v1.AccessGrant
+ */
+export declare type AccessGrant = Message<"bytebase.v1.AccessGrant"> & {
+ /**
+ * The name of the access grant, generated by the server.
+ * Format: projects/{project}/accessGrants/{access_grant}
+ * The {access_grant} segment is a server-generated unique ID.
+ *
+ * @generated from field: string name = 1;
+ */
+ name: string;
+
+ /**
+ * The creator of the access grant.
+ * Format: users/{email}
+ *
+ * @generated from field: string creator = 2;
+ */
+ creator: string;
+
+ /**
+ * The status of the access grant.
+ * An ACTIVE grant with `expire_time` in the past is effectively expired
+ * and no longer authorizes access. Use `expire_time` to determine
+ * whether an ACTIVE grant has expired.
+ *
+ * @generated from field: bytebase.v1.AccessGrant.Status status = 3;
+ */
+ status: AccessGrant_Status;
+
+ /**
+ * The expiration time of the access grant.
+ * When the current time exceeds this value, an ACTIVE grant is
+ * considered expired and no longer authorizes access.
+ *
+ * @generated from field: google.protobuf.Timestamp expire_time = 4;
+ */
+ expireTime?: Timestamp;
+
+ /**
+ * The issue associated with the access grant.
+ * Can be empty.
+ * Format: projects/{project}/issues/{issue}
+ *
+ * @generated from field: string issue = 5;
+ */
+ issue: string;
+
+ /**
+ * The target databases for this access grant.
+ * Format: instances/{instance}/databases/{database}
+ *
+ * @generated from field: repeated string targets = 6;
+ */
+ targets: string[];
+
+ /**
+ * The query permission granted.
+ *
+ * @generated from field: string query = 7;
+ */
+ query: string;
+
+ /**
+ * Whether the grant allows unmasking sensitive data.
+ *
+ * @generated from field: bool unmask = 8;
+ */
+ unmask: boolean;
+
+ /**
+ * @generated from field: google.protobuf.Timestamp create_time = 9;
+ */
+ createTime?: Timestamp;
+
+ /**
+ * @generated from field: google.protobuf.Timestamp update_time = 10;
+ */
+ updateTime?: Timestamp;
+};
+
+/**
+ * Describes the message bytebase.v1.AccessGrant.
+ * Use `create(AccessGrantSchema)` to create a new message.
+ */
+export declare const AccessGrantSchema: GenMessage<AccessGrant>;
+
+/**
+ * The status of the access grant.
+ *
+ * @generated from enum bytebase.v1.AccessGrant.Status
+ */
+export enum AccessGrant_Status {
+ /**
+ * @generated from enum value: STATUS_UNSPECIFIED = 0;
+ */
+ STATUS_UNSPECIFIED = 0,
+
+ /**
+ * The access grant is pending approval.
+ *
+ * @generated from enum value: PENDING = 1;
+ */
+ PENDING = 1,
+
+ /**
+ * The access grant is active. Check `expire_time` to determine
+ * whether the grant is still valid or has expired.
+ *
+ * @generated from enum value: ACTIVE = 2;
+ */
+ ACTIVE = 2,
+
+ /**
+ * The access grant has been revoked.
+ *
+ * @generated from enum value: REVOKED = 3;
+ */
+ REVOKED = 3,
+}
+
+/**
+ * Describes the enum bytebase.v1.AccessGrant.Status.
+ */
+export declare const AccessGrant_StatusSchema: GenEnum<AccessGrant_Status>;
+
+/**
+ * @generated from message bytebase.v1.GetAccessGrantRequest
+ */
+export declare type GetAccessGrantRequest = Message<"bytebase.v1.GetAccessGrantRequest"> & {
+ /**
+ * The name of the access grant to retrieve.
+ * Format: projects/{project}/accessGrants/{access_grant}
+ *
+ * @generated from field: string name = 1;
+ */
+ name: string;
+};
+
+/**
+ * Describes the message bytebase.v1.GetAccessGrantRequest.
+ * Use `create(GetAccessGrantRequestSchema)` to create a new message.
+ */
+export declare const GetAccessGrantRequestSchema: GenMessage<GetAccessGrantRequest>;
+
+/**
+ * @generated from message bytebase.v1.ListAccessGrantsRequest
+ */
+export declare type ListAccessGrantsRequest = Message<"bytebase.v1.ListAccessGrantsRequest"> & {
+ /**
+ * The parent project of the access grants.
+ * Format: projects/{project}
+ *
+ * @generated from field: string parent = 1;
+ */
+ parent: string;
+
+ /**
+ * The maximum number of access grants to return.
+ *
+ * @generated from field: int32 page_size = 2;
+ */
+ pageSize: number;
+
+ /**
+ * A page token from a previous ListAccessGrants call.
+ *
+ * @generated from field: string page_token = 3;
+ */
+ pageToken: string;
+
+ /**
+ * Filter expression using AIP-160 syntax.
+ * Supported fields: creator, status, issue, expire_time, create_time
+ * Examples:
+ * - 'creator = "users/[email protected]"'
+ * - 'status = "ACTIVE"'
+ * - 'creator = "users/[email protected]" AND status = "ACTIVE"'
+ * - 'issue = "projects/x/issues/123"'
+ * - 'status = "ACTIVE" AND expire_time > "2024-02-01T00:00:00Z"'
+ *
+ * @generated from field: string filter = 4;
+ */
+ filter: string;
+};
+
+/**
+ * Describes the message bytebase.v1.ListAccessGrantsRequest.
+ * Use `create(ListAccessGrantsRequestSchema)` to create a new message.
+ */
+export declare const ListAccessGrantsRequestSchema: GenMessage<ListAccessGrantsRequest>;
+
+/**
+ * @generated from message bytebase.v1.ListAccessGrantsResponse
+ */
+export declare type ListAccessGrantsResponse = Message<"bytebase.v1.ListAccessGrantsResponse"> & {
+ /**
+ * The access grants from the specified request.
+ *
+ * @generated from field: repeated bytebase.v1.AccessGrant access_grants = 1;
+ */
+ accessGrants: AccessGrant[];
+
+ /**
+ * A token, which can be sent as `page_token` to retrieve the next page.
+ * If this field is omitted, there are no subsequent pages.
+ *
+ * @generated from field: string next_page_token = 2;
+ */
+ nextPageToken: string;
+};
+
+/**
+ * Describes the message bytebase.v1.ListAccessGrantsResponse.
+ * Use `create(ListAccessGrantsResponseSchema)` to create a new message.
+ */
+export declare const ListAccessGrantsResponseSchema: GenMessage<ListAccessGrantsResponse>;
+
+/**
+ * @generated from message bytebase.v1.CreateAccessGrantRequest
+ */
+export declare type CreateAccessGrantRequest = Message<"bytebase.v1.CreateAccessGrantRequest"> & {
+ /**
+ * The parent project for the access grant.
+ * Format: projects/{project}
+ *
+ * @generated from field: string parent = 1;
+ */
+ parent: string;
+
+ /**
+ * The access grant to create.
+ *
+ * @generated from field: bytebase.v1.AccessGrant access_grant = 2;
+ */
+ accessGrant?: AccessGrant;
+};
+
+/**
+ * Describes the message bytebase.v1.CreateAccessGrantRequest.
+ * Use `create(CreateAccessGrantRequestSchema)` to create a new message.
+ */
+export declare const CreateAccessGrantRequestSchema: GenMessage<CreateAccessGrantRequest>;
+
+/**
+ * @generated from message bytebase.v1.ActivateAccessGrantRequest
+ */
+export declare type ActivateAccessGrantRequest = Message<"bytebase.v1.ActivateAccessGrantRequest"> & {
+ /**
+ * The name of the access grant to activate.
+ * Format: projects/{project}/accessGrants/{access_grant}
+ *
+ * @generated from field: string name = 1;
+ */
+ name: string;
+};
+
+/**
+ * Describes the message bytebase.v1.ActivateAccessGrantRequest.
+ * Use `create(ActivateAccessGrantRequestSchema)` to create a new message.
+ */
+export declare const ActivateAccessGrantRequestSchema: GenMessage<ActivateAccessGrantRequest>;
+
+/**
+ * @generated from message bytebase.v1.RevokeAccessGrantRequest
+ */
+export declare type RevokeAccessGrantRequest = Message<"bytebase.v1.RevokeAccessGrantRequest"> & {
+ /**
+ * The name of the access grant to revoke.
+ * Format: projects/{project}/accessGrants/{access_grant}
+ *
+ * @generated from field: string name = 1;
+ */
+ name: string;
+};
+
+/**
+ * Describes the message bytebase.v1.RevokeAccessGrantRequest.
+ * Use `create(RevokeAccessGrantRequestSchema)` to create a new message.
+ */
+export declare const RevokeAccessGrantRequestSchema: GenMessage<RevokeAccessGrantRequest>;
+
+/**
+ * AccessGrantService manages temporary access grants within projects.
+ *
+ * @generated from service bytebase.v1.AccessGrantService
+ */
+export declare const AccessGrantService: GenService<{
+ /**
+ * Gets an access grant by name.
+ *
+ * @generated from rpc bytebase.v1.AccessGrantService.GetAccessGrant
+ */
+ getAccessGrant: {
+ methodKind: "unary";
+ input: typeof GetAccessGrantRequestSchema;
+ output: typeof AccessGrantSchema;
+ },
+ /**
+ * Lists access grants in a project.
+ *
+ * @generated from rpc bytebase.v1.AccessGrantService.ListAccessGrants
+ */
+ listAccessGrants: {
+ methodKind: "unary";
+ input: typeof ListAccessGrantsRequestSchema;
+ output: typeof ListAccessGrantsResponseSchema;
+ },
+ /**
+ * Creates an access grant.
+ *
+ * @generated from rpc bytebase.v1.AccessGrantService.CreateAccessGrant
+ */
+ createAccessGrant: {
+ methodKind: "unary";
+ input: typeof CreateAccessGrantRequestSchema;
+ output: typeof AccessGrantSchema;
+ },
+ /**
+ * Activates a pending access grant.
+ *
+ * @generated from rpc bytebase.v1.AccessGrantService.ActivateAccessGrant
+ */
+ activateAccessGrant: {
+ methodKind: "unary";
+ input: typeof ActivateAccessGrantRequestSchema;
+ output: typeof AccessGrantSchema;
+ },
+ /**
+ * Revokes an active access grant.
+ *
+ * @generated from rpc bytebase.v1.AccessGrantService.RevokeAccessGrant
+ */
+ revokeAccessGrant: {
+ methodKind: "unary";
+ input: typeof RevokeAccessGrantRequestSchema;
+ output: typeof AccessGrantSchema;
+ },
+}>;
+
diff --git a/frontend/src/types/proto-es/v1/access_grant_service_pb.js b/frontend/src/types/proto-es/v1/access_grant_service_pb.js
new file mode 100644
index 0000000000..e61206467c
--- /dev/null
+++ b/frontend/src/types/proto-es/v1/access_grant_service_pb.js
@@ -0,0 +1,89 @@
+// @generated by protoc-gen-es v2.5.2
+// @generated from file v1/access_grant_service.proto (package bytebase.v1, syntax proto3)
+/* eslint-disable */
+
+import { enumDesc, fileDesc, messageDesc, serviceDesc, tsEnum } from "@bufbuild/protobuf/codegenv2";
+import { file_google_api_annotations } from "../google/api/annotations_pb";
+import { file_google_api_client } from "../google/api/client_pb";
+import { file_google_api_field_behavior } from "../google/api/field_behavior_pb";
+import { file_google_api_resource } from "../google/api/resource_pb";
+import { file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt";
+import { file_v1_annotation } from "./annotation_pb";
+
+/**
+ * Describes the file v1/access_grant_service.proto.
+ */
+export const file_v1_access_grant_service = /*@__PURE__*/
+ fileDesc("Ch12MS9hY2Nlc3NfZ3JhbnRfc2VydmljZS5wcm90bxILYnl0ZWJhc2UudjEi5AMKC0FjY2Vzc0dyYW50EgwKBG5hbWUYASABKAkSFAoHY3JlYXRvchgCIAEoCUID4EECEjQKBnN0YXR1cxgDIAEoDjIfLmJ5dGViYXNlLnYxLkFjY2Vzc0dyYW50LlN0YXR1c0ID4EEDEi8KC2V4cGlyZV90aW1lGAQgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcBISCgVpc3N1ZRgFIAEoCUID4EEDEhQKB3RhcmdldHMYBiADKAlCA+BBAhINCgVxdWVyeRgHIAEoCRIOCgZ1bm1hc2sYCCABKAgSNAoLY3JlYXRlX3RpbWUYCSABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wQgPgQQMSNAoLdXBkYXRlX3RpbWUYCiABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wQgPgQQMiRgoGU3RhdHVzEhYKElNUQVRVU19VTlNQRUNJRklFRBAAEgsKB1BFTkRJTkcQARIKCgZBQ1RJVkUQAhILCgdSRVZPS0VEEAM6T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jZXNzR3JhbnRzLyp9OnJldm9rZUKtAQoPY29tLmJ5dGViYXNlLnYxQhdBY2Nlc3NHcmFudFNlcnZpY2VQcm90b1ABWjRnaXRodWIuY29tL2J5dGViYXNlL2J5dGViYXNlL2JhY2tlbmQvZ2VuZXJhdGVkLWdvL3YxogIDQlhYqgILQnl0ZWJhc2UuVjHKAgtCeXRlYmFzZVxWMeICF0J5dGViYXNlXFYxXEdQQk1ldGFkYXRh6gIMQnl0ZWJhc2U6OlYxYgZwcm90bzM", [file_google_api_annotations, file_google_api_client, file_google_api_field_behavior, file_google_api_resource, file_google_protobuf_timestamp, file_v1_annotation]);
+
+/**
+ * Describes the message bytebase.v1.AccessGrant.
+ * Use `create(AccessGrantSchema)` to create a new message.
+ */
+export const AccessGrantSchema = /*@__PURE__*/
+ messageDesc(file_v1_access_grant_service, 0);
+
+/**
+ * Describes the enum bytebase.v1.AccessGrant.Status.
+ */
+export const AccessGrant_StatusSchema = /*@__PURE__*/
+ enumDesc(file_v1_access_grant_service, 0, 0);
+
+/**
+ * The status of the access grant.
+ *
+ * @generated from enum bytebase.v1.AccessGrant.Status
+ */
+export const AccessGrant_Status = /*@__PURE__*/
+ tsEnum(AccessGrant_StatusSchema);
+
+/**
+ * Describes the message bytebase.v1.GetAccessGrantRequest.
+ * Use `create(GetAccessGrantRequestSchema)` to create a new message.
+ */
+export const GetAccessGrantRequestSchema = /*@__PURE__*/
+ messageDesc(file_v1_access_grant_service, 1);
+
+/**
+ * Describes the message bytebase.v1.ListAccessGrantsRequest.
+ * Use `create(ListAccessGrantsRequestSchema)` to create a new message.
+ */
+export const ListAccessGrantsRequestSchema = /*@__PURE__*/
+ messageDesc(file_v1_access_grant_service, 2);
+
+/**
+ * Describes the message bytebase.v1.ListAccessGrantsResponse.
+ * Use `create(ListAccessGrantsResponseSchema)` to create a new message.
+ */
+export const ListAccessGrantsResponseSchema = /*@__PURE__*/
+ messageDesc(file_v1_access_grant_service, 3);
+
+/**
+ * Describes the message bytebase.v1.CreateAccessGrantRequest.
+ * Use `create(CreateAccessGrantRequestSchema)` to create a new message.
+ */
+export const CreateAccessGrantRequestSchema = /*@__PURE__*/
+ messageDesc(file_v1_access_grant_service, 4);
+
+/**
+ * Describes the message bytebase.v1.ActivateAccessGrantRequest.
+ * Use `create(ActivateAccessGrantRequestSchema)` to create a new message.
+ */
+export const ActivateAccessGrantRequestSchema = /*@__PURE__*/
+ messageDesc(file_v1_access_grant_service, 5);
+
+/**
+ * Describes the message bytebase.v1.RevokeAccessGrantRequest.
+ * Use `create(RevokeAccessGrantRequestSchema)` to create a new message.
+ */
+export const RevokeAccessGrantRequestSchema = /*@__PURE__*/
+ messageDesc(file_v1_access_grant_service, 6);
+
+/**
+ * AccessGrantService manages temporary access grants within projects.
+ *
+ * @generated from service bytebase.v1.AccessGrantService
+ */
+export const AccessGrantService = /*@__PURE__*/
+ serviceDesc(file_v1_access_grant_service, 0);
+
diff --git a/frontend/src/types/proto-es/v1/issue_service_pb.d.ts b/frontend/src/types/proto-es/v1/issue_service_pb.d.ts
index 41bdb538af..d90fe519ba 100644
--- a/frontend/src/types/proto-es/v1/issue_service_pb.d.ts
+++ b/frontend/src/types/proto-es/v1/issue_service_pb.d.ts
@@ -513,6 +513,14 @@ export declare type Issue = Message<"bytebase.v1.Issue"> & {
* @generated from field: bytebase.v1.Issue.ApprovalStatus approval_status = 18;
*/
approvalStatus: Issue_ApprovalStatus;
+
+ /**
+ * The access grant associated with this issue.
+ * Format: projects/{project}/accessGrants/{access_grant}
+ *
+ * @generated from field: string access_grant = 19;
+ */
+ accessGrant: string;
};
/**
@@ -621,6 +629,13 @@ export enum Issue_Type {
* @generated from enum value: DATABASE_EXPORT = 3;
*/
DATABASE_EXPORT = 3,
+
+ /**
+ * Temporary access grant request.
+ *
+ * @generated from enum value: ACCESS_GRANT = 4;
+ */
+ ACCESS_GRANT = 4,
}
/**
diff --git a/frontend/src/types/proto-es/v1/issue_service_pb.js b/frontend/src/types/proto-es/v1/issue_service_pb.js
index 5dabf17fe8..7cd29b8bf3 100644
--- a/frontend/src/types/proto-es/v1/issue_service_pb.js
+++ b/frontend/src/types/proto-es/v1/issue_service_pb.js
@@ -17,7 +17,7 @@ import { file_v1_common } from "./common_pb";
* Describes the file v1/issue_service.proto.
*/
export const file_v1_issue_service = /*@__PURE__*/
- fileDesc("ChZ2MS9pc3N1ZV9zZXJ2aWNlLnByb3RvEgtieXRlYmFzZS52MSJKCg9HZXRJc3N1ZVJlcXVlc3QSKAoEbmFtZRgBIAEoCUIa4EEC+kEUChJieXRlYmFzZS5jb20vSXNzdWUSDQoFZm9yY2UYAiABKAgiagoSQ3JlYXRlSXNzdWVSZXF1ZXN0EiwKBnBhcmVudBgBIAEoCUIc4EEC+kEWChRieXRlYmFzZS5jb20vUHJvamVjdBImCgVpc3N1ZRgCIAEoCzISLmJ5dGViYXNlLnYxLklzc3VlQgPgQQIihwEKEUxpc3RJc3N1ZXNSZXF1ZXN0EiwKBnBhcmVudBgBIAEoCUIc4EEC+kEWChRieXRlYmFzZS5jb20vUHJvamVjdBIRCglwYWdlX3NpemUYAiABKAUSEgoKcGFnZV90b2tlbhgDIAEoCRIOCgZmaWx0ZXIYBCABKAkSDQoFcXVlcnkYBSABKAkiUQoSTGlzdElzc3Vlc1Jlc3BvbnNlEiIKBmlzc3VlcxgBIAMoCzISLmJ5dGViYXNlLnYxLklzc3VlEhcKD25leHRfcGFnZV90b2tlbhgCIAEoCSJwChNTZWFyY2hJc3N1ZXNSZXF1ZXN0EhMKBnBhcmVudBgBIAEoCUID4EECEhEKCXBhZ2Vfc2l6ZRgCIAEoBRISCgpwYWdlX3Rva2VuGAMgASgJEg4KBmZpbHRlchgEIAEoCRINCgVxdWVyeRgFIAEoCSJTChRTZWFyY2hJc3N1ZXNSZXNwb25zZRIiCgZpc3N1ZXMYASADKAsyEi5ieXRlYmFzZS52MS5Jc3N1ZRIXCg9uZXh0X3BhZ2VfdG9rZW4YAiABKAkioAEKElVwZGF0ZUlzc3VlU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SXNzdWVTZXJ2aWNlUHJvdG9QAVo0Z2l0aHViLmNvbS9ieXRlYmFzZS9ieXRlYmFzZS9iYWNrZW5kL2dlbmVyYXRlZC1nby92MaICA0JYWKoCC0J5dGViYXNlLlYxygILQnl0ZWJhc2VcVjHiAhdCeXRlYmFzZVxWMVxHUEJNZXRhZGF0YeoCDEJ5dGViYXNlOjpWMWIGcHJvdG8z", [file_buf_validate_validate, file_google_api_annotations, file_google_api_client, file_google_api_field_behavior, file_google_api_resource, file_google_protobuf_duration, file_google_protobuf_field_mask, file_google_protobuf_timestamp, file_google_type_expr, file_v1_annotation, file_v1_common]);
+ fileDesc("ChZ2MS9pc3N1ZV9zZXJ2aWNlLnByb3RvEgtieXRlYmFzZS52MSJKCg9HZXRJc3N1ZVJlcXVlc3QSKAoEbmFtZRgBIAEoCUIa4EEC+kEUChJieXRlYmFzZS5jb20vSXNzdWUSDQoFZm9yY2UYAiABKAgiagoSQ3JlYXRlSXNzdWVSZXF1ZXN0EiwKBnBhcmVudBgBIAEoCUIc4EEC+kEWChRieXRlYmFzZS5jb20vUHJvamVjdBImCgVpc3N1ZRgCIAEoCzISLmJ5dGViYXNlLnYxLklzc3VlQgPgQQIihwEKEUxpc3RJc3N1ZXNSZXF1ZXN0EiwKBnBhcmVudBgBIAEoCUIc4EEC+kEWChRieXRlYmFzZS5jb20vUHJvamVjdBIRCglwYWdlX3NpemUYAiABKAUSEgoKcGFnZV90b2tlbhgDIAEoCRIOCgZmaWx0ZXIYBCABKAkSDQoFcXVlcnkYBSABKAkiUQoSTGlzdElzc3Vlc1Jlc3BvbnNlEiIKBmlzc3VlcxgBIAMoCzISLmJ5dGViYXNlLnYxLklzc3VlEhcKD25leHRfcGFnZV90b2tlbhgCIAEoCSJwChNTZWFyY2hJc3N1ZXNSZXF1ZXN0EhMKBnBhcmVudBgBIAEoCUID4EECEhEKCXBhZ2Vfc2l6ZRgCIAEoBRISCgpwYWdlX3Rva2VuGAMgASgJEg4KBmZpbHRlchgEI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ovaXNzdWVzLyp9OnJlamVjdBJ/CgxSZXF1ZXN0SXNzdWUSIC5ieXRlYmFzZS52MS5SZXF1ZXN0SXNzdWVSZXF1ZXN0GhIuYnl0ZWJhc2UudjEuSXNzdWUiOZDqMAKY6jABgtPkkwIrOgEqIiYvdjEve25hbWU9cHJvamVjdHMvKi9pc3N1ZXMvKn06cmVxdWVzdEKnAQoPY29tLmJ5dGViYXNlLnYxQhFJc3N1ZVNlcnZpY2VQcm90b1ABWjRnaXRodWIuY29tL2J5dGViYXNlL2J5dGViYXNlL2JhY2tlbmQvZ2VuZXJhdGVkLWdvL3YxogIDQlhYqgILQnl0ZWJhc2UuVjHKAgtCeXRlYmFzZVxWMeICF0J5dGViYXNlXFYxXEdQQk1ldGFkYXRh6gIMQnl0ZWJhc2U6OlYxYgZwcm90bzM", [file_buf_validate_validate, file_google_api_annotations, file_google_api_client, file_google_api_field_behavior, file_google_api_resource, file_google_protobuf_duration, file_google_protobuf_field_mask, file_google_protobuf_timestamp, file_google_type_expr, file_v1_annotation, file_v1_common]);
/**
* Describes the message bytebase.v1.GetIssueRequest.
diff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yaml
index b88387a211..722dff3d58 100644
--- a/proto/gen/grpc-doc/openapi.yaml
+++ b/proto/gen/grpc-doc/openapi.yaml
@@ -7171,6 +7171,174 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/bytebase.v1.Project'
+ /v1/projects/{project}/accessGrants:
+ get:
+ tags:
+ - AccessGrantService
+ summary: ListAccessGrants
+ description: Lists access grants in a project.
+ operationId: AccessGrantService_ListAccessGrants
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: pageSize
+ in: query
+ description: The maximum number of access grants to return.
+ schema:
+ type: integer
+ title: page_size
+ format: int32
+ description: The maximum number of access grants to return.
+ - name: pageToken
+ in: query
+ description: A page token from a previous ListAccessGrants call.
+ schema:
+ type: string
+ title: page_token
+ description: A page token from a previous ListAccessGrants call.
+ - name: filter
+ in: query
+ description: |-
+ Filter expression using AIP-160 syntax.
+ Supported fields: creator, status, issue, expire_time, create_time
+ Examples:
+ - 'creator = "users/[email protected]"'
+ - 'status = "ACTIVE"'
+ - 'creator = "users/[email protected]" AND status = "ACTIVE"'
+ - 'issue = "projects/x/issues/123"'
+ - 'status = "ACTIVE" AND expire_time > "2024-02-01T00:00:00Z"'
+ schema:
+ type: string
+ title: filter
+ description: |-
+ Filter expression using AIP-160 syntax.
+ Supported fields: creator, status, issue, expire_time, create_time
+ Examples:
+ - 'creator = "users/[email protected]"'
+ - 'status = "ACTIVE"'
+ - 'creator = "users/[email protected]" AND status = "ACTIVE"'
+ - 'issue = "projects/x/issues/123"'
+ - 'status = "ACTIVE" AND expire_time > "2024-02-01T00:00:00Z"'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.ListAccessGrantsResponse'
+ post:
+ tags:
+ - AccessGrantService
+ summary: CreateAccessGrant
+ description: Creates an access grant.
+ operationId: AccessGrantService_CreateAccessGrant
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ requestBody:
+ description: The access grant to create.
+ content:
+ application/json:
+ schema:
+ title: access_grant
+ description: The access grant to create.
+ $ref: '#/components/schemas/bytebase.v1.AccessGrant'
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.AccessGrant'
+ /v1/projects/{project}/accessGrants/{accessGrant}:
+ get:
+ tags:
+ - AccessGrantService
+ summary: GetAccessGrant
+ description: Gets an access grant by name.
+ operationId: AccessGrantService_GetAccessGrant
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: accessGrant
+ in: path
+ description: The accessGrant id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.AccessGrant'
+ /v1/projects/{project}/accessGrants/{accessGrant}:activate:
+ post:
+ tags:
+ - AccessGrantService
+ summary: ActivateAccessGrant
+ description: Activates a pending access grant.
+ operationId: AccessGrantService_ActivateAccessGrant
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: accessGrant
+ in: path
+ description: The accessGrant id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.AccessGrant'
+ /v1/projects/{project}/accessGrants/{accessGrant}:revoke:
+ post:
+ tags:
+ - AccessGrantService
+ summary: RevokeAccessGrant
+ description: Revokes an active access grant.
+ operationId: AccessGrantService_RevokeAccessGrant
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: accessGrant
+ in: path
+ description: The accessGrant id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bytebase.v1.AccessGrant'
/v1/projects/{project}/auditLogs:export:
post:
tags:
@@ -15637,6 +15805,97 @@ components:
- CLAUDE
- GEMINI
- AZURE_OPENAI
+ bytebase.v1.AccessGrant:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the access grant, generated by the server.
+ Format: projects/{project}/accessGrants/{access_grant}
+ The {access_grant} segment is a server-generated unique ID.
+ creator:
+ type: string
+ title: creator
+ description: |-
+ The creator of the access grant.
+ Format: users/{email}
+ status:
+ title: status
+ description: |-
+ The status of the access grant.
+ An ACTIVE grant with `expire_time` in the past is effectively expired
+ and no longer authorizes access. Use `expire_time` to determine
+ whether an ACTIVE grant has expired.
+ readOnly: true
+ $ref: '#/components/schemas/bytebase.v1.AccessGrant.Status'
+ expireTime:
+ title: expire_time
+ description: |-
+ The expiration time of the access grant.
+ When the current time exceeds this value, an ACTIVE grant is
+ considered expired and no longer authorizes access.
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ issue:
+ type: string
+ title: issue
+ description: |-
+ The issue associated with the access grant.
+ Can be empty.
+ Format: projects/{project}/issues/{issue}
+ readOnly: true
+ targets:
+ type: array
+ items:
+ type: string
+ title: targets
+ description: |-
+ The target databases for this access grant.
+ Format: instances/{instance}/databases/{database}
+ query:
+ type: string
+ title: query
+ description: The query permission granted.
+ unmask:
+ type: boolean
+ title: unmask
+ description: Whether the grant allows unmasking sensitive data.
+ createTime:
+ title: create_time
+ readOnly: true
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ updateTime:
+ title: update_time
+ readOnly: true
+ $ref: '#/components/schemas/google.protobuf.Timestamp'
+ title: AccessGrant
+ required:
+ - creator
+ - targets
+ additionalProperties: false
+ bytebase.v1.AccessGrant.Status:
+ type: string
+ title: Status
+ enum:
+ - STATUS_UNSPECIFIED
+ - PENDING
+ - ACTIVE
+ - REVOKED
+ description: The status of the access grant.
+ bytebase.v1.ActivateAccessGrantRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the access grant to activate.
+ Format: projects/{project}/accessGrants/{access_grant}
+ title: ActivateAccessGrantRequest
+ required:
+ - name
+ additionalProperties: false
bytebase.v1.Activity:
type: object
title: Activity
@@ -17293,6 +17552,24 @@ components:
- IDENTITY_GENERATION_UNSPECIFIED
- ALWAYS
- BY_DEFAULT
+ bytebase.v1.CreateAccessGrantRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: |-
+ The parent project for the access grant.
+ Format: projects/{project}
+ accessGrant:
+ title: access_grant
+ description: The access grant to create.
+ $ref: '#/components/schemas/bytebase.v1.AccessGrant'
+ title: CreateAccessGrantRequest
+ required:
+ - parent
+ - accessGrant
+ additionalProperties: false
bytebase.v1.CreateDatabaseGroupRequest:
type: object
properties:
@@ -19304,6 +19581,19 @@ components:
- TYPE_UNSPECIFIED
- VIRTUAL
- STORED
+ bytebase.v1.GetAccessGrantRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the access grant to retrieve.
+ Format: projects/{project}/accessGrants/{access_grant}
+ title: GetAccessGrantRequest
+ required:
+ - name
+ additionalProperties: false
bytebase.v1.GetActuatorInfoRequest:
type: object
title: GetActuatorInfoRequest
@@ -20385,6 +20675,13 @@ components:
title: approval_status
readOnly: true
$ref: '#/components/schemas/bytebase.v1.Issue.ApprovalStatus'
+ accessGrant:
+ type: string
+ title: access_grant
+ description: |-
+ The access grant associated with this issue.
+ Format: projects/{project}/accessGrants/{access_grant}
+ readOnly: true
title: Issue
additionalProperties: false
bytebase.v1.Issue.ApprovalStatus:
@@ -20429,6 +20726,7 @@ components:
- DATABASE_CHANGE
- GRANT_REQUEST
- DATABASE_EXPORT
+ - ACCESS_GRANT
description: The type of issue.
bytebase.v1.IssueComment:
type: object
@@ -20703,6 +21001,57 @@ components:
title: Label
additionalProperties: false
description: A label for categorizing and organizing issues.
+ bytebase.v1.ListAccessGrantsRequest:
+ type: object
+ properties:
+ parent:
+ type: string
+ title: parent
+ description: |-
+ The parent project of the access grants.
+ Format: projects/{project}
+ pageSize:
+ type: integer
+ title: page_size
+ format: int32
+ description: The maximum number of access grants to return.
+ pageToken:
+ type: string
+ title: page_token
+ description: A page token from a previous ListAccessGrants call.
+ filter:
+ type: string
+ title: filter
+ description: |-
+ Filter expression using AIP-160 syntax.
+ Supported fields: creator, status, issue, expire_time, create_time
+ Examples:
+ - 'creator = "users/[email protected]"'
+ - 'status = "ACTIVE"'
+ - 'creator = "users/[email protected]" AND status = "ACTIVE"'
+ - 'issue = "projects/x/issues/123"'
+ - 'status = "ACTIVE" AND expire_time > "2024-02-01T00:00:00Z"'
+ title: ListAccessGrantsRequest
+ required:
+ - parent
+ additionalProperties: false
+ bytebase.v1.ListAccessGrantsResponse:
+ type: object
+ properties:
+ accessGrants:
+ type: array
+ items:
+ $ref: '#/components/schemas/bytebase.v1.AccessGrant'
+ title: access_grants
+ description: The access grants from the specified request.
+ nextPageToken:
+ type: string
+ title: next_page_token
+ description: |-
+ A token, which can be sent as `page_token` to retrieve the next page.
+ If this field is omitted, there are no subsequent pages.
+ title: ListAccessGrantsResponse
+ additionalProperties: false
bytebase.v1.ListChangelogsRequest:
type: object
properties:
@@ -23919,6 +24268,19 @@ components:
- VERSIONED
- DECLARATIVE
description: The type of schema revision.
+ bytebase.v1.RevokeAccessGrantRequest:
+ type: object
+ properties:
+ name:
+ type: string
+ title: name
+ description: |-
+ The name of the access grant to revoke.
+ Format: projects/{project}/accessGrants/{access_grant}
+ title: RevokeAccessGrantRequest
+ required:
+ - name
+ additionalProperties: false
bytebase.v1.RiskLevel:
type: string
title: RiskLevel
@@ -28945,6 +29307,8 @@ components:
documentation for additional information.
security: []
tags:
+ - name: AccessGrantService
+ description: AccessGrantService manages temporary access grants within projects.
- name: IssueService
description: IssueService manages issues for tracking database changes and tasks.
- name: SettingService
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index 62be784974..3a5871808a 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -11,6 +11,19 @@
- [File-level Extensions](#v1_annotation-proto-extensions)
- [File-level Extensions](#v1_annotation-proto-extensions)
+- [v1/access_grant_service.proto](#v1_access_grant_service-proto)
+ - [AccessGrant](#bytebase-v1-AccessGrant)
+ - [ActivateAccessGrantRequest](#bytebase-v1-ActivateAccessGrantRequest)
+ - [CreateAccessGrantRequest](#bytebase-v1-CreateAccessGrantRequest)
+ - [GetAccessGrantRequest](#bytebase-v1-GetAccessGrantRequest)
+ - [ListAccessGrantsRequest](#bytebase-v1-ListAccessGrantsRequest)
+ - [ListAccessGrantsResponse](#bytebase-v1-ListAccessGrantsResponse)
+ - [RevokeAccessGrantRequest](#bytebase-v1-RevokeAccessGrantRequest)
+
+ - [AccessGrant.Status](#bytebase-v1-AccessGrant-Status)
+
+ - [AccessGrantService](#bytebase-v1-AccessGrantService)
+
- [v1/common.proto](#v1_common-proto)
- [PermissionDeniedDetail](#bytebase-v1-PermissionDeniedDetail)
- [Position](#bytebase-v1-Position)
@@ -732,6 +745,169 @@ Authorization method for RPC calls.
+<a name="v1_access_grant_service-proto"></a>
+<p align="right"><a href="#top">Top</a></p>
+
+## v1/access_grant_service.proto
+
+
+
+<a name="bytebase-v1-AccessGrant"></a>
+
+### AccessGrant
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| name | [string](#string) | | The name of the access grant, generated by the server. Format: projects/{project}/accessGrants/{access_grant} The {access_grant} segment is a server-generated unique ID. |
+| creator | [string](#string) | | The creator of the access grant. Format: users/{email} |
+| status | [AccessGrant.Status](#bytebase-v1-AccessGrant-Status) | | The status of the access grant. An ACTIVE grant with `expire_time` in the past is effectively expired and no longer authorizes access. Use `expire_time` to determine whether an ACTIVE grant has expired. |
+| expire_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | The expiration time of the access grant. When the current time exceeds this value, an ACTIVE grant is considered expired and no longer authorizes access. |
+| issue | [string](#string) | | The issue associated with the access grant. Can be empty. Format: projects/{project}/issues/{issue} |
+| targets | [string](#string) | repeated | The target databases for this access grant. Format: instances/{instance}/databases/{database} |
+| query | [string](#string) | | The query permission granted. |
+| unmask | [bool](#bool) | | Whether the grant allows unmasking sensitive data. |
+| create_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |
+| update_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |
+
+
+
+
+
+
+<a name="bytebase-v1-ActivateAccessGrantRequest"></a>
+
+### ActivateAccessGrantRequest
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| name | [string](#string) | | The name of the access grant to activate. Format: projects/{project}/accessGrants/{access_grant} |
+
+
+
+
+
+
+<a name="bytebase-v1-CreateAccessGrantRequest"></a>
+
+### CreateAccessGrantRequest
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| parent | [string](#string) | | The parent project for the access grant. Format: projects/{project} |
+| access_grant | [AccessGrant](#bytebase-v1-AccessGrant) | | The access grant to create. |
+
+
+
+
+
+
+<a name="bytebase-v1-GetAccessGrantRequest"></a>
+
+### GetAccessGrantRequest
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| name | [string](#string) | | The name of the access grant to retrieve. Format: projects/{project}/accessGrants/{access_grant} |
+
+
+
+
+
+
+<a name="bytebase-v1-ListAccessGrantsRequest"></a>
+
+### ListAccessGrantsRequest
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| parent | [string](#string) | | The parent project of the access grants. Format: projects/{project} |
+| page_size | [int32](#int32) | | The maximum number of access grants to return. |
+| page_token | [string](#string) | | A page token from a previous ListAccessGrants call. |
+| filter | [string](#string) | | Filter expression using AIP-160 syntax. Supported fields: creator, status, issue, expire_time, create_time Examples: - &#39;creator = &#34;users/[email protected]&#34;&#39; - &#39;status = &#34;ACTIVE&#34;&#39; - &#39;creator = &#34;users/[email protected]&#34; AND status = &#34;ACTIVE&#34;&#39; - &#39;issue = &#34;projects/x/issues/123&#34;&#39; - &#39;status = &#34;ACTIVE&#34; AND expire_time &gt; &#34;2024-02-01T00:00:00Z&#34;&#39; |
+
+
+
+
+
+
+<a name="bytebase-v1-ListAccessGrantsResponse"></a>
+
+### ListAccessGrantsResponse
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| access_grants | [AccessGrant](#bytebase-v1-AccessGrant) | repeated | The access grants from the specified request. |
+| next_page_token | [string](#string) | | A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages. |
+
+
+
+
+
+
+<a name="bytebase-v1-RevokeAccessGrantRequest"></a>
+
+### RevokeAccessGrantRequest
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| name | [string](#string) | | The name of the access grant to revoke. Format: projects/{project}/accessGrants/{access_grant} |
+
+
+
+
+
+
+
+
+<a name="bytebase-v1-AccessGrant-Status"></a>
+
+### AccessGrant.Status
+The status of the access grant.
+
+| Name | Number | Description |
+| ---- | ------ | ----------- |
+| STATUS_UNSPECIFIED | 0 | |
+| PENDING | 1 | The access grant is pending approval. |
+| ACTIVE | 2 | The access grant is active. Check `expire_time` to determine whether the grant is still valid or has expired. |
+| REVOKED | 3 | The access grant has been revoked. |
+
+
+
+
+
+
+
+<a name="bytebase-v1-AccessGrantService"></a>
+
+### AccessGrantService
+AccessGrantService manages temporary access grants within projects.
+
+| Method Name | Request Type | Response Type | Description |
+| ----------- | ------------ | ------------- | ------------|
+| GetAccessGrant | [GetAccessGrantRequest](#bytebase-v1-GetAccessGrantRequest) | [AccessGrant](#bytebase-v1-AccessGrant) | Gets an access grant by name. |
+| ListAccessGrants | [ListAccessGrantsRequest](#bytebase-v1-ListAccessGrantsRequest) | [ListAccessGrantsResponse](#bytebase-v1-ListAccessGrantsResponse) | Lists access grants in a project. |
+| CreateAccessGrant | [CreateAccessGrantRequest](#bytebase-v1-CreateAccessGrantRequest) | [AccessGrant](#bytebase-v1-AccessGrant) | Creates an access grant. |
+| ActivateAccessGrant | [ActivateAccessGrantRequest](#bytebase-v1-ActivateAccessGrantRequest) | [AccessGrant](#bytebase-v1-AccessGrant) | Activates a pending access grant. |
+| RevokeAccessGrant | [RevokeAccessGrantRequest](#bytebase-v1-RevokeAccessGrantRequest) | [AccessGrant](#bytebase-v1-AccessGrant) | Revokes an active access grant. |
+
+
+
+
+
<a name="v1_common-proto"></a>
<p align="right"><a href="#top">Top</a></p>
@@ -1148,6 +1324,7 @@ Webhook integration type.
| risk_level | [RiskLevel](#bytebase-v1-RiskLevel) | | The risk level of the issue. |
| labels | [string](#string) | repeated | Labels attached to the issue for categorization and filtering. |
| approval_status | [Issue.ApprovalStatus](#bytebase-v1-Issue-ApprovalStatus) | | |
+| access_grant | [string](#string) | | The access grant associated with this issue. Format: projects/{project}/accessGrants/{access_grant} |
@@ -1472,6 +1649,7 @@ The type of issue.
| DATABASE_CHANGE | 1 | Database schema or data change. |
| GRANT_REQUEST | 2 | Database access grant request. |
| DATABASE_EXPORT | 3 | Database data export request. |
+| ACCESS_GRANT | 4 | Temporary access grant request. |
diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.html
index 8bfb39f48b..84687f6f7a 100644
--- a/proto/gen/grpc-doc/v1/index.html
+++ b/proto/gen/grpc-doc/v1/index.html
@@ -205,6 +205,53 @@
</li>
+ <li>
+ <a href="#v1%2faccess_grant_service.proto">v1/access_grant_service.proto</a>
+ <ul>
+
+ <li>
+ <a href="#bytebase.v1.AccessGrant"><span class="badge">M</span>AccessGrant</a>
+ </li>
+
+ <li>
+ <a href="#bytebase.v1.ActivateAccessGrantRequest"><span class="badge">M</span>ActivateAccessGrantRequest</a>
+ </li>
+
+ <li>
+ <a href="#bytebase.v1.CreateAccessGrantRequest"><span class="badge">M</span>CreateAccessGrantRequest</a>
+ </li>
+
+ <li>
+ <a href="#bytebase.v1.GetAccessGrantRequest"><span class="badge">M</span>GetAccessGrantRequest</a>
+ </li>
+
+ <li>
+ <a href="#bytebase.v1.ListAccessGrantsRequest"><span class="badge">M</span>ListAccessGrantsRequest</a>
+ </li>
+
+ <li>
+ <a href="#bytebase.v1.ListAccessGrantsResponse"><span class="badge">M</span>ListAccessGrantsResponse</a>
+ </li>
+
+ <li>
+ <a href="#bytebase.v1.RevokeAccessGrantRequest"><span class="badge">M</span>RevokeAccessGrantRequest</a>
+ </li>
+
+
+ <li>
+ <a href="#bytebase.v1.AccessGrant.Status"><span class="badge">E</span>AccessGrant.Status</a>
+ </li>
+
+
+
+ <li>
+ <a href="#bytebase.v1.AccessGrantService"><span class="badge">S</span>AccessGrantService</a>
+ </li>
+
+ </ul>
+ </li>
+
+
<li>
<a href="#v1%2fcommon.proto">v1/common.proto</a>
<ul>
@@ -2892,6 +2939,461 @@
+ <div class="file-heading">
+ <h2 id="v1/access_grant_service.proto">v1/access_grant_service.proto</h2><a href="#title">Top</a>
+ </div>
+ <p></p>
+
+
+ <h3 id="bytebase.v1.AccessGrant">AccessGrant</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 access grant, generated by the server.
+Format: projects/{project}/accessGrants/{access_grant}
+The {access_grant} segment is a server-generated unique ID. </p></td>
+ </tr>
+
+ <tr>
+ <td>creator</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>The creator of the access grant.
+Format: users/{email} </p></td>
+ </tr>
+
+ <tr>
+ <td>status</td>
+ <td><a href="#bytebase.v1.AccessGrant.Status">AccessGrant.Status</a></td>
+ <td></td>
+ <td><p>The status of the access grant.
+An ACTIVE grant with `expire_time` in the past is effectively expired
+and no longer authorizes access. Use `expire_time` to determine
+whether an ACTIVE grant has expired. </p></td>
+ </tr>
+
+ <tr>
+ <td>expire_time</td>
+ <td><a href="#google.protobuf.Timestamp">google.protobuf.Timestamp</a></td>
+ <td></td>
+ <td><p>The expiration time of the access grant.
+When the current time exceeds this value, an ACTIVE grant is
+considered expired and no longer authorizes access. </p></td>
+ </tr>
+
+ <tr>
+ <td>issue</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>The issue associated with the access grant.
+Can be empty.
+Format: projects/{project}/issues/{issue} </p></td>
+ </tr>
+
+ <tr>
+ <td>targets</td>
+ <td><a href="#string">string</a></td>
+ <td>repeated</td>
+ <td><p>The target databases for this access grant.
+Format: instances/{instance}/databases/{database} </p></td>
+ </tr>
+
+ <tr>
+ <td>query</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>The query permission granted. </p></td>
+ </tr>
+
+ <tr>
+ <td>unmask</td>
+ <td><a href="#bool">bool</a></td>
+ <td></td>
+ <td><p>Whether the grant allows unmasking sensitive data. </p></td>
+ </tr>
+
+ <tr>
+ <td>create_time</td>
+ <td><a href="#google.protobuf.Timestamp">google.protobuf.Timestamp</a></td>
+ <td></td>
+ <td><p> </p></td>
+ </tr>
+
+ <tr>
+ <td>update_time</td>
+ <td><a href="#google.protobuf.Timestamp">google.protobuf.Timestamp</a></td>
+ <td></td>
+ <td><p> </p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+
+
+
+
+ <h3 id="bytebase.v1.ActivateAccessGrantRequest">ActivateAccessGrantRequest</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 access grant to activate.
+Format: projects/{project}/accessGrants/{access_grant} </p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+
+
+
+
+ <h3 id="bytebase.v1.CreateAccessGrantRequest">CreateAccessGrantRequest</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 project for the access grant.
+Format: projects/{project} </p></td>
+ </tr>
+
+ <tr>
+ <td>access_grant</td>
+ <td><a href="#bytebase.v1.AccessGrant">AccessGrant</a></td>
+ <td></td>
+ <td><p>The access grant to create. </p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+
+
+
+
+ <h3 id="bytebase.v1.GetAccessGrantRequest">GetAccessGrantRequest</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 access grant to retrieve.
+Format: projects/{project}/accessGrants/{access_grant} </p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+
+
+
+
+ <h3 id="bytebase.v1.ListAccessGrantsRequest">ListAccessGrantsRequest</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 project of the access grants.
+Format: projects/{project} </p></td>
+ </tr>
+
+ <tr>
+ <td>page_size</td>
+ <td><a href="#int32">int32</a></td>
+ <td></td>
+ <td><p>The maximum number of access grants to return. </p></td>
+ </tr>
+
+ <tr>
+ <td>page_token</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>A page token from a previous ListAccessGrants call. </p></td>
+ </tr>
+
+ <tr>
+ <td>filter</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>Filter expression using AIP-160 syntax.
+Supported fields: creator, status, issue, expire_time, create_time
+Examples:
+ - &#39;creator = &#34;users/[email protected]&#34;&#39;
+ - &#39;status = &#34;ACTIVE&#34;&#39;
+ - &#39;creator = &#34;users/[email protected]&#34; AND status = &#34;ACTIVE&#34;&#39;
+ - &#39;issue = &#34;projects/x/issues/123&#34;&#39;
+ - &#39;status = &#34;ACTIVE&#34; AND expire_time &gt; &#34;2024-02-01T00:00:00Z&#34;&#39; </p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+
+
+
+
+ <h3 id="bytebase.v1.ListAccessGrantsResponse">ListAccessGrantsResponse</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>access_grants</td>
+ <td><a href="#bytebase.v1.AccessGrant">AccessGrant</a></td>
+ <td>repeated</td>
+ <td><p>The access grants from the specified request. </p></td>
+ </tr>
+
+ <tr>
+ <td>next_page_token</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>A token, which can be sent as `page_token` to retrieve the next page.
+If this field is omitted, there are no subsequent pages. </p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+
+
+
+
+ <h3 id="bytebase.v1.RevokeAccessGrantRequest">RevokeAccessGrantRequest</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 access grant to revoke.
+Format: projects/{project}/accessGrants/{access_grant} </p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+
+
+
+
+
+
+ <h3 id="bytebase.v1.AccessGrant.Status">AccessGrant.Status</h3>
+ <p>The status of the access grant.</p>
+ <table class="enum-table">
+ <thead>
+ <tr><td>Name</td><td>Number</td><td>Description</td></tr>
+ </thead>
+ <tbody>
+
+ <tr>
+ <td>STATUS_UNSPECIFIED</td>
+ <td>0</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>PENDING</td>
+ <td>1</td>
+ <td><p>The access grant is pending approval.</p></td>
+ </tr>
+
+ <tr>
+ <td>ACTIVE</td>
+ <td>2</td>
+ <td><p>The access grant is active. Check `expire_time` to determine
+whether the grant is still valid or has expired.</p></td>
+ </tr>
+
+ <tr>
+ <td>REVOKED</td>
+ <td>3</td>
+ <td><p>The access grant has been revoked.</p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+
+
+
+
+ <h3 id="bytebase.v1.AccessGrantService">AccessGrantService</h3>
+ <p>AccessGrantService manages temporary access grants within projects.</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>GetAccessGrant</td>
+ <td><a href="#bytebase.v1.GetAccessGrantRequest">GetAccessGrantRequest</a></td>
+ <td><a href="#bytebase.v1.AccessGrant">AccessGrant</a></td>
+ <td><p>Gets an access grant by name.</p></td>
+ </tr>
+
+ <tr>
+ <td>ListAccessGrants</td>
+ <td><a href="#bytebase.v1.ListAccessGrantsRequest">ListAccessGrantsRequest</a></td>
+ <td><a href="#bytebase.v1.ListAccessGrantsResponse">ListAccessGrantsResponse</a></td>
+ <td><p>Lists access grants in a project.</p></td>
+ </tr>
+
+ <tr>
+ <td>CreateAccessGrant</td>
+ <td><a href="#bytebase.v1.CreateAccessGrantRequest">CreateAccessGrantRequest</a></td>
+ <td><a href="#bytebase.v1.AccessGrant">AccessGrant</a></td>
+ <td><p>Creates an access grant.</p></td>
+ </tr>
+
+ <tr>
+ <td>ActivateAccessGrant</td>
+ <td><a href="#bytebase.v1.ActivateAccessGrantRequest">ActivateAccessGrantRequest</a></td>
+ <td><a href="#bytebase.v1.AccessGrant">AccessGrant</a></td>
+ <td><p>Activates a pending access grant.</p></td>
+ </tr>
+
+ <tr>
+ <td>RevokeAccessGrant</td>
+ <td><a href="#bytebase.v1.RevokeAccessGrantRequest">RevokeAccessGrantRequest</a></td>
+ <td><a href="#bytebase.v1.AccessGrant">AccessGrant</a></td>
+ <td><p>Revokes an active access grant.</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>GetAccessGrant</td>
+ <td>GET</td>
+ <td>/v1/{name=projects/*/accessGrants/*}</td>
+ <td></td>
+ </tr>
+
+
+
+
+ <tr>
+ <td>ListAccessGrants</td>
+ <td>GET</td>
+ <td>/v1/{parent=projects/*}/accessGrants</td>
+ <td></td>
+ </tr>
+
+
+
+
+ <tr>
+ <td>CreateAccessGrant</td>
+ <td>POST</td>
+ <td>/v1/{parent=projects/*}/accessGrants</td>
+ <td>access_grant</td>
+ </tr>
+
+
+
+
+ <tr>
+ <td>ActivateAccessGrant</td>
+ <td>POST</td>
+ <td>/v1/{name=projects/*/accessGrants/*}:activate</td>
+ <td>*</td>
+ </tr>
+
+
+
+
+ <tr>
+ <td>RevokeAccessGrant</td>
+ <td>POST</td>
+ <td>/v1/{name=projects/*/accessGrants/*}:revoke</td>
+ <td>*</td>
+ </tr>
+
+
+ </tbody>
+ </table>
+
+
+
+
<div class="file-heading">
<h2 id="v1/common.proto">v1/common.proto</h2><a href="#title">Top</a>
</div>
@@ -4062,6 +4564,14 @@ Format: projects/{project}/plans/{plan} </p></td>
<td><p> </p></td>
</tr>
+ <tr>
+ <td>access_grant</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>The access grant associated with this issue.
+Format: projects/{project}/accessGrants/{access_grant} </p></td>
+ </tr>
+
</tbody>
</table>
@@ -4866,6 +5376,12 @@ In this situation, `update_mask` is ignored. </p></td>
<td><p>Database data export request.</p></td>
</tr>
+ <tr>
+ <td>ACCESS_GRANT</td>
+ <td>4</td>
+ <td><p>Temporary access grant request.</p></td>
+ </tr>
+
</tbody>
</table>
diff --git a/proto/v1/v1/access_grant_service.proto b/proto/v1/v1/access_grant_service.proto
new file mode 100644
index 0000000000..44099e5f1a
--- /dev/null
+++ b/proto/v1/v1/access_grant_service.proto
@@ -0,0 +1,198 @@
+syntax = "proto3";
+
+package bytebase.v1;
+
+import "google/api/annotations.proto";
+import "google/api/client.proto";
+import "google/api/field_behavior.proto";
+import "google/api/resource.proto";
+import "google/protobuf/timestamp.proto";
+import "v1/annotation.proto";
+
+option go_package = "github.com/bytebase/bytebase/backend/generated-go/v1";
+
+// AccessGrantService manages temporary access grants within projects.
+service AccessGrantService {
+ // Gets an access grant by name.
+ rpc GetAccessGrant(GetAccessGrantRequest) returns (AccessGrant) {
+ option (google.api.http) = {get: "/v1/{name=projects/*/accessGrants/*}"};
+ option (google.api.method_signature) = "name";
+ option (bytebase.v1.permission) = "bb.accessGrants.get";
+ option (bytebase.v1.auth_method) = IAM;
+ }
+
+ // Lists access grants in a project.
+ rpc ListAccessGrants(ListAccessGrantsRequest) returns (ListAccessGrantsResponse) {
+ option (google.api.http) = {get: "/v1/{parent=projects/*}/accessGrants"};
+ option (google.api.method_signature) = "parent";
+ option (bytebase.v1.permission) = "bb.accessGrants.list";
+ option (bytebase.v1.auth_method) = IAM;
+ }
+
+ // Creates an access grant.
+ rpc CreateAccessGrant(CreateAccessGrantRequest) returns (AccessGrant) {
+ option (google.api.http) = {
+ post: "/v1/{parent=projects/*}/accessGrants"
+ body: "access_grant"
+ };
+ option (google.api.method_signature) = "parent,access_grant";
+ option (bytebase.v1.permission) = "bb.accessGrants.create";
+ option (bytebase.v1.auth_method) = IAM;
+ option (bytebase.v1.audit) = true;
+ }
+
+ // Activates a pending access grant.
+ rpc ActivateAccessGrant(ActivateAccessGrantRequest) returns (AccessGrant) {
+ option (google.api.http) = {
+ post: "/v1/{name=projects/*/accessGrants/*}:activate"
+ body: "*"
+ };
+ option (google.api.method_signature) = "name";
+ option (bytebase.v1.permission) = "bb.accessGrants.activate";
+ option (bytebase.v1.auth_method) = IAM;
+ option (bytebase.v1.audit) = true;
+ }
+
+ // Revokes an active access grant.
+ rpc RevokeAccessGrant(RevokeAccessGrantRequest) returns (AccessGrant) {
+ option (google.api.http) = {
+ post: "/v1/{name=projects/*/accessGrants/*}:revoke"
+ body: "*"
+ };
+ option (google.api.method_signature) = "name";
+ option (bytebase.v1.permission) = "bb.accessGrants.revoke";
+ option (bytebase.v1.auth_method) = IAM;
+ option (bytebase.v1.audit) = true;
+ }
+}
+
+message AccessGrant {
+ option (google.api.resource) = {
+ type: "bytebase.com/AccessGrant"
+ pattern: "projects/{project}/accessGrants/{access_grant}"
+ };
+
+ // The name of the access grant, generated by the server.
+ // Format: projects/{project}/accessGrants/{access_grant}
+ // The {access_grant} segment is a server-generated unique ID.
+ string name = 1;
+
+ // The creator of the access grant.
+ // Format: users/{email}
+ string creator = 2 [(google.api.field_behavior) = REQUIRED];
+
+ // The status of the access grant.
+ // An ACTIVE grant with `expire_time` in the past is effectively expired
+ // and no longer authorizes access. Use `expire_time` to determine
+ // whether an ACTIVE grant has expired.
+ Status status = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+ // The expiration time of the access grant.
+ // When the current time exceeds this value, an ACTIVE grant is
+ // considered expired and no longer authorizes access.
+ google.protobuf.Timestamp expire_time = 4;
+
+ // The issue associated with the access grant.
+ // Can be empty.
+ // Format: projects/{project}/issues/{issue}
+ string issue = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+ // The target databases for this access grant.
+ // Format: instances/{instance}/databases/{database}
+ repeated string targets = 6 [(google.api.field_behavior) = REQUIRED];
+
+ // The query permission granted.
+ string query = 7;
+
+ // Whether the grant allows unmasking sensitive data.
+ bool unmask = 8;
+
+ google.protobuf.Timestamp create_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+ google.protobuf.Timestamp update_time = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+ // The status of the access grant.
+ enum Status {
+ STATUS_UNSPECIFIED = 0;
+ // The access grant is pending approval.
+ PENDING = 1;
+ // The access grant is active. Check `expire_time` to determine
+ // whether the grant is still valid or has expired.
+ ACTIVE = 2;
+ // The access grant has been revoked.
+ REVOKED = 3;
+ }
+}
+
+message GetAccessGrantRequest {
+ // The name of the access grant to retrieve.
+ // Format: projects/{project}/accessGrants/{access_grant}
+ string name = 1 [
+ (google.api.field_behavior) = REQUIRED,
+ (google.api.resource_reference) = {type: "bytebase.com/AccessGrant"}
+ ];
+}
+
+message ListAccessGrantsRequest {
+ // The parent project of the access grants.
+ // Format: projects/{project}
+ string parent = 1 [
+ (google.api.field_behavior) = REQUIRED,
+ (google.api.resource_reference) = {type: "bytebase.com/Project"}
+ ];
+
+ // The maximum number of access grants to return.
+ int32 page_size = 2;
+
+ // A page token from a previous ListAccessGrants call.
+ string page_token = 3;
+
+ // Filter expression using AIP-160 syntax.
+ // Supported fields: creator, status, issue, expire_time, create_time
+ // Examples:
+ // - 'creator = "users/[email protected]"'
+ // - 'status = "ACTIVE"'
+ // - 'creator = "users/[email protected]" AND status = "ACTIVE"'
+ // - 'issue = "projects/x/issues/123"'
+ // - 'status = "ACTIVE" AND expire_time > "2024-02-01T00:00:00Z"'
+ string filter = 4;
+}
+
+message ListAccessGrantsResponse {
+ // The access grants from the specified request.
+ repeated AccessGrant access_grants = 1;
+
+ // A token, which can be sent as `page_token` to retrieve the next page.
+ // If this field is omitted, there are no subsequent pages.
+ string next_page_token = 2;
+}
+
+message CreateAccessGrantRequest {
+ // The parent project for the access grant.
+ // Format: projects/{project}
+ string parent = 1 [
+ (google.api.field_behavior) = REQUIRED,
+ (google.api.resource_reference) = {type: "bytebase.com/Project"}
+ ];
+
+ // The access grant to create.
+ AccessGrant access_grant = 2 [(google.api.field_behavior) = REQUIRED];
+}
+
+message ActivateAccessGrantRequest {
+ // The name of the access grant to activate.
+ // Format: projects/{project}/accessGrants/{access_grant}
+ string name = 1 [
+ (google.api.field_behavior) = REQUIRED,
+ (google.api.resource_reference) = {type: "bytebase.com/AccessGrant"}
+ ];
+}
+
+message RevokeAccessGrantRequest {
+ // The name of the access grant to revoke.
+ // Format: projects/{project}/accessGrants/{access_grant}
+ string name = 1 [
+ (google.api.field_behavior) = REQUIRED,
+ (google.api.resource_reference) = {type: "bytebase.com/AccessGrant"}
+ ];
+}
diff --git a/proto/v1/v1/issue_service.proto b/proto/v1/v1/issue_service.proto
index 141f469cc9..98067dab18 100644
--- a/proto/v1/v1/issue_service.proto
+++ b/proto/v1/v1/issue_service.proto
@@ -368,6 +368,8 @@ message Issue {
GRANT_REQUEST = 2;
// Database data export request.
DATABASE_EXPORT = 3;
+ // Temporary access grant request.
+ ACCESS_GRANT = 4;
}
Type type = 4;
@@ -435,6 +437,13 @@ message Issue {
SKIPPED = 5;
}
ApprovalStatus approval_status = 18 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+ // The access grant associated with this issue.
+ // Format: projects/{project}/accessGrants/{access_grant}
+ string access_grant = 19 [
+ (google.api.field_behavior) = OUTPUT_ONLY,
+ (google.api.resource_reference) = {type: "bytebase.com/AccessGrant"}
+ ];
}
message GrantRequest {