fix(handlers): main build red — undefined conciergePlatformMCPPlugin #3075
@@ -74,7 +74,7 @@ func recordWorkspacePluginInstall(
|
||||
// plugin files could get the management MCP installed. Refuse the privileged
|
||||
// name here, mirroring the gate in recordDeclaredPlugin. Fail-closed on a kind
|
||||
// read error.
|
||||
if pluginName == conciergePlatformMCPPlugin {
|
||||
if pluginName == conciergePlatformMCPName {
|
||||
var kind string
|
||||
if err := db.DB.QueryRowContext(ctx,
|
||||
`SELECT COALESCE(kind, 'workspace') FROM workspaces WHERE id = $1`, workspaceID).Scan(&kind); err != nil {
|
||||
|
||||
@@ -72,9 +72,9 @@ func TestRecordWorkspacePluginInstall_PrivilegedPluginEntitlement(t *testing.T)
|
||||
mock.ExpectQuery(kindQuery).WithArgs("ws-concierge").
|
||||
WillReturnRows(sqlmock.NewRows([]string{"kind"}).AddRow("platform"))
|
||||
mock.ExpectExec(installInsert).
|
||||
WithArgs("ws-concierge", conciergePlatformMCPPlugin, sqlmock.AnyArg(), sqlmock.AnyArg(), sqlmock.AnyArg()).
|
||||
WithArgs("ws-concierge", conciergePlatformMCPName, sqlmock.AnyArg(), sqlmock.AnyArg(), sqlmock.AnyArg()).
|
||||
WillReturnResult(sqlmock.NewResult(0, 1))
|
||||
if err := recordWorkspacePluginInstall(context.Background(), "ws-concierge", conciergePlatformMCPPlugin, "gitea://molecule-ai/molecule-ai-plugin-molecule-platform-mcp", "none", "abc123"); err != nil {
|
||||
if err := recordWorkspacePluginInstall(context.Background(), "ws-concierge", conciergePlatformMCPName, "gitea://molecule-ai/molecule-ai-plugin-molecule-platform-mcp", "none", "abc123"); err != nil {
|
||||
t.Fatalf("platform concierge install of the management MCP must succeed: %v", err)
|
||||
}
|
||||
if err := mock.ExpectationsWereMet(); err != nil {
|
||||
@@ -87,7 +87,7 @@ func TestRecordWorkspacePluginInstall_PrivilegedPluginEntitlement(t *testing.T)
|
||||
mock.ExpectQuery(kindQuery).WithArgs("ws-user").
|
||||
WillReturnRows(sqlmock.NewRows([]string{"kind"}).AddRow("workspace"))
|
||||
// NO ExpectExec: the gate MUST refuse before any INSERT fires.
|
||||
err := recordWorkspacePluginInstall(context.Background(), "ws-user", conciergePlatformMCPPlugin, "gitea://molecule-ai/molecule-ai-plugin-molecule-platform-mcp", "none", "abc123")
|
||||
err := recordWorkspacePluginInstall(context.Background(), "ws-user", conciergePlatformMCPName, "gitea://molecule-ai/molecule-ai-plugin-molecule-platform-mcp", "none", "abc123")
|
||||
if err == nil {
|
||||
t.Fatal("a non-platform workspace MUST NOT be able to install the privileged management MCP plugin")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user