AppMage

SecretsManagerRpc

SecretsManagerRpc exposes browser-facing RPC endpoints for listing, creating, updating, and deleting secrets through the SecretsManager feature. It is designed to return metadata only; secret values are not returned to the browser by the documented list endpoint. The class also provides a small helper endpoint for scope-filter UI options.

Endpoints

POST /api/rpc (Method: SecretsManagerRpc.getData)

  • Description: List all secrets, returning metadata only and excluding secret values, for the current subscription.

  • Request Body:

    {
      "method": "SecretsManagerRpc.getData",
      "params": {
        "scope": "subscription",
        "projectId": "string",
        "agentName": "string",
        "page": 1,
        "pageSize": 50
      }
    }
  • Parameters:

    Name Type Required Description
    scope String No Filters secrets by scope. Allowed values are subscription, project, and agent.
    projectId String No Optional project identifier used when filtering project-scoped secrets. May be null.
    agentName String No Optional agent name used when filtering agent-scoped secrets. May be null.
    page Number No Page number for pagination. Defaults to 1. Must be a positive integer.
    pageSize Number No Number of results per page. Defaults to 50. Must be a positive integer.
  • Response:

    {
      "success": true,
      "data": "implementation-defined metadata list returned by the connector"
    }
  • Example (cURL):

    curl -X POST "${APP_BASE_URL}/api/rpc" \
      -H "Content-Type: application/json" \
      -d '{
        "method": "SecretsManagerRpc.getData",
        "params": {
          "scope": "subscription",
          "page": 1,
          "pageSize": 50
        }
      }'

POST /api/rpc (Method: SecretsManagerRpc.create)

  • Description: Create or update a secret. The value is encrypted server-side before storage.

  • Request Body:

    {
      "method": "SecretsManagerRpc.create",
      "params": {
        "scope": "subscription",
        "projectId": "string",
        "agentName": "string",
        "key": "string",
        "value": "string",
        "label": "string",
        "description": "string"
      }
    }
  • Parameters:

    Name Type Required Description
    scope String Yes Secret scope. Allowed values are subscription, project, and agent.
    projectId String No Optional project identifier. May be null.
    agentName String No Optional agent name. May be null.
    key String Yes Secret key name. Must be a non-empty string.
    value String Yes Secret value. Must be a non-empty string.
    label String No Optional display label. May be null.
    description String No Optional description. May be null.
  • Response:

    {
      "success": true,
      "data": "implementation-defined result returned by the connector"
    }
  • Example (cURL):

    curl -X POST "${APP_BASE_URL}/api/rpc" \
      -H "Content-Type: application/json" \
      -d '{
        "method": "SecretsManagerRpc.create",
        "params": {
          "scope": "project",
          "projectId": "demo-project",
          "key": "API_KEY",
          "value": "secret-value",
          "label": "External API key",
          "description": "Used by the integration layer"
        }
      }'

POST /api/rpc (Method: SecretsManagerRpc.update)

  • Description: Update secret metadata such as label and description. If value is supplied, the method treats the request as a value rotation and delegates to the same create-or-update flow used by SecretsManagerRpc.create. If value is omitted, the method attempts a metadata-only update.

  • Request Body:

    {
      "method": "SecretsManagerRpc.update",
      "params": {
        "_id": "string",
        "label": "string",
        "description": "string",
        "value": "string",
        "scope": "subscription",
        "projectId": "string",
        "agentName": "string",
        "key": "string"
      }
    }
  • Parameters:

    Name Type Required Description
    _id String Yes Secret identifier.
    label String No Optional display label. May be null.
    description String No Optional description. May be null.
    value String No Optional secret value. When present, the method rotates the stored value by delegating to the create-or-update path. May be null.
    scope String No Optional secret scope used when rotating a value. Allowed values are subscription, project, and agent.
    projectId String No Optional project identifier used when rotating a value. May be null.
    agentName String No Optional agent name used when rotating a value. May be null.
    key String No Optional secret key used when rotating a value.
  • Response:

    {
      "success": true,
      "data": "implementation-defined result returned by the connector, or a fallback object for metadata-only attempts"
    }
  • Example (cURL):

    curl -X POST "${APP_BASE_URL}/api/rpc" \
      -H "Content-Type: application/json" \
      -d '{
        "method": "SecretsManagerRpc.update",
        "params": {
          "_id": "66f1d2...",
          "label": "Updated label",
          "description": "Updated description"
        }
      }'

POST /api/rpc (Method: SecretsManagerRpc.delete)

  • Description: Delete a secret by its _id.

  • Request Body:

    {
      "method": "SecretsManagerRpc.delete",
      "params": {
        "_id": "string"
      }
    }
  • Parameters:

    Name Type Required Description
    _id String Yes Secret identifier to delete.
  • Response:

    {
      "success": true,
      "data": "implementation-defined result returned by the connector"
    }
  • Example (cURL):

    curl -X POST "${APP_BASE_URL}/api/rpc" \
      -H "Content-Type: application/json" \
      -d '{
        "method": "SecretsManagerRpc.delete",
        "params": {
          "_id": "66f1d2..."
        }
      }'

POST /api/rpc (Method: SecretsManagerRpc.getScopeOptions)

  • Description: Returns scope options for filter dropdowns.

  • Request Body:

    {
      "method": "SecretsManagerRpc.getScopeOptions",
      "params": {}
    }
  • Parameters:

    Name Type Required Description
    No parameters This method does not accept any request parameters.
  • Response:

    {
      "success": true,
      "data": [
        {
          "value": "subscription",
          "label": "Subscription — shared across all agents"
        },
        {
          "value": "project",
          "label": "Project — scoped to a specific project"
        },
        {
          "value": "agent",
          "label": "Agent — private to a specific agent"
        }
      ]
    }
  • Example (cURL):

    curl -X POST "${APP_BASE_URL}/api/rpc" \
      -H "Content-Type: application/json" \
      -d '{
        "method": "SecretsManagerRpc.getScopeOptions",
        "params": {}
      }'