run402-mcp
Version:
MCP server for Run402 — full-stack backend infrastructure for AI agents: Postgres, auth, storage, serverless functions and atomic deploys. Paid with x402/MPP. Includes $0.03 image generation.
135 lines • 4.3 kB
JavaScript
export const PROJECT_OPERATION_AUTH_CLASSIFICATIONS = [
{
operation: "projects.list",
scope: "project",
plane: "control",
authModes: ["principal", "grant_key"],
defaultAuthMode: "principal",
requiresProjectId: false,
mayUseLocalCredentialCache: false,
},
{
operation: "projects.get",
scope: "project",
plane: "control",
authModes: ["principal", "grant_key"],
defaultAuthMode: "principal",
requiresProjectId: true,
mayUseLocalCredentialCache: false,
},
{
operation: "projects.use",
scope: "project",
plane: "control",
authModes: ["principal", "grant_key"],
defaultAuthMode: "principal",
requiresProjectId: true,
mayUseLocalCredentialCache: false,
},
{
operation: "projects.keys",
scope: "project",
plane: "local",
authModes: ["project_credential"],
defaultAuthMode: "project_credential",
requiresProjectId: true,
mayUseLocalCredentialCache: true,
localCredentialMissCode: "PROJECT_CREDENTIAL_NOT_FOUND",
},
{
operation: "projects.sql",
scope: "project",
plane: "data",
authModes: ["service_key"],
defaultAuthMode: "project_credential",
requiresProjectId: true,
mayUseLocalCredentialCache: true,
localCredentialMissCode: "PROJECT_CREDENTIAL_NOT_FOUND",
},
{
operation: "projects.rest",
scope: "project",
plane: "data",
authModes: ["anon_key", "service_key"],
defaultAuthMode: "project_credential",
requiresProjectId: true,
mayUseLocalCredentialCache: true,
localCredentialMissCode: "PROJECT_CREDENTIAL_NOT_FOUND",
},
{
operation: "domains.add",
scope: "project",
plane: "control",
authModes: ["principal", "grant_key", "service_key"],
defaultAuthMode: "principal",
requiresProjectId: true,
mayUseLocalCredentialCache: false,
},
{
operation: "domains.list",
scope: "project",
plane: "control",
authModes: ["principal", "grant_key", "service_key"],
defaultAuthMode: "principal",
requiresProjectId: true,
mayUseLocalCredentialCache: false,
},
{
operation: "domains.status",
scope: "project",
plane: "control",
authModes: ["principal", "grant_key", "service_key"],
defaultAuthMode: "principal",
requiresProjectId: true,
mayUseLocalCredentialCache: false,
},
{
operation: "domains.delete",
scope: "project",
plane: "control",
authModes: ["principal", "grant_key", "service_key"],
defaultAuthMode: "principal",
requiresProjectId: true,
mayUseLocalCredentialCache: false,
},
{
operation: "functions.*",
scope: "project",
plane: "control",
authModes: ["service_key"],
defaultAuthMode: "project_credential",
requiresProjectId: true,
mayUseLocalCredentialCache: true,
localCredentialMissCode: "PROJECT_CREDENTIAL_NOT_FOUND",
},
{
operation: "assets.*",
scope: "project",
plane: "data",
authModes: ["service_key"],
defaultAuthMode: "project_credential",
requiresProjectId: true,
mayUseLocalCredentialCache: true,
localCredentialMissCode: "PROJECT_CREDENTIAL_NOT_FOUND",
},
{
operation: "jobs.*",
scope: "project",
plane: "control",
authModes: ["service_key"],
defaultAuthMode: "project_credential",
requiresProjectId: true,
mayUseLocalCredentialCache: true,
localCredentialMissCode: "PROJECT_CREDENTIAL_NOT_FOUND",
},
];
export function projectOperationAuthClassification(operation) {
return PROJECT_OPERATION_AUTH_CLASSIFICATIONS.find((entry) => {
if (entry.operation === operation)
return true;
if (entry.operation.endsWith(".*"))
return operation.startsWith(entry.operation.slice(0, -1));
return false;
}) ?? null;
}
//# sourceMappingURL=project-auth-classification.js.map