The store keeps the company's MCP servers, and which tools a scope may call
mcp_servers holds each server: its address, headers, and secret references for the headers that carry credentials. limits gains allowed_tools, patterns such as jira.* resolved down the tenancy tree; unlike models, a tool no level grants is not granted. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
8ffde2b80c
commit
6dfdfbf2fe
8 files changed
+277
-10
No files matched your search
@@ -128,15 +128,15 @@ func (s *DB) nameIsFree(ctx context.Context, q string, args ...any) error {
|
||||
// otherwise be a query each.
|
||||
func (s *DB) AllLimits(ctx context.Context) (map[string]Limits, error) {
|
||||
rows, err := queryAll(ctx, s.db, `
|
||||
SELECT scope_type, scope_id, rpm, tpm, budget_micros, budget_period, allowed_models
|
||||
SELECT scope_type, scope_id, rpm, tpm, budget_micros, budget_period, allowed_models, allowed_tools
|
||||
FROM limits`, nil, func(rows *sql.Rows) (Limits, error) {
|
||||
var l Limits
|
||||
var scope string
|
||||
var models sql.NullString
|
||||
var models, tools sql.NullString
|
||||
var rpm, tpm sql.NullInt64
|
||||
var budget sql.NullInt64
|
||||
var period sql.NullString
|
||||
if err := rows.Scan(&scope, &l.ScopeID, &rpm, &tpm, &budget, &period, &models); err != nil {
|
||||
if err := rows.Scan(&scope, &l.ScopeID, &rpm, &tpm, &budget, &period, &models, &tools); err != nil {
|
||||
return l, err
|
||||
}
|
||||
l.Scope = Scope(scope)
|
||||
@@ -155,6 +155,10 @@ func (s *DB) AllLimits(ctx context.Context) (map[string]Limits, error) {
|
||||
l.BudgetPeriod = Period(period.String)
|
||||
am, err := decodeModels(models)
|
||||
l.AllowedModels = am
|
||||
if err != nil {
|
||||
return l, err
|
||||
}
|
||||
l.AllowedTools, err = decodeModels(tools)
|
||||
return l, err
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
Reference in new issue
Block a user