Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
feat(mcp): let MCP sessions turn just-in-time access on or off, and revoke access grants (#21626)
Vincent Huang222f2d39523c
diff --git a/backend/api/auth/mcp_confirmation.go b/backend/api/auth/mcp_confirmation.goindex ae7b4c5b6f..3da9e87511 100644--- a/backend/api/auth/mcp_confirmation.go+++ b/backend/api/auth/mcp_confirmation.go@@ -5,17 +5,20 @@ import ("time")-// MCPConfirmedDecision is one issue decision the user confirmed in their MCP-// client. The MCP gate serves IssueService/ApproveIssue and RejectIssue only to-// a request whose context carries one naming that procedure and issue.+// MCPConfirmedDecision is the user's decision, confirmed in their MCP client, to+// make one write. The MCP gate serves the procedures that need one only to a+// request whose context carries one naming that procedure and the resource the+// request changes.type MCPConfirmedDecision struct {// Procedure is the connect procedure confirmed, such as// /bytebase.v1.IssueService/ApproveIssue.Procedure string- // Issue is the issue's resource name: projects/{project}/issues/{issue}.- Issue string- // IssueUpdateTime is the issue's update time when the user confirmed. The- // review workflow refuses the decision when it no longer matches.+ // Resource is the name of the resource the write changes, such as+ // projects/{project}/issues/{issue}.+ Resource string+ // IssueUpdateTime is, for an issue decision, the issue's update time when the+ // user confirmed. The review workflow refuses the decision when it no longer+ // matches.IssueUpdateTime time.Time}diff --git a/backend/api/mcp/openapi_index_refused_test.go b/backend/api/mcp/openapi_index_refused_test.goindex 4501eeb58e..ff0439b045 100644--- a/backend/api/mcp/openapi_index_refused_test.go+++ b/backend/api/mcp/openapi_index_refused_test.go@@ -53,9 +53,12 @@ func TestRefusedEndpointsAreNotAdvertised(t *testing.T) {})t.Run("a service keeps only the methods a ceiling serves", func(t *testing.T) {- // ProjectService is the mixed case. Its reads are served; its writes- // administer the workspace and TestWebhook posts to a third party, so- // those stay refused and stay unadvertised.+ // ProjectService is the mixed case. Its reads are served. UpdateProject+ // is WRITE, served only through set_just_in_time_access; it stays+ // advertised, like ApproveIssue, so an agent that calls it meets the+ // gate's denial naming that tool. Its other writes administer the+ // workspace and TestWebhook posts to a third party, so those stay+ // refused and unadvertised.var served []stringfor _, ep := range idx.GetServiceEndpoints("ProjectService") {served = append(served, ep.OperationID)@@ -66,6 +69,7 @@ func TestRefusedEndpointsAreNotAdvertised(t *testing.T) {"bytebase.v1.ProjectService.BatchGetProjects","bytebase.v1.ProjectService.SearchProjects","bytebase.v1.ProjectService.GetIamPolicy",+ "bytebase.v1.ProjectService.UpdateProject",}, served)require.Contains(t, idx.Services(), "ProjectService")})diff --git a/backend/api/mcp/server.go b/backend/api/mcp/server.goindex ba09ecff5e..495e8d3a64 100644--- a/backend/api/mcp/server.go+++ b/backend/api/mcp/server.go@@ -236,6 +236,7 @@ func (s *Server) registerTools() {s.registerSchemaTool()s.registerChangeTool()s.registerDecideIssueTool()+ s.registerSetJustInTimeAccessTool()s.registerReauthorizeTool()}diff --git a/backend/api/mcp/tool_confirm.go b/backend/api/mcp/tool_confirm.gonew file mode 100644index 0000000000..282d66e355--- /dev/null+++ b/backend/api/mcp/tool_confirm.go@@ -0,0 +1,198 @@+package mcp++import (+ "bytes"+ "context"+ "crypto/hmac"+ "crypto/sha256"+ "encoding/base64"+ "fmt"+ "strconv"+ "strings"+ "time"++ "github.com/modelcontextprotocol/go-sdk/mcp"+)++// confirmDecisionRequestID is the ID a confirmation is filed under, and+// confirmDecisionField the form field it asks for. The client echoes both back,+// so the two halves of one tool call must agree on them.+const (+ confirmDecisionRequestID = "confirm"+ confirmDecisionField = "confirm"+)++// confirmationStatePurpose names this use of the server secret, so the key+// that signs a confirmation's request state signs nothing else.+const confirmationStatePurpose = "bb.mcp.confirmation.request_state"++// confirmationLifetime bounds how long after asking an answer is acted on. The+// signed state carries no nonce, and a write's digest repeats whenever the same+// write is asked again, so without it an accepted answer could be replayed+// once the write it confirmed became possible again.+const confirmationLifetime = 10 * time.Minute++// confirmableWrite is a write a tool asks the user to confirm before making it.+// The request state is signed for its procedure and resource, so an answer to+// one confirmation cannot be replayed for another.+type confirmableWrite interface {+ confirmedProcedure() string+ confirmedResource() string+}++// canShowConfirmation reports whether the client declared the form a+// confirmation needs. A tool checks it before reading any answer: a client that+// declared no form cannot have shown one, so an answer it sends is not a+// confirmation.+func canShowConfirmation(req *mcp.CallToolRequest) bool {+ return req != nil && req.Session != nil && clientSupportsElicitation(req.Session)+}++// askToConfirm returns the result that asks the user to confirm w. The SDK+// elicits within this tools/call and re-invokes the handler with the answer+// and the request state, the same multi round-trip shape as+// elicitDatabaseChoice. A client on the 2026-07-28 protocol answers and echoes+// the state itself.+func (s *Server) askToConfirm(ctx context.Context, w confirmableWrite, digest []byte, message, title, description string) *mcp.CallToolResult {+ return &mcp.CallToolResult{+ RequestState: s.signConfirmationState(ctx, w, digest, time.Now()),+ InputRequests: mcp.InputRequestMap{+ confirmDecisionRequestID: &mcp.ElicitParams{+ Mode: "form",+ Message: message,+ RequestedSchema: map[string]any{+ "type": "object",+ "properties": map[string]any{+ confirmDecisionField: map[string]any{+ "type": "boolean",+ "title": title,+ "description": description,+ },+ },+ "required": []string{confirmDecisionField},+ },+ },+ },+ }+}++// confirmationAnswer returns the answer and request state a call carries, if+// it answers a confirmation.+func confirmationAnswer(req *mcp.CallToolRequest) (mcp.InputResponse, string, bool) {+ if req.Params == nil {+ return nil, "", false+ }+ response, answered := req.Params.InputResponses[confirmDecisionRequestID]+ return response, req.Params.RequestState, answered+}++// confirmationReply is a call's answer to a confirmation this server sent.+type confirmationReply struct {+ response mcp.InputResponse+ // matches is whether the user was asked about the write the call would make.+ matches bool+ // expired is whether the user was asked longer ago than confirmationLifetime.+ expired bool+}++// signedReply returns the call's answer to a confirmation this server signed+// for this caller and write, and whether it carries one. An answer without such+// a state is no answer: a client can send one on a call that was never asked,+// so the call is asked like a first one.+func (s *Server) signedReply(ctx context.Context, req *mcp.CallToolRequest, w confirmableWrite, digest []byte) (*confirmationReply, bool) {+ response, state, answered := confirmationAnswer(req)+ if !answered {+ return nil, false+ }+ asked, askedAt, signed := s.verifyConfirmationState(ctx, w, state)+ if !signed {+ return nil, false+ }+ return &confirmationReply{+ response: response,+ matches: bytes.Equal(asked, digest),+ expired: time.Since(askedAt) > confirmationLifetime,+ }, true+}++// staleReason says why a confirmed answer cannot be acted on, or "" when it+// can. mismatch is the tool's words for an answer about a different write. An+// expired answer is reported, not asked again: an older client gets one second+// round per call, so a form sent there would go unanswered.+func (r *confirmationReply) staleReason(mismatch string) string {+ switch {+ case r.expired:+ return fmt.Sprintf("the user was asked more than %d minutes ago", int(confirmationLifetime.Minutes()))+ case !r.matches:+ return mismatch+ default:+ return ""+ }+}++// confirmationOutcome reports whether the answer confirms the write, and if+// not, why, in words the result can carry.+func confirmationOutcome(response mcp.InputResponse) (bool, string) {+ elicited, ok := response.(*mcp.ElicitResult)+ if !ok || elicited == nil {+ return false, "the confirmation answer could not be read"+ }+ switch elicited.Action {+ case "accept":+ if confirmed, ok := elicited.Content[confirmDecisionField].(bool); ok && confirmed {+ return true, ""+ }+ return false, "the form was submitted without the confirmation checked"+ case "decline":+ return false, "the user declined"+ case "cancel":+ return false, "the user cancelled"+ default:+ return false, fmt.Sprintf("the confirmation answer %q is not one Bytebase acts on", elicited.Action)+ }+}++// signConfirmationState returns the request state the form is sent with: a+// digest of what the user is asked about and when they were asked, signed+// together with who asks, through which client, and which write on which+// resource.+func (s *Server) signConfirmationState(ctx context.Context, w confirmableWrite, digest []byte, askedAt time.Time) string {+ askedAtUnix := strconv.FormatInt(askedAt.Unix(), 10)+ return base64.RawURLEncoding.EncodeToString(digest) + "." + askedAtUnix + "." ++ base64.RawURLEncoding.EncodeToString(s.confirmationMAC(ctx, w, digest, askedAtUnix))+}++// verifyConfirmationState returns the digest a request state carries, when the+// user was asked, and whether this server signed it for this caller and this+// write.+func (s *Server) verifyConfirmationState(ctx context.Context, w confirmableWrite, state string) ([]byte, time.Time, bool) {+ parts := strings.Split(state, ".")+ if len(parts) != 3 {+ return nil, time.Time{}, false+ }+ digest, err := base64.RawURLEncoding.DecodeString(parts[0])+ if err != nil {+ return nil, time.Time{}, false+ }+ askedAtUnix, err := strconv.ParseInt(parts[1], 10, 64)+ if err != nil {+ return nil, time.Time{}, false+ }+ mac, err := base64.RawURLEncoding.DecodeString(parts[2])+ if err != nil {+ return nil, time.Time{}, false+ }+ if !hmac.Equal(mac, s.confirmationMAC(ctx, w, digest, parts[1])) {+ return nil, time.Time{}, false+ }+ return digest, time.Unix(askedAtUnix, 0), true+}++func (s *Server) confirmationMAC(ctx context.Context, w confirmableWrite, digest []byte, askedAtUnix string) []byte {+ key := hmac.New(sha256.New, []byte(s.secret))+ _, _ = key.Write([]byte(confirmationStatePurpose))+ signed := strings.Join([]string{getWorkspaceID(ctx), getUserEmail(ctx), getOAuth2ClientID(ctx), w.confirmedProcedure(), w.confirmedResource(), askedAtUnix, ""}, "\x00")+ mac := hmac.New(sha256.New, key.Sum(nil))+ _, _ = mac.Write(append([]byte(signed), digest...))+ return mac.Sum(nil)+}diff --git a/backend/api/mcp/tool_decide.go b/backend/api/mcp/tool_decide.goindex 7b9d49ae8e..847e49a28d 100644--- a/backend/api/mcp/tool_decide.go+++ b/backend/api/mcp/tool_decide.go@@ -1,9 +1,7 @@package mcpimport (- "bytes""context"- "crypto/hmac""crypto/sha256""encoding/base64""encoding/json"@@ -58,22 +56,10 @@ The approval rules decide who may approve, as in the console: the user must holdThis is the only way to decide an issue over MCP; call_api refuses IssueService/ApproveIssue and RejectIssue.`-// confirmDecisionRequestID is the ID the confirmation is filed under, and-// confirmDecisionField the form field it asks for. The client echoes both back,-// so the two halves of one tool call must agree on them.-const (- confirmDecisionRequestID = "confirm"- confirmDecisionField = "confirm"-)-// decisionNote opens the comment recorded with every decision. It claims the// client confirmed, not that a person did: a hook in the client can answer.const decisionNote = "Decided over MCP; the decision was confirmed in the MCP client."-// confirmationStatePurpose names this use of the server secret, so the key-// that signs a confirmation's request state signs nothing else.-const confirmationStatePurpose = "bb.mcp.decide_issue.request_state"-const (// maxDescribedSpecs bounds how many plan specs the confirmation lists.maxDescribedSpecs = 3@@ -103,6 +89,10 @@ func (d *issueDecision) verb() string {return "reject"}+func (d *issueDecision) confirmedProcedure() string { return d.procedure }++func (d *issueDecision) confirmedResource() string { return d.issue }+func (d *issueDecision) pastTense() string {if d.procedure == v1connect.IssueServiceApproveIssueProcedure {return "approved"@@ -117,9 +107,7 @@ func (s *Server) handleDecideIssue(ctx context.Context, req *mcp.CallToolRequest}link := s.issueLink(ctx, decision.issue)- // Checked before any answer is read: a client that declared no form cannot- // have shown one, so an answer it sends is not a confirmation.- if req == nil || req.Session == nil || !clientSupportsElicitation(req.Session) {+ if !canShowConfirmation(req) {return formatToolError(&toolError{Code: "CONFIRMATION_UNAVAILABLE",Message: fmt.Sprintf("this MCP client cannot show the confirmation form decide_issue needs, so %s was not %s and nothing changed",@@ -148,44 +136,19 @@ func (s *Server) handleDecideIssue(ctx context.Context, req *mcp.CallToolRequestreturn formatToolError(err), nil, nil}- // An answer counts only with the request state this server signed when it- // asked. A client can send an answer on a call that was never asked, so- // without that state the call is asked like a first one.- if response, state, answered := confirmationAnswer(req); answered {- if asked, signed := s.verifyConfirmationState(ctx, decision, state); signed {- result, output := s.decideOnAnswer(ctx, decision, response, bytes.Equal(asked, digest), issue.UpdateTime, link)- return result, output, nil- }+ if reply, answered := s.signedReply(ctx, req, decision, digest); answered {+ result, output := s.decideOnAnswer(ctx, decision, reply, issue.UpdateTime, link)+ return result, output, nil}message, err := s.describeIssueDecision(ctx, decision, view)if err != nil {return formatToolError(err), nil, nil}- // The same multi round-trip shape as elicitDatabaseChoice: the SDK elicits- // within this tools/call and re-invokes the handler with the answer and the- // request state. A client on the 2026-07-28 protocol answers and echoes the- // state itself.- return &mcp.CallToolResult{- RequestState: s.signConfirmationState(ctx, decision, digest),- InputRequests: mcp.InputRequestMap{- confirmDecisionRequestID: &mcp.ElicitParams{- Mode: "form",- Message: message,- RequestedSchema: map[string]any{- "type": "object",- "properties": map[string]any{- confirmDecisionField: map[string]any{- "type": "boolean",- "title": fmt.Sprintf("%s this issue", capitalize(decision.verb())),- "description": fmt.Sprintf("Check to %s the issue described above. Leaving it unchecked, declining or cancelling changes nothing.", decision.verb()),- },- },- "required": []string{confirmDecisionField},- },- },- },- }, nil, nil+ return s.askToConfirm(ctx, decision, digest, message,+ fmt.Sprintf("%s this issue", capitalize(decision.verb())),+ fmt.Sprintf("Check to %s the issue described above. Leaving it unchecked, declining or cancelling changes nothing.", decision.verb()),+ ), nil, nil}func parseIssueDecision(input DecideIssueInput) (*issueDecision, error) {@@ -259,72 +222,26 @@ func (s *Server) recordRefusedDecision(ctx context.Context, decision *issueDecisaudit.RecordOutOfBandAudit(ctx, s.store, s.profile.RuntimeEnableAuditLogStdout.Load(), getWorkspaceID(ctx), row)}-// confirmationAnswer returns the answer and the request state this call-// carries, if it carries an answer.-func confirmationAnswer(req *mcp.CallToolRequest) (mcp.InputResponse, string, bool) {- if req.Params == nil {- return nil, "", false- }- response, answered := req.Params.InputResponses[confirmDecisionRequestID]- return response, req.Params.RequestState, answered-}-// decideOnAnswer acts on the answer to a form this server sent. Only an// accepted form with the box checked decides, and only while what the user// was asked about still matches the issue. A decline is reported before a// change, so a user who said no is not asked again.-func (s *Server) decideOnAnswer(ctx context.Context, decision *issueDecision, response mcp.InputResponse, unchanged bool, issueUpdateTime, link string) (*mcp.CallToolResult, any) {- if confirmed, why := confirmationOutcome(response); !confirmed {+func (s *Server) decideOnAnswer(ctx context.Context, decision *issueDecision, reply *confirmationReply, issueUpdateTime, link string) (*mcp.CallToolResult, any) {+ if confirmed, why := confirmationOutcome(reply.response); !confirmed {return &mcp.CallToolResult{Content: []mcp.Content{&mcp.TextContent{Text: fmt.Sprintf("Not %s: %s, so nothing changed. Do not retry unless the user asks.\nIssue: %s",decision.pastTense(), why, link)}}}, nil}- if !unchanged {+ if why := reply.staleReason(fmt.Sprintf("what the user confirmed no longer matches %s as it is now", decision.issue)); why != "" {return formatToolError(&toolError{- Code: "STALE_CONFIRMATION",- Message: fmt.Sprintf("what the user confirmed no longer matches %s as it is now, so it was not %s and nothing changed",- decision.issue, decision.pastTense()),+ Code: "STALE_CONFIRMATION",+ Message: fmt.Sprintf("%s, so it was not %s and nothing changed", why, decision.pastTense()),Suggestion: "call decide_issue again to ask the user about the issue as it is now",}), nil}return s.applyIssueDecision(ctx, decision, issueUpdateTime, link)}-// signConfirmationState returns the request state the form is sent with: a-// digest of what the user is asked about, signed together with who asks,-// through which client, and which decision on which issue.-func (s *Server) signConfirmationState(ctx context.Context, decision *issueDecision, digest []byte) string {- return base64.RawURLEncoding.EncodeToString(digest) + "." +- base64.RawURLEncoding.EncodeToString(s.confirmationMAC(ctx, decision, digest))-}--// verifyConfirmationState returns the digest a request state carries, and-// whether this server signed it for this caller and this decision.-func (s *Server) verifyConfirmationState(ctx context.Context, decision *issueDecision, state string) ([]byte, bool) {- encodedDigest, encodedMAC, found := strings.Cut(state, ".")- if !found {- return nil, false- }- digest, err := base64.RawURLEncoding.DecodeString(encodedDigest)- if err != nil {- return nil, false- }- mac, err := base64.RawURLEncoding.DecodeString(encodedMAC)- if err != nil {- return nil, false- }- return digest, hmac.Equal(mac, s.confirmationMAC(ctx, decision, digest))-}--func (s *Server) confirmationMAC(ctx context.Context, decision *issueDecision, digest []byte) []byte {- key := hmac.New(sha256.New, []byte(s.secret))- _, _ = key.Write([]byte(confirmationStatePurpose))- signed := strings.Join([]string{getWorkspaceID(ctx), getUserEmail(ctx), getOAuth2ClientID(ctx), decision.procedure, decision.issue, ""}, "\x00")- mac := hmac.New(sha256.New, key.Sum(nil))- _, _ = mac.Write(append([]byte(signed), digest...))- return mac.Sum(nil)-}-// applyIssueDecision records the confirmed decision.func (s *Server) applyIssueDecision(ctx context.Context, decision *issueDecision, issueUpdateTime, link string) (*mcp.CallToolResult, any) {confirmedAt, err := time.Parse(time.RFC3339Nano, issueUpdateTime)@@ -337,7 +254,7 @@ func (s *Server) applyIssueDecision(ctx context.Context, decision *issueDecision}confirmedCtx := auth.WithMCPConfirmedDecision(ctx, auth.MCPConfirmedDecision{Procedure: decision.procedure,- Issue: decision.issue,+ Resource: decision.issue,IssueUpdateTime: confirmedAt,})resp, err := s.apiRequest(confirmedCtx, decision.procedure, map[string]any{@@ -368,28 +285,6 @@ func (s *Server) applyIssueDecision(ctx context.Context, decision *issueDecisioncapitalize(decision.pastTense()), decision.issue, describeApprovalStep(decided), decided.Status, link)}}}, output}-// confirmationOutcome reports whether the answer confirms the decision, and if-// not, why, in words the result can carry.-func confirmationOutcome(response mcp.InputResponse) (bool, string) {- elicited, ok := response.(*mcp.ElicitResult)- if !ok || elicited == nil {- return false, "the confirmation answer could not be read"- }- switch elicited.Action {- case "accept":- if confirmed, ok := elicited.Content[confirmDecisionField].(bool); ok && confirmed {- return true, ""- }- return false, "the form was submitted without the confirmation checked"- case "decline":- return false, "the user declined"- case "cancel":- return false, "the user cancelled"- default:- return false, fmt.Sprintf("the confirmation answer %q is not one Bytebase acts on", elicited.Action)- }-}-// issueView is the part of an Issue the confirmation and the result read.type issueView struct {Name string `json:"name"`diff --git a/backend/api/mcp/tool_decide_test.go b/backend/api/mcp/tool_decide_test.goindex 0f78cda9e5..48f78488e2 100644--- a/backend/api/mcp/tool_decide_test.go+++ b/backend/api/mcp/tool_decide_test.go@@ -254,7 +254,7 @@ func TestDecideIssueApprovesOnConfirmation(t *testing.T) {"the comment must record that the decision was confirmed in the client")require.Equal(t, &auth.MCPConfirmedDecision{Procedure: v1connect.IssueServiceApproveIssueProcedure,- Issue: decideIssueName,+ Resource: decideIssueName,IssueUpdateTime: time.Date(2026, 10, 13, 8, 0, 0, 123456000, time.UTC),}, calls[0].confirmed, "the approval must carry the confirmation the gate admits it on, and the issue version it applies to")@@ -281,7 +281,7 @@ func TestDecideIssueRejectsOnConfirmation(t *testing.T) {require.Equal(t, v1connect.IssueServiceRejectIssueProcedure, calls[0].path)require.Equal(t, &auth.MCPConfirmedDecision{Procedure: v1connect.IssueServiceRejectIssueProcedure,- Issue: decideIssueName,+ Resource: decideIssueName,IssueUpdateTime: time.Date(2026, 10, 13, 8, 0, 0, 123456000, time.UTC),}, calls[0].confirmed)}@@ -436,14 +436,17 @@ func TestConfirmationStateIsBoundToTheCallerAndTheDecision(t *testing.T) {alice := caller("ws-test", "[email protected]", "client-A")approve := &issueDecision{issue: decideIssueName, procedure: v1connect.IssueServiceApproveIssueProcedure}digest := sha256.Sum256([]byte("what the form was built from"))- state := s.signConfirmationState(alice, approve, digest[:])+ askedAt := time.Date(2026, 10, 20, 9, 0, 0, 0, time.UTC)+ state := s.signConfirmationState(alice, approve, digest[:], askedAt)- signedDigest, signed := s.verifyConfirmationState(alice, approve, state)+ signedDigest, signedAt, signed := s.verifyConfirmationState(alice, approve, state)require.True(t, signed)require.Equal(t, digest[:], signedDigest)+ require.True(t, askedAt.Equal(signedAt))otherDigest := sha256.Sum256([]byte("something else"))- _, mac, _ := strings.Cut(state, ".")+ parts := strings.Split(state, ".")+ require.Len(t, parts, 3)for name, tc := range map[string]struct {ctx context.Contextdecision *issueDecision@@ -454,14 +457,40 @@ func TestConfirmationStateIsBoundToTheCallerAndTheDecision(t *testing.T) {"another workspace": {caller("ws-other", "[email protected]", "client-A"), approve, state},"the other decision": {alice, &issueDecision{issue: decideIssueName, procedure: v1connect.IssueServiceRejectIssueProcedure}, state},"another issue": {alice, &issueDecision{issue: "projects/hr/issues/43", procedure: v1connect.IssueServiceApproveIssueProcedure}, state},- "another digest": {alice, approve, base64.RawURLEncoding.EncodeToString(otherDigest[:]) + "." + mac},- "no signature": {alice, approve, base64.RawURLEncoding.EncodeToString(digest[:])},+ "another digest": {alice, approve, base64.RawURLEncoding.EncodeToString(otherDigest[:]) + "." + parts[1] + "." + parts[2]},+ "a later time": {alice, approve, parts[0] + "." + strconv.FormatInt(askedAt.Add(time.Hour).Unix(), 10) + "." + parts[2]},+ "no signature": {alice, approve, parts[0] + "." + parts[1]},} {- _, signed := s.verifyConfirmationState(tc.ctx, tc.decision, tc.state)+ _, _, signed := s.verifyConfirmationState(tc.ctx, tc.decision, tc.state)require.False(t, signed, name)}}+func TestDecideIssueRefusesAnExpiredConfirmation(t *testing.T) {+ mock := changeIssueMock()+ call := newDecideMRTRServer(t, mock)+ accept := mcp.InputResponseMap{confirmDecisionRequestID: confirmAnswer(true)}++ first := call(nil, "", "checked the statement")+ require.True(t, first.NeedsInput())+ parts := strings.Split(first.RequestState, ".")+ require.Len(t, parts, 3)+ // Rebuild the state as the server would have signed it eleven minutes ago.+ s, err := newServerWithStore(newTestServerStore(), &config.Profile{Mode: common.ReleaseModeDev}, revalidationSecret, mock)+ require.NoError(t, err)+ digest, err := base64.RawURLEncoding.DecodeString(parts[0])+ require.NoError(t, err)+ alice := withOAuth2ClientID(withUserEmail(withWorkspaceID(context.Background(), "ws-test"), "[email protected]"), "client-A")+ approve := &issueDecision{issue: decideIssueName, procedure: v1connect.IssueServiceApproveIssueProcedure}+ old := s.signConfirmationState(alice, approve, digest, time.Now().Add(-11*time.Minute))++ expired := call(accept, old, "checked the statement")+ require.True(t, expired.IsError, resultText(t, expired))+ require.Contains(t, resultText(t, expired), "STALE_CONFIRMATION")+ require.Contains(t, resultText(t, expired), "the user was asked more than 10 minutes ago")+ require.Empty(t, mock.calls(), "an accepted answer older than the lifetime must not decide")+}+// threeStepIssueMock is a database change waiting on the second of three steps.func threeStepIssueMock() *decisionMock {mock := changeIssueMock()@@ -1127,7 +1156,7 @@ func TestConfirmationReachesTheConnectInterceptors(t *testing.T) {want := auth.MCPConfirmedDecision{Procedure: v1connect.IssueServiceApproveIssueProcedure,- Issue: decideIssueName,+ Resource: decideIssueName,IssueUpdateTime: time.Date(2026, 10, 13, 8, 0, 0, 123456000, time.UTC),}resp, err := s.apiRequest(auth.WithMCPConfirmedDecision(context.Background(), want),diff --git a/backend/api/mcp/tool_jit.go b/backend/api/mcp/tool_jit.gonew file mode 100644index 0000000000..a726e22e92--- /dev/null+++ b/backend/api/mcp/tool_jit.go@@ -0,0 +1,194 @@+package mcp++import (+ "context"+ "crypto/sha256"+ "encoding/json"+ "fmt"+ "strings"++ "github.com/modelcontextprotocol/go-sdk/mcp"+ "github.com/pkg/errors"++ "github.com/bytebase/bytebase/backend/api/auth"+ "github.com/bytebase/bytebase/backend/common"+ "github.com/bytebase/bytebase/backend/generated-go/v1/v1connect"+ "github.com/bytebase/bytebase/backend/utils"+)++// SetJustInTimeAccessInput is the input for the set_just_in_time_access tool.+type SetJustInTimeAccessInput struct {+ Project string `json:"project"`+ Enabled bool `json:"enabled"`+}++// SetJustInTimeAccessOutput is the output for the set_just_in_time_access tool.+type SetJustInTimeAccessOutput struct {+ Project string `json:"project"`+ Enabled bool `json:"enabled"`+ Changed bool `json:"changed"`+ Link string `json:"link"`+}++const setJustInTimeAccessDescription = `Turn just-in-time access on or off for one Bytebase project. The user confirms the change in this client first.++| Parameter | Required | Description |+|-----------|----------|-------------|+| project | Yes | Project name, e.g. "projects/hr" |+| enabled | Yes | true to turn it on, false to turn it off |++Just-in-time access lets members request access grants in the project: time-boxed permission to run one statement, for a one-off query. With it off, new requests are refused, and active grants stop applying until it is turned on again; they are not revoked.++The tool shows the user the change and asks them to confirm in a form. It changes the setting only when they accept; declining or cancelling changes nothing. A client that cannot show the form gets the project's settings link, to change it in the Bytebase console instead. Do not ask in chat first: the form is the question.++Changing it needs bb.projects.update, as in the console. This is the only way to change it over MCP; call_api refuses ProjectService/UpdateProject.`++func (s *Server) registerSetJustInTimeAccessTool() {+ mcp.AddTool(s.mcpServer, &mcp.Tool{+ Name: "set_just_in_time_access",+ Description: setJustInTimeAccessDescription,+ }, s.handleSetJustInTimeAccess)+}++// justInTimeChange is a validated set_just_in_time_access request.+type justInTimeChange struct {+ project string+ enabled bool+}++func (*justInTimeChange) confirmedProcedure() string {+ return v1connect.ProjectServiceUpdateProjectProcedure+}++func (c *justInTimeChange) confirmedResource() string { return c.project }++func (c *justInTimeChange) state() string {+ if c.enabled {+ return "on"+ }+ return "off"+}++// body is the UpdateProject request the user is asked to confirm. Its digest+// binds the answer to these arguments.+func (c *justInTimeChange) body() map[string]any {+ return map[string]any{+ "project": map[string]any{"name": c.project, "allowJustInTimeAccess": c.enabled},+ "updateMask": "allowJustInTimeAccess",+ }+}++func parseJustInTimeChange(input SetJustInTimeAccessInput) (*justInTimeChange, error) {+ if _, err := common.GetProjectID(input.Project); err != nil {+ return nil, &toolError{+ Code: "INVALID_ARGUMENT",+ Message: fmt.Sprintf("invalid project %q", input.Project),+ Suggestion: "pass the project name, e.g. projects/hr",+ }+ }+ return &justInTimeChange{project: input.Project, enabled: input.Enabled}, nil+}++// projectView is the part of a Project the tool reads.+type projectView struct {+ AllowJustInTimeAccess bool `json:"allowJustInTimeAccess"`+}++func (s *Server) handleSetJustInTimeAccess(ctx context.Context, req *mcp.CallToolRequest, input SetJustInTimeAccessInput) (*mcp.CallToolResult, any, error) {+ change, err := parseJustInTimeChange(input)+ if err != nil {+ return formatToolError(err), nil, nil+ }+ link := s.projectSettingsLink(ctx, change.project)++ // Read on both rounds: a project already in the requested state, before+ // asking or by the time the answer comes back, needs no write.+ var project projectView+ if err := s.readResource(ctx, "/bytebase.v1.ProjectService/GetProject", change.project, "get projects", "bb.projects.get", &project); err != nil {+ return formatToolError(err), nil, nil+ }+ if project.AllowJustInTimeAccess == change.enabled {+ return &mcp.CallToolResult{Content: []mcp.Content{&mcp.TextContent{Text: fmt.Sprintf(+ "Just-in-time access is already %s in %s, so nothing changed.\nProject settings: %s", change.state(), change.project, link)}}},+ &SetJustInTimeAccessOutput{Project: change.project, Enabled: change.enabled, Link: link}, nil+ }+ if !canShowConfirmation(req) {+ return formatToolError(&toolError{+ Code: "CONFIRMATION_UNAVAILABLE",+ Message: fmt.Sprintf("this MCP client cannot show the confirmation form set_just_in_time_access needs, so just-in-time access in %s was not turned %s and nothing changed",+ change.project, change.state()),+ Suggestion: "change it signed in to the Bytebase console: " + link,+ }), nil, nil+ }+ body, err := json.Marshal(change.body())+ if err != nil {+ return formatToolError(errors.Wrap(err, "failed to build the update")), nil, nil+ }+ digest := sha256.Sum256(body)+ if reply, answered := s.signedReply(ctx, req, change, digest[:]); answered {+ result, output := s.setJustInTimeAccessOnAnswer(ctx, change, reply, link)+ return result, output, nil+ }++ verb := "Turn " + change.state()+ return s.askToConfirm(ctx, change, digest[:], describeJustInTimeChange(ctx, change),+ verb+" just-in-time access",+ fmt.Sprintf("Check to turn %s just-in-time access in the project above. Leaving it unchecked, declining or cancelling changes nothing.", change.state()),+ ), nil, nil+}++// describeJustInTimeChange builds the confirmation message. The project ID has+// a line of its own: a resource ID is at most 63 characters, so "Project:" and+// the quoted ID fit the 74 columns Claude Code shows of a line in an 80-column+// terminal, and two IDs that differ only at the end stay distinguishable. It+// enters through %q, so it cannot pose as a line of the message.+func describeJustInTimeChange(ctx context.Context, change *justInTimeChange) string {+ question := fmt.Sprintf("Turn %s just-in-time access", change.state())+ if email := getUserEmail(ctx); email != "" {+ question += " as " + email+ }+ projectID, _ := common.GetProjectID(change.project)+ effect := "Active grants that have not expired apply again at once."+ if !change.enabled {+ effect = "Active grants here stop applying (not revoked); new requests are refused."+ }+ return strings.Join([]string{question + "?", fmt.Sprintf("Project: %q", projectID), effect}, "\n")+}++// setJustInTimeAccessOnAnswer acts on the answer to a form this server sent. A+// decline is reported before a change, so a user who said no is not asked again.+func (s *Server) setJustInTimeAccessOnAnswer(ctx context.Context, change *justInTimeChange, reply *confirmationReply, link string) (*mcp.CallToolResult, any) {+ if confirmed, why := confirmationOutcome(reply.response); !confirmed {+ return &mcp.CallToolResult{Content: []mcp.Content{&mcp.TextContent{Text: fmt.Sprintf(+ "Just-in-time access in %s was not turned %s: %s, so nothing changed. Do not retry unless the user asks.\nProject settings: %s",+ change.project, change.state(), why, link)}}}, nil+ }+ if why := reply.staleReason("what the user confirmed does not match this call"); why != "" {+ return formatToolError(&toolError{+ Code: "STALE_CONFIRMATION",+ Message: fmt.Sprintf("%s, so just-in-time access in %s was not turned %s and nothing changed",+ why, change.project, change.state()),+ Suggestion: "call set_just_in_time_access again to ask the user about this change",+ }), nil+ }+ confirmedCtx := auth.WithMCPConfirmedDecision(ctx, auth.MCPConfirmedDecision{+ Procedure: change.confirmedProcedure(),+ Resource: change.project,+ })+ resp, err := s.apiRequest(confirmedCtx, change.confirmedProcedure(), change.body())+ if err != nil {+ return formatToolError(errors.Wrapf(err, "failed to turn %s just-in-time access in %s", change.state(), change.project)), nil+ }+ if resp.Status >= 400 {+ return formatToolError(errors.Errorf("failed to turn %s just-in-time access in %s: HTTP %d: %s",+ change.state(), change.project, resp.Status, parseError(resp.Body))), nil+ }+ return &mcp.CallToolResult{Content: []mcp.Content{&mcp.TextContent{Text: fmt.Sprintf(+ "Turned %s just-in-time access in %s.\nProject settings: %s", change.state(), change.project, link)}}},+ &SetJustInTimeAccessOutput{Project: change.project, Enabled: change.enabled, Changed: true, Link: link}+}++func (s *Server) projectSettingsLink(ctx context.Context, project string) string {+ externalURL, _ := utils.GetEffectiveExternalURL(ctx, s.store, s.profile, getWorkspaceID(ctx))+ return buildResourceURL(externalURL, project) + "/settings"+}diff --git a/backend/api/mcp/tool_jit_test.go b/backend/api/mcp/tool_jit_test.gonew file mode 100644index 0000000000..b1c4eae26d--- /dev/null+++ b/backend/api/mcp/tool_jit_test.go@@ -0,0 +1,328 @@+package mcp++import (+ "context"+ "encoding/json"+ "fmt"+ "net/http"+ "net/http/httptest"+ "strings"+ "sync"+ "testing"+ "time"++ "github.com/labstack/echo/v5"+ "github.com/modelcontextprotocol/go-sdk/mcp"+ "github.com/stretchr/testify/require"++ "github.com/bytebase/bytebase/backend/api/auth"+ "github.com/bytebase/bytebase/backend/common"+ "github.com/bytebase/bytebase/backend/component/config"+ "github.com/bytebase/bytebase/backend/generated-go/v1/v1connect"+)++// projectMock is the internal API behind set_just_in_time_access: the project+// read, and the update, recorded with the confirmation its context carried.+type projectMock struct {+ mu sync.Mutex+ enabled bool+ // refusal, when set, is the message the update is refused with.+ refusal string+ updates []decisionCall+}++func (m *projectMock) ServeHTTP(w http.ResponseWriter, r *http.Request) {+ w.Header().Set("Content-Type", "application/json")+ reply := func(v any) { _ = json.NewEncoder(w).Encode(v) }+ switch r.URL.Path {+ case "/bytebase.v1.ProjectService/GetProject":+ m.mu.Lock()+ enabled := m.enabled+ m.mu.Unlock()+ reply(map[string]any{"name": "projects/hr", "allowJustInTimeAccess": enabled})+ case v1connect.ProjectServiceUpdateProjectProcedure:+ call := decisionCall{path: r.URL.Path}+ _ = json.NewDecoder(r.Body).Decode(&call.body)+ if confirmed, ok := auth.MCPConfirmedDecisionFromContext(r.Context()); ok {+ call.confirmed = &confirmed+ }+ m.mu.Lock()+ m.updates = append(m.updates, call)+ refusal := m.refusal+ m.mu.Unlock()+ if refusal != "" {+ w.WriteHeader(http.StatusForbidden)+ reply(map[string]any{"code": "permission_denied", "message": refusal})+ return+ }+ reply(map[string]any{"name": "projects/hr"})+ default:+ w.WriteHeader(http.StatusNotFound)+ }+}++func (m *projectMock) calls() []decisionCall {+ m.mu.Lock()+ defer m.mu.Unlock()+ return append([]decisionCall(nil), m.updates...)+}++func (m *projectMock) set(enabled bool) {+ m.mu.Lock()+ defer m.mu.Unlock()+ m.enabled = enabled+}++func newProjectServer(t *testing.T, mock *projectMock) *Server {+ t.Helper()+ profile := &config.Profile{Mode: common.ReleaseModeDev, ExternalURL: "https://bb.example.com"}+ s, err := newServerWithStore(newTestServerStore(), profile, revalidationSecret, mock)+ require.NoError(t, err)+ return s+}++func connectToProjectServer(t *testing.T, mock *projectMock, opts *mcp.ClientOptions) *mcp.ClientSession {+ t.Helper()+ s := newProjectServer(t, mock)+ e := echo.New()+ s.RegisterRoutes(e)+ ts := httptest.NewServer(e)+ t.Cleanup(ts.Close)+ token := mintMCPToken(t, "[email protected]", "client-A", "ws-test", "mcp:read-write", time.Hour)+ return connectLegacy(t, ts.URL+mcpResourcePath, token, opts)+}++func callSetJustInTimeAccess(t *testing.T, session *mcp.ClientSession, enabled bool) *mcp.CallToolResult {+ t.Helper()+ ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second)+ defer cancel()+ res, err := session.CallTool(ctx, &mcp.CallToolParams{+ Name: "set_just_in_time_access",+ Arguments: map[string]any{"project": "projects/hr", "enabled": enabled},+ })+ require.NoError(t, err)+ return res+}++func TestSetJustInTimeAccessTurnsItOnOnConfirmation(t *testing.T) {+ mock := &projectMock{}+ user := &asker{answer: confirmAnswer(true)}+ session := connectToProjectServer(t, mock, &mcp.ClientOptions{ElicitationHandler: user.handle})++ res := callSetJustInTimeAccess(t, session, true)+ require.False(t, res.IsError, resultText(t, res))+ require.Equal(t, int32(1), user.asked.Load())+ asked := user.lastParams(t)+ require.Equal(t, strings.Join([]string{+ `Turn on just-in-time access as [email protected]?`,+ `Project: "hr"`,+ `Active grants that have not expired apply again at once.`,+ }, "\n"), asked.Message)+ schema, err := json.Marshal(asked.RequestedSchema)+ require.NoError(t, err)+ require.JSONEq(t, `{"type":"object","required":["confirm"],"properties":{"confirm":{"type":"boolean",+ "title":"Turn on just-in-time access",+ "description":"Check to turn on just-in-time access in the project above. Leaving it unchecked, declining or cancelling changes nothing."}}}`,+ string(schema))++ calls := mock.calls()+ require.Len(t, calls, 1)+ require.Equal(t, map[string]any{+ "project": map[string]any{"name": "projects/hr", "allowJustInTimeAccess": true},+ "updateMask": "allowJustInTimeAccess",+ }, calls[0].body, "the update must change that one setting")+ require.Equal(t, &auth.MCPConfirmedDecision{+ Procedure: v1connect.ProjectServiceUpdateProjectProcedure,+ Resource: "projects/hr",+ }, calls[0].confirmed, "the update must carry the confirmation the gate admits it on")+ require.Contains(t, resultText(t, res), "Turned on just-in-time access in projects/hr.\nProject settings: https://bb.example.com/projects/hr/settings")+ output, err := json.Marshal(res.StructuredContent)+ require.NoError(t, err)+ require.JSONEq(t, `{"project":"projects/hr","enabled":true,"changed":true,"link":"https://bb.example.com/projects/hr/settings"}`, string(output))+}++func TestSetJustInTimeAccessSaysWhatTurningItOffDoes(t *testing.T) {+ mock := &projectMock{enabled: true}+ user := &asker{answer: confirmAnswer(true)}+ session := connectToProjectServer(t, mock, &mcp.ClientOptions{ElicitationHandler: user.handle})++ res := callSetJustInTimeAccess(t, session, false)+ require.False(t, res.IsError, resultText(t, res))+ require.Equal(t, strings.Join([]string{+ `Turn off just-in-time access as [email protected]?`,+ `Project: "hr"`,+ `Active grants here stop applying (not revoked); new requests are refused.`,+ }, "\n"), user.lastParams(t).Message)+ calls := mock.calls()+ require.Len(t, calls, 1)+ require.Equal(t, false, calls[0].body["project"].(map[string]any)["allowJustInTimeAccess"])+}++func TestSetJustInTimeAccessAsksNothingWhenAlreadySet(t *testing.T) {+ mock := &projectMock{enabled: true}+ user := &asker{answer: confirmAnswer(true)}+ session := connectToProjectServer(t, mock, &mcp.ClientOptions{ElicitationHandler: user.handle})++ res := callSetJustInTimeAccess(t, session, true)+ require.False(t, res.IsError, resultText(t, res))+ require.Contains(t, resultText(t, res), "Just-in-time access is already on in projects/hr, so nothing changed.")+ require.Zero(t, user.asked.Load())+ require.Empty(t, mock.calls())+}++func TestSetJustInTimeAccessReportsASettingChangedWhileAsking(t *testing.T) {+ mock := &projectMock{}+ user := &asker{answer: confirmAnswer(true), whileAsked: func() { mock.set(true) }}+ session := connectToProjectServer(t, mock, &mcp.ClientOptions{ElicitationHandler: user.handle})++ res := callSetJustInTimeAccess(t, session, true)+ require.False(t, res.IsError, resultText(t, res))+ require.Contains(t, resultText(t, res), "already on in projects/hr, so nothing changed")+ require.Empty(t, mock.calls())+}++func TestSetJustInTimeAccessChangesNothingUnlessConfirmed(t *testing.T) {+ for name, tc := range map[string]struct {+ answer *mcp.ElicitResult+ want string+ }{+ "declined": {&mcp.ElicitResult{Action: "decline"}, "the user declined"},+ "cancelled": {&mcp.ElicitResult{Action: "cancel"}, "the user cancelled"},+ "accepted, unticked": {confirmAnswer(false), "the form was submitted without the confirmation checked"},+ } {+ t.Run(name, func(t *testing.T) {+ mock := &projectMock{}+ user := &asker{answer: tc.answer}+ session := connectToProjectServer(t, mock, &mcp.ClientOptions{ElicitationHandler: user.handle})++ res := callSetJustInTimeAccess(t, session, true)+ require.False(t, res.IsError, resultText(t, res))+ require.Contains(t, resultText(t, res), "was not turned on: "+tc.want+", so nothing changed")+ require.Empty(t, mock.calls())+ })+ }+}++func TestSetJustInTimeAccessRefusesAClientThatCannotConfirm(t *testing.T) {+ mock := &projectMock{}+ session := connectToProjectServer(t, mock, nil)++ res := callSetJustInTimeAccess(t, session, true)+ require.True(t, res.IsError)+ text := resultText(t, res)+ require.Contains(t, text, "CONFIRMATION_UNAVAILABLE")+ require.Contains(t, text, "change it signed in to the Bytebase console: https://bb.example.com/projects/hr/settings")+ require.Empty(t, mock.calls())+}++func TestSetJustInTimeAccessReportsTheRefusalInTheServersWords(t *testing.T) {+ mock := &projectMock{refusal: "permission denied: bb.projects.update"}+ session := connectToProjectServer(t, mock, &mcp.ClientOptions{ElicitationHandler: (&asker{answer: confirmAnswer(true)}).handle})++ res := callSetJustInTimeAccess(t, session, true)+ require.True(t, res.IsError)+ text := resultText(t, res)+ require.Contains(t, text, "failed to turn on just-in-time access in projects/hr: HTTP 403: permission denied: bb.projects.update")+ require.NotContains(t, text, "Turned on")+ require.Nil(t, res.StructuredContent)+ require.Len(t, mock.calls(), 1)+}++func TestSetJustInTimeAccessTellsAClientThatCannotConfirmWhenNothingIsNeeded(t *testing.T) {+ mock := &projectMock{enabled: true}+ session := connectToProjectServer(t, mock, nil)++ res := callSetJustInTimeAccess(t, session, true)+ require.False(t, res.IsError, resultText(t, res))+ require.Contains(t, resultText(t, res), "already on in projects/hr, so nothing changed")+ require.Empty(t, mock.calls())+}++func TestSetJustInTimeAccessRefusesAnUnaskedAnswerFromAClientThatCannotConfirm(t *testing.T) {+ mock := &projectMock{}+ session := connectToProjectServer(t, mock, nil)++ ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second)+ defer cancel()+ res, err := session.CallTool(ctx, &mcp.CallToolParams{+ Name: "set_just_in_time_access",+ Arguments: map[string]any{"project": "projects/hr", "enabled": true},+ InputResponses: mcp.InputResponseMap{confirmDecisionRequestID: confirmAnswer(true)},+ })+ require.NoError(t, err)+ require.True(t, res.IsError)+ require.Contains(t, resultText(t, res), "CONFIRMATION_UNAVAILABLE")+ require.Empty(t, mock.calls())+}++func TestSetJustInTimeAccessBindsTheAnswerToTheArguments(t *testing.T) {+ mock := &projectMock{}+ s := newProjectServer(t, mock)+ token := mintMCPToken(t, "[email protected]", "client-A", "ws-test", "mcp:read-write", time.Hour)+ session := connectMRTR(t, mrtrEndpoint(t, s), token)+ call := func(project string, enabled bool, responses mcp.InputResponseMap, state string) *mcp.CallToolResult {+ ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second)+ defer cancel()+ res, err := session.CallTool(ctx, &mcp.CallToolParams{+ Name: "set_just_in_time_access",+ Arguments: map[string]any{"project": project, "enabled": enabled},+ InputResponses: responses,+ RequestState: state,+ })+ require.NoError(t, err)+ return res+ }+ accept := mcp.InputResponseMap{confirmDecisionRequestID: confirmAnswer(true)}++ first := call("projects/hr", true, nil, "")+ require.True(t, first.NeedsInput())++ mock.set(true)+ flipped := call("projects/hr", false, accept, first.RequestState)+ require.True(t, flipped.IsError, resultText(t, flipped))+ require.Contains(t, resultText(t, flipped), "STALE_CONFIRMATION", "an answer resent with the other value is not what the user confirmed")++ mock.set(false)+ elsewhere := call("projects/finance", true, accept, first.RequestState)+ require.True(t, elsewhere.NeedsInput(), "an answer for another project is asked again")+ require.Empty(t, mock.calls())+}++func TestSetJustInTimeAccessRefusesAnInvalidProject(t *testing.T) {+ mock := &projectMock{}+ session := connectToProjectServer(t, mock, &mcp.ClientOptions{ElicitationHandler: (&asker{answer: confirmAnswer(true)}).handle})+ ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second)+ defer cancel()+ for _, project := range []string{"hr", "projects/hr/issues/1", ""} {+ res, err := session.CallTool(ctx, &mcp.CallToolParams{+ Name: "set_just_in_time_access",+ Arguments: map[string]any{"project": project, "enabled": true},+ })+ require.NoError(t, err)+ require.True(t, res.IsError, project)+ require.Contains(t, resultText(t, res), "INVALID_ARGUMENT", project)+ }+ require.Empty(t, mock.calls())+}++func TestSetJustInTimeAccessFormShowsTheChangeInClaudeCodesDialog(t *testing.T) {+ ctx := withUserEmail(context.Background(), "[email protected]")+ longestID := strings.Repeat("p", 63)+ for _, enabled := range []bool{true, false} {+ for _, columns := range []int{80, 120} {+ t.Run(fmt.Sprintf("enabled %v at %d columns", enabled, columns), func(t *testing.T) {+ change := &justInTimeChange{project: "projects/" + longestID, enabled: enabled}+ view := claudeCodeView(describeJustInTimeChange(ctx, change), columns)+ require.Len(t, view, 3, "%q", view)+ require.True(t, strings.HasPrefix(view[0], fmt.Sprintf("Turn %s just-in-time access", change.state())), "%q", view)+ require.Equal(t, fmt.Sprintf("Project: %q", longestID), view[1], "the longest project ID shows whole")+ require.True(t, strings.HasPrefix(view[2], "Active grants"), "the effect: %q", view)+ require.NotContains(t, view[2], "…", "the effect line must fit whole: %q", view)++ west := claudeCodeView(describeJustInTimeChange(ctx, &justInTimeChange{project: "projects/production-analytics-platform-west", enabled: enabled}), columns)+ east := claudeCodeView(describeJustInTimeChange(ctx, &justInTimeChange{project: "projects/production-analytics-platform-east", enabled: enabled}), columns)+ require.NotEqual(t, west, east, "two projects that differ only at the end must not look the same")+ })+ }+ }+}diff --git a/backend/api/v1/issue_review_test.go b/backend/api/v1/issue_review_test.goindex bf1c3bf80a..b12bfbeece 100644--- a/backend/api/v1/issue_review_test.go+++ b/backend/api/v1/issue_review_test.go@@ -77,7 +77,7 @@ func TestConfirmedUpdateTimeComesFromTheMCPConfirmation(t *testing.T) {at := time.Date(2026, 10, 13, 8, 0, 0, 123456000, time.UTC)ctx := auth.WithMCPConfirmedDecision(context.Background(), auth.MCPConfirmedDecision{Procedure: v1connect.IssueServiceApproveIssueProcedure,- Issue: "projects/hr/issues/42",+ Resource: "projects/hr/issues/42",IssueUpdateTime: at,})require.Equal(t, &at, confirmedUpdateTime(ctx))diff --git a/backend/api/v1/mcp_gate.go b/backend/api/v1/mcp_gate.goindex 85c8af7ee7..b19b9feee6 100644--- a/backend/api/v1/mcp_gate.go+++ b/backend/api/v1/mcp_gate.go@@ -467,9 +467,13 @@ const mcpConsoleWayOut = "Perform this action signed in to the Bytebase console// out, or an empty reason to allow. It lives in the gate so a refusal is// audited and worded like a class refusal, before the handler runs.var mcpRequestShapeRefusals = map[string]func(ctx context.Context, msg any) (reason, wayOut string){- v1connect.IssueServiceCreateIssueProcedure: refuseGrantIssueCreation,- v1connect.IssueServiceApproveIssueProcedure: refuseUnconfirmedIssueDecision,- v1connect.IssueServiceRejectIssueProcedure: refuseUnconfirmedIssueDecision,+ v1connect.IssueServiceCreateIssueProcedure: refuseGrantIssueCreation,+ v1connect.IssueServiceApproveIssueProcedure: refuseUnconfirmed(v1connect.IssueServiceApproveIssueProcedure,+ approvedIssueName, mcpIssueDecisionUnconfirmed, mcpDecideIssueWayOut),+ v1connect.IssueServiceRejectIssueProcedure: refuseUnconfirmed(v1connect.IssueServiceRejectIssueProcedure,+ rejectedIssueName, mcpIssueDecisionUnconfirmed, mcpDecideIssueWayOut),+ v1connect.ProjectServiceUpdateProjectProcedure: refuseUnconfirmed(v1connect.ProjectServiceUpdateProjectProcedure,+ updatedProjectName, mcpProjectUpdateUnconfirmed, mcpProjectUpdateWayOut),v1connect.SheetServiceCreateSheetProcedure: inTheConsole(refuseMaskedWriteSheet),v1connect.SheetServiceBatchCreateSheetsProcedure: inTheConsole(refuseMaskedWriteSheetBatch),v1connect.ReleaseServiceCreateReleaseProcedure: inTheConsole(refuseMaskedWriteRelease),@@ -502,27 +506,46 @@ func refuseByRequestShape(ctx context.Context, procedure string, msg any) error"%s is not available to MCP sessions for this request because %s. %s", procedure, reason, wayOut))}-const mcpDecideIssueWayOut = "Use the decide_issue tool, which asks the user to confirm"--// refuseUnconfirmedIssueDecision serves an approval or a rejection only when-// the request context carries that decision as the user confirmed it in the MCP-// client, which decide_issue attaches after asking. call_api reaches the same-// procedures but cannot set a context value, so it is refused here.-func refuseUnconfirmedIssueDecision(ctx context.Context, msg any) (string, string) {- var want auth.MCPConfirmedDecision- switch request := msg.(type) {- case *v1pb.ApproveIssueRequest:- want = auth.MCPConfirmedDecision{Procedure: v1connect.IssueServiceApproveIssueProcedure, Issue: request.GetName()}- case *v1pb.RejectIssueRequest:- want = auth.MCPConfirmedDecision{Procedure: v1connect.IssueServiceRejectIssueProcedure, Issue: request.GetName()}- default:- return fmt.Sprintf("its request could not be read as an issue decision (%T)", msg), mcpDecideIssueWayOut- }- if confirmed, ok := auth.MCPConfirmedDecisionFromContext(ctx); ok && confirmed.Procedure == want.Procedure && confirmed.Issue == want.Issue {- return "", ""+const (+ mcpDecideIssueWayOut = "Use the decide_issue tool, which asks the user to confirm"+ mcpIssueDecisionUnconfirmed = "an issue is approved or rejected over MCP only after the user confirms that decision in the MCP client, " ++ "and this request carries no such confirmation"+ mcpProjectUpdateUnconfirmed = "a project setting changes over MCP only through set_just_in_time_access, after the user confirms the change in the MCP client, " ++ "and this request carries no such confirmation"+ mcpProjectUpdateWayOut = "To turn just-in-time access on or off, use the set_just_in_time_access tool, which asks the user to confirm. " ++ "Change other project settings signed in to the Bytebase console"+)++// refuseUnconfirmed serves procedure only when the request context carries a+// confirmation naming that procedure and the resource the request changes. A+// confirmed MCP tool attaches one after asking the user. call_api reaches the+// same procedures but cannot set a context value, so it is refused here.+func refuseUnconfirmed(procedure string, resourceOf func(msg any) (string, bool), reason, wayOut string) func(context.Context, any) (string, string) {+ return func(ctx context.Context, msg any) (string, string) {+ resource, ok := resourceOf(msg)+ if !ok {+ return fmt.Sprintf("its request could not be read (%T)", msg), wayOut+ }+ if confirmed, ok := auth.MCPConfirmedDecisionFromContext(ctx); ok && confirmed.Procedure == procedure && confirmed.Resource == resource {+ return "", ""+ }+ return reason, wayOut}- return "an issue is approved or rejected over MCP only after the user confirms that decision in the MCP client, " +- "and this request carries no such confirmation", mcpDecideIssueWayOut+}++func approvedIssueName(msg any) (string, bool) {+ request, ok := msg.(*v1pb.ApproveIssueRequest)+ return request.GetName(), ok+}++func rejectedIssueName(msg any) (string, bool) {+ request, ok := msg.(*v1pb.RejectIssueRequest)+ return request.GetName(), ok+}++func updatedProjectName(msg any) (string, bool) {+ request, ok := msg.(*v1pb.UpdateProjectRequest)+ return request.GetProject().GetName(), ok}// refuseGrantIssueCreation applies grantIssueRefusal to CreateIssue. UpdateIssue'sdiff --git a/backend/api/v1/mcp_gate_test.go b/backend/api/v1/mcp_gate_test.goindex 44e3efb231..7183924e32 100644--- a/backend/api/v1/mcp_gate_test.go+++ b/backend/api/v1/mcp_gate_test.go@@ -15,6 +15,7 @@ import ("google.golang.org/protobuf/proto""google.golang.org/protobuf/reflect/protoreflect""google.golang.org/protobuf/reflect/protoregistry"+ "google.golang.org/protobuf/types/known/fieldmaskpb""github.com/bytebase/bytebase/backend/api/auth""github.com/bytebase/bytebase/backend/common"@@ -729,6 +730,67 @@ func TestTheApprovalReadsAreServed(t *testing.T) {}}+func TestTheJourneyOneWritesAreServed(t *testing.T) {+ t.Parallel()+ class := map[string]v1pb.MCPMethodClass{}+ for _, row := range mcpClassificationsFromDescriptors(t) {+ class[row.procedure] = row.class+ }+ require.Equal(t, v1pb.MCPMethodClass_WRITE, class[v1connect.AccessGrantServiceRevokeAccessGrantProcedure],+ "an agent that requested access must be able to revoke the grant once the work is done (BYT-9292)")+ require.Equal(t, v1pb.MCPMethodClass_WRITE, class[v1connect.ProjectServiceUpdateProjectProcedure],+ "an agent must be able to turn just-in-time access on, through set_just_in_time_access (BYT-9292)")+}++func TestMCPGateServesAProjectUpdateOnlyWithItsConfirmation(t *testing.T) {+ const project = "projects/p"+ write := classContext(v1pb.MCPMethodClass_WRITE)+ procedure := v1connect.ProjectServiceUpdateProjectProcedure+ request := func(name string) connect.AnyRequest {+ return connect.NewRequest(&v1pb.UpdateProjectRequest{+ Project: &v1pb.Project{Name: name, AllowJustInTimeAccess: true},+ UpdateMask: &fieldmaskpb.FieldMask{Paths: []string{"allow_just_in_time_access"}},+ })+ }+ confirmed := func(procedure, name string) context.Context {+ return auth.WithMCPConfirmedDecision(context.Background(), auth.MCPConfirmedDecision{Procedure: procedure, Resource: name})+ }++ t.Run("an unconfirmed request, as call_api sends it, is refused", func(t *testing.T) {+ got := invokeMCPGate(t, readWriteCeiling(), write, procedure, request(project))+ require.Error(t, got.err)+ require.False(t, got.dispatched)+ require.Equal(t, connect.CodePermissionDenied, connect.CodeOf(got.err))+ require.Contains(t, got.err.Error(), "set_just_in_time_access", "the denial must name the path that can confirm")+ require.Contains(t, got.err.Error(), "Bytebase console", "the denial must name where the other settings change")+ require.True(t, got.auditMarked)+ })++ t.Run("the confirmed request is served", func(t *testing.T) {+ got := invokeMCPGateFrom(confirmed(procedure, project), t, readWriteCeiling(), write, procedure, request(project))+ require.NoError(t, got.err)+ require.True(t, got.dispatched)+ })++ t.Run("a confirmation for another project is refused", func(t *testing.T) {+ got := invokeMCPGateFrom(confirmed(procedure, "projects/q"), t, readWriteCeiling(), write, procedure, request(project))+ require.Equal(t, connect.CodePermissionDenied, connect.CodeOf(got.err))+ require.False(t, got.dispatched)+ })++ t.Run("a confirmation for another procedure is refused", func(t *testing.T) {+ got := invokeMCPGateFrom(confirmed(v1connect.IssueServiceApproveIssueProcedure, project), t, readWriteCeiling(), write, procedure, request(project))+ require.Equal(t, connect.CodePermissionDenied, connect.CodeOf(got.err))+ require.False(t, got.dispatched)+ })++ t.Run("a confirmed request is still held to the ceiling", func(t *testing.T) {+ got := invokeMCPGateFrom(confirmed(procedure, project), t, readOnlyCeiling(), write, procedure, request(project))+ require.Error(t, got.err)+ require.False(t, got.dispatched)+ })+}+// TestDeprecatedSQLServiceAliasesMatchTheirCanonicalMethod pins the three// query-history RPCs that SQLService still carries as deprecated aliases of// QueryHistoryService. They have no HTTP binding, but the MCP surface indexes@@ -1221,7 +1283,7 @@ func TestMCPGateServesAnIssueDecisionOnlyWithItsConfirmation(t *testing.T) {confirmed := func(procedure, name string) context.Context {return auth.WithMCPConfirmedDecision(context.Background(), auth.MCPConfirmedDecision{Procedure: procedure,- Issue: name,+ Resource: name,IssueUpdateTime: time.Date(2026, 10, 13, 8, 0, 0, 123456000, time.UTC),})}diff --git a/backend/api/v1/mcp_masking_test.go b/backend/api/v1/mcp_masking_test.goindex d0b852fb79..f455c0285d 100644--- a/backend/api/v1/mcp_masking_test.go+++ b/backend/api/v1/mcp_masking_test.go@@ -2,6 +2,8 @@ package v1import ("context"+ "maps"+ "slices""testing""connectrpc.com/connect"@@ -143,11 +145,20 @@ func TestMaskedWriteGuardIsWiredIntoTheGate(t *testing.T) {}// A door added to the table but not exercised here ships wired to nothing,- // and the unit test above would still pass. CreateIssue, ApproveIssue and- // RejectIssue are the entries in mcpRequestShapeRefusals that are not- // masked-write doors.- require.Len(t, doors, len(mcpRequestShapeRefusals)-3,- "every masked-write door in the refusal table needs a row here")+ // and the unit test above would still pass. These are the entries in+ // mcpRequestShapeRefusals that are not masked-write doors.+ notDoors := []string{+ v1connect.IssueServiceCreateIssueProcedure,+ v1connect.IssueServiceApproveIssueProcedure,+ v1connect.IssueServiceRejectIssueProcedure,+ v1connect.ProjectServiceUpdateProjectProcedure,+ }+ listed := slices.Clone(notDoors)+ for _, door := range doors {+ listed = append(listed, door.procedure)+ }+ require.ElementsMatch(t, slices.Collect(maps.Keys(mcpRequestShapeRefusals)), listed,+ "every entry in the refusal table needs a row here, or a place in notDoors")for _, door := range doors {t.Run(door.procedure, func(t *testing.T) {diff --git a/backend/api/v1/testdata/mcp_method_classification.md b/backend/api/v1/testdata/mcp_method_classification.mdindex 8c990ec4f7..62179c9f0d 100644--- a/backend/api/v1/testdata/mcp_method_classification.md+++ b/backend/api/v1/testdata/mcp_method_classification.md@@ -17,8 +17,8 @@ served by no ceiling.| Class | Methods | Meaning ||---|---|---|| READ | 68 | served to a read-only session and above |-| WRITE | 39 | served to a read-write session only |-| EXCLUDED | 78 | served by no ceiling this phase ships |+| WRITE | 41 | served to a read-write session only |+| EXCLUDED | 76 | served by no ceiling this phase ships || FORBIDDEN | 34 | never served, whatever the ceiling || MCP_METHOD_CLASS_UNSPECIFIED | 0 | unclassified — CI rejects this, and the gate refuses it || **total** | **219** | |@@ -30,7 +30,7 @@ served by no ceiling.| AccessGrantService/CreateAccessGrant | WRITE | — | bb.accessGrants.create || AccessGrantService/GetAccessGrant | READ | — | bb.accessGrants.get || AccessGrantService/ListAccessGrants | READ | — | bb.accessGrants.list |-| AccessGrantService/RevokeAccessGrant | EXCLUDED | ADMINISTERS_THE_WORKSPACE | bb.accessGrants.revoke |+| AccessGrantService/RevokeAccessGrant | WRITE | — | bb.accessGrants.revoke || AccessGrantService/SearchMyAccessGrants | READ | — | bb.accessGrants.get || ActuatorService/GetActuatorInfo | READ | — | — || AuditLogService/ExportAuditLogs | EXCLUDED | ADMINISTERS_THE_WORKSPACE | bb.auditLogs.export |@@ -136,7 +136,7 @@ served by no ceiling.| ProjectService/SetIamPolicy | EXCLUDED | ADMINISTERS_THE_WORKSPACE | bb.projects.setIamPolicy || ProjectService/TestWebhook | EXCLUDED | SENDS_DATA_TO_A_THIRD_PARTY | bb.projects.update || ProjectService/UndeleteProject | EXCLUDED | ADMINISTERS_THE_WORKSPACE | bb.projects.undelete |-| ProjectService/UpdateProject | EXCLUDED | ADMINISTERS_THE_WORKSPACE | bb.projects.update |+| ProjectService/UpdateProject | WRITE | — | bb.projects.update || ProjectService/UpdateWebhook | EXCLUDED | ADMINISTERS_THE_WORKSPACE | bb.projects.update || QueryHistoryService/GetQueryHistory | READ | — | — || QueryHistoryService/ListQueryHistories | EXCLUDED | READS_OTHER_USERS_SQL | bb.queryHistories.list |diff --git a/backend/generated-go/v1/access_grant_service.pb.go b/backend/generated-go/v1/access_grant_service.pb.goindex 410288f6fb..78f72d2e9f 100644--- a/backend/generated-go/v1/access_grant_service.pb.go+++ b/backend/generated-go/v1/access_grant_service.pb.go@@ -861,13 +861,13 @@ const file_v1_access_grant_service_proto_rawDesc = "" +"\border_by\x18\x05 \x01(\tR\aorderBy\"\x85\x01\n" +"\x1cSearchMyAccessGrantsResponse\x12=\n" +"\raccess_grants\x18\x01 \x03(\v2\x18.bytebase.v1.AccessGrantR\faccessGrants\x12&\n" +- "\x0fnext_page_token\x18\x02 \x01(\tR\rnextPageToken2\x90\t\n" ++ "\x0fnext_page_token\x18\x02 \x01(\tR\rnextPageToken2\x8c\t\n" +"\x12AccessGrantService\x12\xa2\x01\n" +"\x0eGetAccessGrant\x12\".bytebase.v1.GetAccessGrantRequest\x1a\x18.bytebase.v1.AccessGrant\"R\xdaA\x04name\x8a\xea0\x13bb.accessGrants.get\x90\xea0\x01\xa0\xea0\x01\x82\xd3\xe4\x93\x02&\x12$/v1/{name=projects/*/accessGrants/*}\x12\xb6\x01\n" +"\x10ListAccessGrants\x12$.bytebase.v1.ListAccessGrantsRequest\x1a%.bytebase.v1.ListAccessGrantsResponse\"U\xdaA\x06parent\x8a\xea0\x14bb.accessGrants.list\x90\xea0\x01\xa0\xea0\x01\x82\xd3\xe4\x93\x02&\x12$/v1/{parent=projects/*}/accessGrants\x12\xcc\x01\n" +"\x11CreateAccessGrant\x12%.bytebase.v1.CreateAccessGrantRequest\x1a\x18.bytebase.v1.AccessGrant\"v\xdaA\x13parent,access_grant\x8a\xea0\x16bb.accessGrants.create\x90\xea0\x01\x98\xea0\x01\xa0\xea0\x02\x82\xd3\xe4\x93\x024:\faccess_grant\"$/v1/{parent=projects/*}/accessGrants\x12\xc5\x01\n" +- "\x13ActivateAccessGrant\x12'.bytebase.v1.ActivateAccessGrantRequest\x1a\x18.bytebase.v1.AccessGrant\"k\xdaA\x04name\x8a\xea0\x18bb.accessGrants.activate\x90\xea0\x01\x98\xea0\x01\xa0\xea0\x03\xa8\xea0\b\x82\xd3\xe4\x93\x022:\x01*\"-/v1/{name=projects/*/accessGrants/*}:activate\x12\xbd\x01\n" +- "\x11RevokeAccessGrant\x12%.bytebase.v1.RevokeAccessGrantRequest\x1a\x18.bytebase.v1.AccessGrant\"g\xdaA\x04name\x8a\xea0\x16bb.accessGrants.revoke\x90\xea0\x01\x98\xea0\x01\xa0\xea0\x04\xa8\xea0\t\x82\xd3\xe4\x93\x020:\x01*\"+/v1/{name=projects/*/accessGrants/*}:revoke\x12\xc4\x01\n" ++ "\x13ActivateAccessGrant\x12'.bytebase.v1.ActivateAccessGrantRequest\x1a\x18.bytebase.v1.AccessGrant\"k\xdaA\x04name\x8a\xea0\x18bb.accessGrants.activate\x90\xea0\x01\x98\xea0\x01\xa0\xea0\x03\xa8\xea0\b\x82\xd3\xe4\x93\x022:\x01*\"-/v1/{name=projects/*/accessGrants/*}:activate\x12\xb9\x01\n" ++ "\x11RevokeAccessGrant\x12%.bytebase.v1.RevokeAccessGrantRequest\x1a\x18.bytebase.v1.AccessGrant\"c\xdaA\x04name\x8a\xea0\x16bb.accessGrants.revoke\x90\xea0\x01\x98\xea0\x01\xa0\xea0\x02\x82\xd3\xe4\x93\x020:\x01*\"+/v1/{name=projects/*/accessGrants/*}:revoke\x12\xc4\x01\n" +"\x14SearchMyAccessGrants\x12(.bytebase.v1.SearchMyAccessGrantsRequest\x1a).bytebase.v1.SearchMyAccessGrantsResponse\"W\x8a\xea0\x13bb.accessGrants.get\x90\xea0\x02\xa0\xea0\x01\x82\xd3\xe4\x93\x022:\x01*\"-/v1/{parent=projects/*}/accessGrants:searchMyB\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"diff --git a/backend/generated-go/v1/project_service.pb.go b/backend/generated-go/v1/project_service.pb.goindex ed3de859fc..97676878f4 100644--- a/backend/generated-go/v1/project_service.pb.go+++ b/backend/generated-go/v1/project_service.pb.go@@ -1728,15 +1728,15 @@ const file_v1_project_service_proto_rawDesc = "" +"\x0fISSUE_SENT_BACK\x10\f\x12\x13\n" +"\x0fPIPELINE_FAILED\x10\r\x12\x16\n" +"\x12PIPELINE_COMPLETED\x10\x0e\x12\x12\n" +- "\x0eISSUE_APPROVED\x10\x0f\"\x04\b\x01\x10\t2\xfc\x12\n" ++ "\x0eISSUE_APPROVED\x10\x0f\"\x04\b\x01\x10\t2\xf8\x12\n" +"\x0eProjectService\x12\x83\x01\n" +"\n" +"GetProject\x12\x1e.bytebase.v1.GetProjectRequest\x1a\x14.bytebase.v1.Project\"?\xdaA\x04name\x8a\xea0\x0fbb.projects.get\x90\xea0\x01\xa0\xea0\x01\x82\xd3\xe4\x93\x02\x17\x12\x15/v1/{name=projects/*}\x12\x99\x01\n" +"\x10BatchGetProjects\x12$.bytebase.v1.BatchGetProjectsRequest\x1a%.bytebase.v1.BatchGetProjectsResponse\"8\x8a\xea0\x0fbb.projects.get\x90\xea0\x01\xa0\xea0\x01\x82\xd3\xe4\x93\x02\x17\x12\x15/v1/projects:batchGet\x12\x88\x01\n" +"\fListProjects\x12 .bytebase.v1.ListProjectsRequest\x1a!.bytebase.v1.ListProjectsResponse\"3\xdaA\x00\x8a\xea0\x10bb.projects.list\x90\xea0\x01\xa0\xea0\x01\x82\xd3\xe4\x93\x02\x0e\x12\f/v1/projects\x12\x84\x01\n" +"\x0eSearchProjects\x12\".bytebase.v1.SearchProjectsRequest\x1a#.bytebase.v1.SearchProjectsResponse\")\xdaA\x00\x90\xea0\x02\xa0\xea0\x01\x82\xd3\xe4\x93\x02\x18:\x01*\"\x13/v1/projects:search\x12\x90\x01\n" +- "\rCreateProject\x12!.bytebase.v1.CreateProjectRequest\x1a\x14.bytebase.v1.Project\"F\xdaA\x00\x8a\xea0\x12bb.projects.create\x90\xea0\x01\x98\xea0\x01\xa0\xea0\x04\xa8\xea0\t\x82\xd3\xe4\x93\x02\x17:\aproject\"\f/v1/projects\x12\xb4\x01\n" +- "\rUpdateProject\x12!.bytebase.v1.UpdateProjectRequest\x1a\x14.bytebase.v1.Project\"j\xdaA\x13project,update_mask\x8a\xea0\x12bb.projects.update\x90\xea0\x01\x98\xea0\x01\xa0\xea0\x04\xa8\xea0\t\x82\xd3\xe4\x93\x02(:\aproject2\x1d/v1/{project.name=projects/*}\x12\x96\x01\n" ++ "\rCreateProject\x12!.bytebase.v1.CreateProjectRequest\x1a\x14.bytebase.v1.Project\"F\xdaA\x00\x8a\xea0\x12bb.projects.create\x90\xea0\x01\x98\xea0\x01\xa0\xea0\x04\xa8\xea0\t\x82\xd3\xe4\x93\x02\x17:\aproject\"\f/v1/projects\x12\xb0\x01\n" ++ "\rUpdateProject\x12!.bytebase.v1.UpdateProjectRequest\x1a\x14.bytebase.v1.Project\"f\xdaA\x13project,update_mask\x8a\xea0\x12bb.projects.update\x90\xea0\x01\x98\xea0\x01\xa0\xea0\x02\x82\xd3\xe4\x93\x02(:\aproject2\x1d/v1/{project.name=projects/*}\x12\x96\x01\n" +"\rDeleteProject\x12!.bytebase.v1.DeleteProjectRequest\x1a\x16.google.protobuf.Empty\"J\xdaA\x04name\x8a\xea0\x12bb.projects.delete\x90\xea0\x01\x98\xea0\x01\xa0\xea0\x04\xa8\xea0\t\x82\xd3\xe4\x93\x02\x17*\x15/v1/{name=projects/*}\x12\x9f\x01\n" +"\x0fUndeleteProject\x12#.bytebase.v1.UndeleteProjectRequest\x1a\x14.bytebase.v1.Project\"Q\x8a\xea0\x14bb.projects.undelete\x90\xea0\x01\x98\xea0\x01\xa0\xea0\x04\xa8\xea0\t\x82\xd3\xe4\x93\x02#:\x01*\"\x1e/v1/{name=projects/*}:undelete\x12\xa1\x01\n" +"\x13BatchDeleteProjects\x12'.bytebase.v1.BatchDeleteProjectsRequest\x1a\x16.google.protobuf.Empty\"I\x8a\xea0\x12bb.projects.delete\x90\xea0\x01\x98\xea0\x01\xa0\xea0\x04\xa8\xea0\t\x82\xd3\xe4\x93\x02\x1d:\x01*\"\x18/v1/projects:batchDelete\x12\x9c\x01\n" +diff --git a/backend/store/setting_mcp_test.go b/backend/store/setting_mcp_test.gonew file mode 100644index 0000000000..9dfa084a28--- /dev/null+++ b/backend/store/setting_mcp_test.go@@ -0,0 +1,33 @@+package store_test++import (+ "testing"++ "github.com/stretchr/testify/require"++ storepb "github.com/bytebase/bytebase/backend/generated-go/store"+ "github.com/bytebase/bytebase/backend/store"+)++// TestMCPSettingsWithNoRowAreReadWrite pins the default every new WRITE method+// relies on: a workspace from before the MCP setting has no row and keeps+// Read-write, so the method reaches it with no migration.+func TestMCPSettingsWithNoRowAreReadWrite(t *testing.T) {+ t.Parallel()+ fixture := newStorePostgresFixture(t, "")+ ctx, s := fixture.ctx, fixture.store++ settings, err := s.GetMCPSettingsUncached(ctx, "default")+ require.NoError(t, err)+ require.Equal(t, storepb.MCPSetting_READ_WRITE, settings.GetCapability())++ _, err = s.UpsertSetting(ctx, &store.SettingMessage{+ Name: storepb.SettingName_MCP,+ Workspace: "default",+ Value: &storepb.MCPSetting{Capability: storepb.MCPSetting_READ_ONLY},+ })+ require.NoError(t, err)+ settings, err = s.GetMCPSettingsUncached(ctx, "default")+ require.NoError(t, err)+ require.Equal(t, storepb.MCPSetting_READ_ONLY, settings.GetCapability(), "a saved row is read as saved")+}diff --git a/backend/tests/mcp_gate_test.go b/backend/tests/mcp_gate_test.goindex b916737d29..15b1d1410b 100644--- a/backend/tests/mcp_gate_test.go+++ b/backend/tests/mcp_gate_test.go@@ -257,7 +257,18 @@ func TestMCPGrantIssuesAndAccessRequests(t *testing.T) {grantsRefused, issuesRefused := rowCounts()a.Equal(grantsAtStart, grantsRefused, "a request refused for just-in-time access leaves no access grant")a.Equal(issuesAtStart, issuesRefused, "a request refused for just-in-time access leaves no issue")- a.NoError(ctl.allowJustInTimeAccess(ctx, project.Msg))++ // The agent turns just-in-time access on through the tool that asks the+ // user first; call_api cannot change the project.+ direct := callAPIOnSession(ctx, t, session, "ProjectService/UpdateProject", map[string]any{+ "project": map[string]any{"name": projectName, "allowJustInTimeAccess": true},+ "updateMask": "allowJustInTimeAccess",+ })+ a.Equal(http.StatusForbidden, direct.Status, direct.Error)+ a.Contains(direct.Error, "set_just_in_time_access")+ failedToTurnOn, turnedOn := callToolOnSession(ctx, t, session, "set_just_in_time_access", map[string]any{"project": projectName, "enabled": true})+ a.False(failedToTurnOn, turnedOn)+ a.Contains(turnedOn, "Turned on just-in-time access in "+projectName)// The seeded fallback rule sends the request to a project owner.filed := callAPIOnSession(ctx, t, session, "AccessGrantService/CreateAccessGrant", requestAccess)@@ -311,7 +322,14 @@ func TestMCPGrantIssuesAndAccessRequests(t *testing.T) {approved, err := ctl.accessGrantServiceClient.GetAccessGrant(ctx, connect.NewRequest(&v1pb.GetAccessGrantRequest{Name: pending.Name}))a.NoError(err)a.Equal(v1pb.AccessGrant_ACTIVE, approved.Msg.Status)- a.Equal(int32(2), asked.Load(), "each decision asks the user once")+ a.Equal(int32(3), asked.Load(), "turning just-in-time access on and each decision ask the user once")++ // Once the work is done, the session revokes the grant it was given.+ revoked := callAPIOnSession(ctx, t, session, "AccessGrantService/RevokeAccessGrant", map[string]any{"name": pending.Name})+ a.Equal(http.StatusOK, revoked.Status, revoked.Error)+ after, err := ctl.accessGrantServiceClient.GetAccessGrant(ctx, connect.NewRequest(&v1pb.GetAccessGrantRequest{Name: pending.Name}))+ a.NoError(err)+ a.Equal(v1pb.AccessGrant_REVOKED, after.Msg.Status)consoleRequest := func() *v1pb.AccessGrant {granted, err := consoleCreate()@@ -450,14 +468,16 @@ func TestMCPDeveloperApprovesTheirOwnAccessRequest(t *testing.T) {a.Equal(v1pb.AccessGrant_ACTIVE, approved.Msg.Status)}-// decideIssueOnSession runs the decide_issue tool and returns whether it-// reported an error, with the text an agent would read.func decideIssueOnSession(ctx context.Context, t *testing.T, session *mcp.ClientSession, issue, decision string) (bool, string) {t.Helper()- result, err := session.CallTool(ctx, &mcp.CallToolParams{- Name: "decide_issue",- Arguments: map[string]any{"issue": issue, "decision": decision},- })+ return callToolOnSession(ctx, t, session, "decide_issue", map[string]any{"issue": issue, "decision": decision})+}++// callToolOnSession runs an MCP tool and returns whether it reported an error,+// with the text an agent would read.+func callToolOnSession(ctx context.Context, t *testing.T, session *mcp.ClientSession, name string, arguments map[string]any) (bool, string) {+ t.Helper()+ result, err := session.CallTool(ctx, &mcp.CallToolParams{Name: name, Arguments: arguments})require.NoError(t, err)var texts []stringfor _, content := range result.Content {diff --git a/docs/design/mcp-capability-ladder.md b/docs/design/mcp-capability-ladder.mdindex 2fc2e0c6eb..552b0045fe 100644--- a/docs/design/mcp-capability-ladder.md+++ b/docs/design/mcp-capability-ladder.md@@ -72,14 +72,14 @@ the product.| read | Read members, roles and policies | Who holds which role in the workspace and its projects · Groups and their members · Roles and their permissions · Masking rules and exemptions · Rollout, data query, tag and review policies · Access grants, including pending requests | 12 READ methods: `GetIamPolicy` on projects and the workspace, group reads (3), role reads (2), `GetPolicy`, `ListPolicies`, access-grant reads (3, with `SearchMyAccessGrants`) || — | *Read-only stops here* | | 68 methods || write | Propose changes | Create sheets · Create and edit plans and issues · Run plan checks and reviews · Create, delete and restore releases · Create and delete revisions · Generate schema diffs. The project's approval policy decides whether a change needs approval | 22 WRITE methods: sheet, plan, issue, release and revision writes, `RequestIssue`, `RunReview`, `DiffSchema`, `DiffMetadata` |-| write | Request access grants | Ask for a time-boxed grant to run a specific statement, optionally with results unmasked or exported; the statement must be a read as far as the engine can check it · The grant starts only after it is approved, and a request that would need no one's approval is refused · A grant applies only where the project allows access grants | 1 WRITE method: `AccessGrantService/CreateAccessGrant` |+| write | Request access grants | Ask for a time-boxed grant to run a specific statement, optionally with results unmasked or exported; the statement must be a read as far as the engine can check it · The grant starts only after it is approved, and a request that would need no one's approval is refused · A grant applies only where the project allows access grants · Revoke an active grant · Turn a project's "Allow access grants" on or off, after the user confirms | 3 WRITE methods: `AccessGrantService/CreateAccessGrant` and `RevokeAccessGrant`, served like any WRITE method; and `ProjectService/UpdateProject`, served only through the `set_just_in_time_access` tool, which asks the user to confirm and changes only that setting || write | Approve or reject issues | Each decision is confirmed in the user's MCP client before it is made · Role requests are decided in the console · The approval rules and the project's self-approval setting apply, as in the console | 2 WRITE methods: `ApproveIssue`, `RejectIssue`, served only through the `decide_issue` tool, which asks the user to confirm each decision and refuses role requests || write | Run rollouts and tasks | Create a rollout · Run, skip or cancel its tasks, under the project's approval policy | 4 WRITE methods: `CreateRollout`, `BatchRunTasks`, `BatchSkipTasks`, `BatchCancelTaskRuns` || write | Run DML and DDL statements | INSERT, UPDATE, DELETE, CREATE, ALTER, DROP through queries, as far as the engine and the user's own permissions allow | Not a method: the statement clamp in `mcp_sql_clamp.go`, which Read-write lifts || write | Export query results | Download results as a file. Data leaves Bytebase | 1 WRITE method: `SQLService/Export` || write | Manage database housekeeping | Sync instances and databases · Saved queries | 9 WRITE methods: sync, saved-query writes |-| — | *Read-write stops here* | | 107 methods |-| floor | Never, in any mode: administer the workspace, handle credentials, open an Admin mode session, or read anyone else's query history. | | 112 methods: 34 FORBIDDEN, 78 EXCLUDED |+| — | *Read-write stops here* | | 109 methods |+| floor | Never, in any mode: administer the workspace, handle credentials, open an Admin mode session, or read anyone else's query history. | | 110 methods: 34 FORBIDDEN, 76 EXCLUDED |Every row is displayed under every mode — served, or muted with a `—` — and against every engine aworkspace happens to hold, so **every line on this card must be true on both axes: mode and engine.**@@ -292,7 +292,7 @@ its tier tag, nothing else. "Show details" reveals the sub-item line for every rthere is one second-level control rather than one per row; per-row expanders were rejected as fiddly. Nomethod names, no permission names, no counts, no link to a method list. The floor is kept as oneshort line because it is what a security-minded admin reads first, and it is what keeps the list-honest about the 112 methods no mode reaches. There is no constants line under the list; the facts+honest about the 110 methods no mode reaches. There is no constants line under the list; the factsit would carry (capped by the user's own permissions, refusals audited) move into the sectiondescription.@@ -433,7 +433,7 @@ under- Section description: "The most any MCP session may do here. Sessions are also capped by each user's permissions, and policy refusals are streamed to stdout when audit logging to stdout is enabled."- Disclosure line, collapsed — Read-only: "Read schemas, data, the change workflow, members, roles and policies; a request carrying anything that cannot be shown to be a read is refused, and nothing is exported".- Read-write: "Read schemas, data, the change workflow, members, roles and policies; propose, request access, approve, run, export and manage".+ Read-write: "Read schemas, data, the change workflow, members, roles and policies; propose, request and revoke access, approve, run, export and manage".Expanded heading: "{mode} allows". Details control: "Show details" / "Hide details".- Disabled — view sentence: "No MCP session can connect to this workspace." Edit static line:"Nothing is allowed; no MCP session can connect."diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.jsonindex 839c4de9e2..0ec324b31f 100644--- a/frontend/src/locales/en-US.json+++ b/frontend/src/locales/en-US.json@@ -2830,7 +2830,7 @@"title": "Read the change workflow"},"request-access": {- "details": "Ask for a time-boxed grant to run a specific statement, optionally with results unmasked or exported; the statement must be a read as far as the engine can check it · The grant starts only after it is approved, and a request that would need no one's approval is refused · A grant applies only where the project allows access grants",+ "details": "Ask for a time-boxed grant to run a specific statement, optionally with results unmasked or exported; the statement must be a read as far as the engine can check it · The grant starts only after it is approved, and a request that would need no one's approval is refused · A grant applies only where the project allows access grants · Revoke an active grant · Turn a project's \"Allow access grants\" on or off, after the user confirms","title": "Request access grants"},"run-rollouts": {@@ -2849,7 +2849,7 @@},"summary": {"read-only": "Read schemas, data, the change workflow, members, roles and policies; a request carrying anything that cannot be shown to be a read is refused, and nothing is exported",- "read-write": "Read schemas, data, the change workflow, members, roles and policies; propose, request access, approve, run, export and manage"+ "read-write": "Read schemas, data, the change workflow, members, roles and policies; propose, request and revoke access, approve, run, export and manage"},"tier": {"read": "read",diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.jsonindex a161669edd..94e3ac1a2e 100644--- a/frontend/src/locales/es-ES.json+++ b/frontend/src/locales/es-ES.json@@ -2830,7 +2830,7 @@"title": "Leer el flujo de cambios"},"request-access": {- "details": "Pedir una concesión con límite de tiempo para ejecutar una sentencia concreta, opcionalmente con resultados sin enmascarar o exportados; la sentencia debe ser una lectura hasta donde el motor pueda comprobarlo · La concesión solo empieza después de ser aprobada, y se rechaza una solicitud que no necesitaría la aprobación de nadie · Una concesión solo se aplica donde el proyecto permite concesiones de acceso",+ "details": "Pedir una concesión con límite de tiempo para ejecutar una sentencia concreta, opcionalmente con resultados sin enmascarar o exportados; la sentencia debe ser una lectura hasta donde el motor pueda comprobarlo · La concesión solo empieza después de ser aprobada, y se rechaza una solicitud que no necesitaría la aprobación de nadie · Una concesión solo se aplica donde el proyecto permite concesiones de acceso · Revocar una concesión activa · Activar o desactivar \"Permitir concesiones de acceso\" de un proyecto, después de que el usuario lo confirme","title": "Solicitar concesiones de acceso"},"run-rollouts": {@@ -2849,7 +2849,7 @@},"summary": {"read-only": "Leer esquemas, datos, el flujo de cambios, miembros, roles y políticas; una solicitud que lleve algo que no pueda demostrarse que es una lectura se rechaza, y no se exporta nada",- "read-write": "Leer esquemas, datos, el flujo de cambios, miembros, roles y políticas; proponer, solicitar acceso, aprobar, ejecutar, exportar y gestionar"+ "read-write": "Leer esquemas, datos, el flujo de cambios, miembros, roles y políticas; proponer, solicitar y revocar acceso, aprobar, ejecutar, exportar y gestionar"},"tier": {"read": "lectura",diff --git a/frontend/src/locales/ja-JP.json b/frontend/src/locales/ja-JP.jsonindex a44bc1b4f8..c6755ccdb6 100644--- a/frontend/src/locales/ja-JP.json+++ b/frontend/src/locales/ja-JP.json@@ -2830,7 +2830,7 @@"title": "変更ワークフローの読み取り"},"request-access": {- "details": "特定のステートメントを実行するための期限付きアクセス付与をリクエストします。結果のマスク解除やエクスポートも含められます。エンジンが確認できる範囲で、ステートメントは読み取りでなければなりません · 付与は承認された後にのみ有効になり、誰の承認も必要としないリクエストは拒否されます · 付与は、プロジェクトがアクセス付与を許可している場合にのみ適用されます",+ "details": "特定のステートメントを実行するための期限付きアクセス付与をリクエストします。結果のマスク解除やエクスポートも含められます。エンジンが確認できる範囲で、ステートメントは読み取りでなければなりません · 付与は承認された後にのみ有効になり、誰の承認も必要としないリクエストは拒否されます · 付与は、プロジェクトがアクセス付与を許可している場合にのみ適用されます · 有効なアクセス付与を取り消す · プロジェクトの「アクセス付与を許可」をオン・オフにする(ユーザーの確認後)","title": "アクセス付与をリクエストする"},"run-rollouts": {@@ -2849,7 +2849,7 @@},"summary": {"read-only": "スキーマ・データ・変更ワークフロー・メンバー・ロール・ポリシーの読み取り。読み取りだと確認できないものを含むリクエストは拒否され、エクスポートもできません",- "read-write": "スキーマ・データ・変更ワークフロー・メンバー・ロール・ポリシーの読み取り。提案・アクセスのリクエスト・承認・実行・エクスポート・管理"+ "read-write": "スキーマ・データ・変更ワークフロー・メンバー・ロール・ポリシーの読み取り。提案・アクセスのリクエストと取り消し・承認・実行・エクスポート・管理"},"tier": {"read": "読み取り",diff --git a/frontend/src/locales/vi-VN.json b/frontend/src/locales/vi-VN.jsonindex 1ea2843a94..e5e2ea3a42 100644--- a/frontend/src/locales/vi-VN.json+++ b/frontend/src/locales/vi-VN.json@@ -2830,7 +2830,7 @@"title": "Đọc quy trình thay đổi"},"request-access": {- "details": "Xin cấp quyền truy cập có thời hạn để chạy một câu lệnh cụ thể, có thể kèm xem kết quả chưa che hoặc xuất kết quả; câu lệnh phải là lệnh đọc trong phạm vi engine kiểm tra được · Quyền chỉ bắt đầu sau khi được phê duyệt, và yêu cầu không cần ai phê duyệt sẽ bị từ chối · Quyền chỉ áp dụng khi dự án cho phép cấp quyền truy cập",+ "details": "Xin cấp quyền truy cập có thời hạn để chạy một câu lệnh cụ thể, có thể kèm xem kết quả chưa che hoặc xuất kết quả; câu lệnh phải là lệnh đọc trong phạm vi engine kiểm tra được · Quyền chỉ bắt đầu sau khi được phê duyệt, và yêu cầu không cần ai phê duyệt sẽ bị từ chối · Quyền chỉ áp dụng khi dự án cho phép cấp quyền truy cập · Thu hồi quyền đang có hiệu lực · Bật hoặc tắt \"Cho phép cấp quyền truy cập\" của dự án, sau khi người dùng xác nhận","title": "Yêu cầu cấp quyền truy cập"},"run-rollouts": {@@ -2849,7 +2849,7 @@},"summary": {"read-only": "Đọc lược đồ, dữ liệu, quy trình thay đổi, thành viên, vai trò và chính sách; yêu cầu chứa bất kỳ thứ gì không thể chứng minh là đọc đều bị từ chối, và không xuất được gì",- "read-write": "Đọc lược đồ, dữ liệu, quy trình thay đổi, thành viên, vai trò và chính sách; đề xuất, yêu cầu truy cập, phê duyệt, chạy, xuất và quản lý"+ "read-write": "Đọc lược đồ, dữ liệu, quy trình thay đổi, thành viên, vai trò và chính sách; đề xuất, yêu cầu và thu hồi truy cập, phê duyệt, chạy, xuất và quản lý"},"tier": {"read": "đọc",diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.jsonindex 65f107671a..d837cf9fc9 100644--- a/frontend/src/locales/zh-CN.json+++ b/frontend/src/locales/zh-CN.json@@ -2830,7 +2830,7 @@"title": "读取变更流程"},"request-access": {- "details": "为特定语句申请限时访问授权,可选择查看未脱敏结果或导出结果;在引擎能检查的范围内,该语句必须是读取 · 只有在获得批准后授权才会生效;无需任何人审批的申请会被拒绝 · 授权仅在项目允许访问授权时适用",+ "details": "为特定语句申请限时访问授权,可选择查看未脱敏结果或导出结果;在引擎能检查的范围内,该语句必须是读取 · 只有在获得批准后授权才会生效;无需任何人审批的申请会被拒绝 · 授权仅在项目允许访问授权时适用 · 撤销生效中的授权 · 在用户确认后开启或关闭项目的“允许访问授权”","title": "申请访问授权"},"run-rollouts": {@@ -2849,7 +2849,7 @@},"summary": {"read-only": "读取模式、数据、变更流程、成员、角色和策略;只要请求中含有无法被确认为读取的内容就会被拒绝,也不能导出",- "read-write": "读取模式、数据、变更流程、成员、角色和策略;提议、申请访问、批准、执行、导出和管理"+ "read-write": "读取模式、数据、变更流程、成员、角色和策略;提议、申请和撤销访问、批准、执行、导出和管理"},"tier": {"read": "读取",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.jsindex 6de2240bb7..c7df5a8f3a 100644--- a/frontend/src/types/proto-es/v1/access_grant_service_pb.js+++ b/frontend/src/types/proto-es/v1/access_grant_service_pb.js@@ -14,7 +14,7 @@ import { file_v1_annotation } from "./annotation_pb";* Describes the file v1/access_grant_service.proto.*/export const file_v1_access_grant_service = /*@__PURE__*/- fileDesc("Ch12MS9hY2Nlc3NfZ3JhbnRfc2VydmljZS5wcm90bxILYnl0ZWJhc2UudjEi5gQKC0FjY2Vzc0dyYW50EgwKBG5hbWUYASABKAkSFAoHY3JlYXRvchgCIAEoCUID4EECEjQKBnN0YXR1cxgDIAEoDjIfLmJ5dGViYXNlLnYxLkFjY2Vzc0dyYW50LlN0YXR1c0ID4EEDEjEKC2V4cGlyZV90aW1lGAQgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcEgAEi0KA3R0bBgLIAEoCzIZLmdvb2dsZS5wcm90b2J1Zi5EdXJhdGlvbkID4EEESAASEgoFaXNzdWUYBSABKAlCA+BBAxIUCgd0YXJnZXRzGAYgAygJQgPgQQISDQoFcXVlcnkYByABKAkSDgoGdW5tYXNrGAggASgIEjQKC2NyZWF0ZV90aW1lGAkgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcEID4EEDEjQKC3VwZGF0ZV90aW1lGAogASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcEID4EEDEg4KBnJlYXNvbhgMIAEoCRIOCgZleHBvcnQYDSABKAgSDgoGc2NoZW1hGA4gASgJEhEKCWNvbnRhaW5lchgPIAEoCSJGCgZTdGF0dXMSFgoSU1RBVFVTX1VOU1BFQ0lGSUVEEAASCwoHUEVORElORxABEgoKBkFDVElWRRACEgsKB1JFVk9LRUQQAzpN6kFKChhieXRlYmFzZS5jb20vQWNjZXNzR3JhbnQSLnByb2plY3RzL3twcm9qZWN0fS9hY2Nlc3NHcmFudHMve2FjY2Vzc19ncmFudH1CDAoKZXhwaXJhdGlvbiJHChVHZXRBY2Nlc3NHcmFudFJlcXVlc3QSLgoEbmFtZRgBIAEoCUIg4EEC+kEaChhieXRlY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BY2Nlc3NHcmFudBIlLmJ5dGViYXNlLnYxLlJldm9rZUFjY2Vzc0dyYW50UmVxdWVzdBoYLmJ5dGViYXNlLnYxLkFjY2Vzc0dyYW50ImfaQQRuYW1liuowFmJiLmFjY2Vzc0dyYW50cy5yZXZva2WQ6jABmOowAaDqMASo6jAJgtPkkwIwOgEqIisvdjEve25hbWU9cHJvamVjdHMvKi9hY2Nlc3NHcmFudHMvKn06cmV2b2tlEsQBChRTZWFyY2hNeUFjY2Vzc0dyYW50cxIoLmJ5dGViYXNlLnYxLlNlYXJjaE15QWNjZXNzR3JhbnRzUmVxdWVzdBopLmJ5dGViYXNlLnYxLlNlYXJjaE15QWNjZXNzR3JhbnRzUmVzcG9uc2UiV4rqMBNiYi5hY2Nlc3NHcmFudHMuZ2V0kOowAqDqMAGC0+STAjI6ASoiLS92MS97cGFyZW50PXByb2plY3RzLyp9L2FjY2Vzc0dyYW50czpzZWFyY2hNeUKtAQoPY29tLmJ5dGViYXNlLnYxQhdBY2Nlc3NHcmFudFNlcnZpY2VQcm90b1ABWjRnaXRodWIuY29tL2J5dGViYXNlL2J5dGViYXNlL2JhY2tlbmQvZ2VuZXJhdGVkLWdvL3YxogIDQlhYqgILQnl0ZWJhc2UuVjHKAgtCeXRlYmFzZVxWMeICF0J5dGViYXNlXFYxXEdQQk1ldGFkYXRh6gIMQnl0ZWJhc2U6OlYxYgZwcm90bzM", [file_google_api_annotations, file_google_api_client, file_google_api_field_behavior, file_google_api_resource, file_google_protobuf_duration, file_google_protobuf_timestamp, file_v1_annotation]);+ fileDesc("Ch12MS9hY2Nlc3NfZ3JhbnRfc2VydmljZS5wcm90bxILYnl0ZWJhc2UudjEi5gQKC0FjY2Vzc0dyYW50EgwKBG5hbWUYASABKAkSFAoHY3JlYXRvchgCIAEoCUID4EECEjQKBnN0YXR1cxgDIAEoDjIfLmJ5dGViYXNlLnYxLkFjY2Vzc0dyYW50LlN0YXR1c0ID4EEDEjEKC2V4cGlyZV90aW1lGAQgAS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mNoTXlBY2Nlc3NHcmFudHNSZXNwb25zZSJXiuowE2JiLmFjY2Vzc0dyYW50cy5nZXSQ6jACoOowAYLT5JMCMjoBKiItL3YxL3twYXJlbnQ9cHJvamVjdHMvKn0vYWNjZXNzR3JhbnRzOnNlYXJjaE15Qq0BCg9jb20uYnl0ZWJhc2UudjFCF0FjY2Vzc0dyYW50U2VydmljZVByb3RvUAFaNGdpdGh1Yi5jb20vYnl0ZWJhc2UvYnl0ZWJhc2UvYmFja2VuZC9nZW5lcmF0ZWQtZ28vdjGiAgNCWFiqAgtCeXRlYmFzZS5WMcoCC0J5dGViYXNlXFYx4gIXQnl0ZWJhc2VcVjFcR1BCTWV0YWRhdGHqAgxCeXRlYmFzZTo6VjFiBnByb3RvMw", [file_google_api_annotations, file_google_api_client, file_google_api_field_behavior, file_google_api_resource, file_google_protobuf_duration, file_google_protobuf_timestamp, file_v1_annotation]);/*** Describes the message bytebase.v1.AccessGrant.diff --git a/frontend/src/types/proto-es/v1/project_service_pb.js b/frontend/src/types/proto-es/v1/project_service_pb.jsindex abd8686868..5347b672f8 100644--- a/frontend/src/types/proto-es/v1/project_service_pb.js+++ b/frontend/src/types/proto-es/v1/project_service_pb.js@@ -18,7 +18,7 @@ import { file_v1_iam_policy } from "./iam_policy_pb";* Describes the file v1/project_service.proto.*/export const file_v1_project_service = /*@__PURE__*/- fileDesc("Chh2MS9wcm9qZWN0X3NlcnZpY2UucHJvdG8SC2J5dGViYXNlLnYxIj8KEUdldFByb2plY3RSZXF1ZXN0EioKBG5hbWUYASABKAlCHOBBAvpBFgoUYnl0ZWJhc2UuY29tL1Byb2plY3QiRgoXQmF0Y2hHZXRQcm9qZWN0c1JlcXVlc3QSKwoFbmFtZXMYASADKAlCHOBBAvpBFgoUYnl0ZWJhc2UuY29tL1Byb2plY3QiQgoYQmF0Y2hHZXRQcm9qZWN0c1Jlc3BvbnNlEiYKCHByb2plY3RzGAEgAygLMhQuYnl0ZWJhc2UudjEuUHJvamVjdCJ0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va3MvKn06dXBkYXRlV2ViaG9vaxKxAQoNUmVtb3ZlV2ViaG9vaxIhLmJ5dGViYXNlLnYxLlJlbW92ZVdlYmhvb2tSZXF1ZXN0GhQuYnl0ZWJhc2UudjEuUHJvamVjdCJniuowEmJiLnByb2plY3RzLnVwZGF0ZZDqMAGY6jABoOowBKjqMAmC0+STAjs6ASoiNi92MS97d2ViaG9vay5uYW1lPXByb2plY3RzLyovd2ViaG9va3MvKn06cmVtb3ZlV2ViaG9vaxKjAQoLVGVzdFdlYmhvb2sSHy5ieXRlYmFzZS52MS5UZXN0V2ViaG9va1JlcXVlc3QaIC5ieXRlYmFzZS52MS5UZXN0V2ViaG9va1Jlc3BvbnNlIlGK6jASYmIucHJvamVjdHMudXBkYXRlkOowAaDqMASo6jAMgtPkkwIpOgEqIiQvdjEve3Byb2plY3Q9cHJvamVjdHMvKn06dGVzdFdlYmhvb2tCqQEKD2NvbS5ieXRlYmFzZS52MUITUHJvamVjdFNlcnZpY2VQcm90b1ABWjRnaXRodWIuY29tL2J5dGViYXNlL2J5dGViYXNlL2JhY2tlbmQvZ2VuZXJhdGVkLWdvL3YxogIDQlhYqgILQnl0ZWJhc2UuVjHKAgtCeXRlYmFzZVxWMeICF0J5dGViYXNlXFYxXEdQQk1ldGFkYXRh6gIMQnl0ZWJhc2U6OlYxYgZwcm90bzM", [file_buf_validate_validate, file_google_api_annotations, file_google_api_client, file_google_api_field_behavior, file_google_api_resource, file_google_protobuf_empty, file_google_protobuf_field_mask, file_google_type_color, file_v1_annotation, file_v1_common, file_v1_iam_policy]);+ fileDesc("Chh2MS9wcm9qZWN0X3NlcnZpY2UucHJvdG8SC2J5dGViYXNlLnYxIj8KEUdldFByb2plY3RSZXF1ZXN0EioKBG5hbWUYASABKAlCHOBBAvpBFgoUYnl0ZWJhc2UuY29tL1Byb2plY3QiRgoXQmF0Y2hHZXRQcm9qZWN0c1JlcXVlc3QSKwoFbmFtZXMYASADKAlCHOBBAvpBFgoUYnl0ZWJhc2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amVjdCKDAdpBE3dlYmhvb2ssdXBkYXRlX21hc2uK6jASYmIucHJvamVjdHMudXBkYXRlkOowAZjqMAGg6jAEqOowCYLT5JMCQToHd2ViaG9vazI2L3YxL3t3ZWJob29rLm5hbWU9cHJvamVjdHMvKi93ZWJob29rcy8qfTp1cGRhdGVXZWJob29rErEBCg1SZW1vdmVXZWJob29rEiEuYnl0ZWJhc2UudjEuUmVtb3ZlV2ViaG9va1JlcXVlc3QaFC5ieXRlYmFzZS52MS5Qcm9qZWN0ImeK6jASYmIucHJvamVjdHMudXBkYXRlkOowAZjqMAGg6jAEqOowCYLT5JMCOzoBKiI2L3YxL3t3ZWJob29rLm5hbWU9cHJvamVjdHMvKi93ZWJob29rcy8qfTpyZW1vdmVXZWJob29rEqMBCgtUZXN0V2ViaG9vaxIfLmJ5dGViYXNlLnYxLlRlc3RXZWJob29rUmVxdWVzdBogLmJ5dGViYXNlLnYxLlRlc3RXZWJob29rUmVzcG9uc2UiUYrqMBJiYi5wcm9qZWN0cy51cGRhdGWQ6jABoOowBKjqMAyC0+STAik6ASoiJC92MS97cHJvamVjdD1wcm9qZWN0cy8qfTp0ZXN0V2ViaG9va0KpAQoPY29tLmJ5dGViYXNlLnYxQhNQcm9qZWN0U2VydmljZVByb3RvUAFaNGdpdGh1Yi5jb20vYnl0ZWJhc2UvYnl0ZWJhc2UvYmFja2VuZC9nZW5lcmF0ZWQtZ28vdjGiAgNCWFiqAgtCeXRlYmFzZS5WMcoCC0J5dGViYXNlXFYx4gIXQnl0ZWJhc2VcVjFcR1BCTWV0YWRhdGHqAgxCeXRlYmFzZTo6VjFiBnByb3RvMw", [file_buf_validate_validate, file_google_api_annotations, file_google_api_client, file_google_api_field_behavior, file_google_api_resource, file_google_protobuf_empty, file_google_protobuf_field_mask, file_google_type_color, file_v1_annotation, file_v1_common, file_v1_iam_policy]);/*** Describes the message bytebase.v1.GetProjectRequest.diff --git a/proto/v1/v1/access_grant_service.proto b/proto/v1/v1/access_grant_service.protoindex 9bd9876441..3ed2f53e2b 100644--- a/proto/v1/v1/access_grant_service.proto+++ b/proto/v1/v1/access_grant_service.proto@@ -71,8 +71,7 @@ service AccessGrantService {option (bytebase.v1.permission) = "bb.accessGrants.revoke";option (bytebase.v1.auth_method) = IAM;option (bytebase.v1.audit) = true;- option (bytebase.v1.mcp_method_class) = EXCLUDED;- option (bytebase.v1.mcp_denial_reason) = ADMINISTERS_THE_WORKSPACE;+ option (bytebase.v1.mcp_method_class) = WRITE;}// Searches access grants created by the caller.diff --git a/proto/v1/v1/project_service.proto b/proto/v1/v1/project_service.protoindex fa961af382..eb1e2b0bae 100644--- a/proto/v1/v1/project_service.proto+++ b/proto/v1/v1/project_service.proto@@ -89,8 +89,9 @@ service ProjectService {option (bytebase.v1.permission) = "bb.projects.update";option (bytebase.v1.auth_method) = IAM;option (bytebase.v1.audit) = true;- option (bytebase.v1.mcp_method_class) = EXCLUDED;- option (bytebase.v1.mcp_denial_reason) = ADMINISTERS_THE_WORKSPACE;+ // An MCP session reaches it only through the set_just_in_time_access tool,+ // after the user confirms the change in the MCP client.+ option (bytebase.v1.mcp_method_class) = WRITE;}// Deletes (soft-delete or purge) a project.