Skip to content

[Bug]: A GraphQL API's upstream auth never reaches the backend, and the deployment stores it in plaintext #4292

Open

Description

@randilt

Please select the area the issue is related to

Gateway, Platform API

Please select the aspect the issue is related to

Aspect/API (API backends, definitions, contracts, interfaces, OpenAPI)

Description

A GraphQL API's upstream credential (upstream.main.auth) never reaches the backend. Unlike REST APIs, platform-api does put it in the deployment, but the gateway drops it. There are two problems:

  1. The backend gets no credential. The gateway's copy of the API has no auth under upstream.main, and the backend receives no Authorization header. The gateway's Upstream schema (gateway/gateway-controller/api/management-openapi.yaml:4489) has no auth field, so the block is discarded.
  2. The credential is stored in plaintext. The deployment artifact platform-api keeps (the deployments.content row) holds the value in clear text:
spec:
    displayName: b12-gql
    version: v1
    context: /b12
    upstream:
        main:
            url: http://192.168.5.2:8095/graphql
            auth:
                type: bearer
                header: ""
                value: gql-backend-token

Expected: the backend receives the credential, and platform-api stores it as a secret reference rather than as plaintext in the deployment.
Actual: the credential is dropped on the gateway and kept in plaintext in platform-api's database.

Steps to Reproduce

  1. Create a GraphQL API with an upstream bearer credential. POST /api/v0.9/graphql-apis takes multipart/form-data with a metadata part:
    {"id":"b12-gql","displayName":"b12-gql","context":"/b12","version":"v1","projectId":"default","schemaSource":"inline","sdl":"type Query { hello: String }","upstream":{"main":{"url":"<echo-backend>/graphql","auth":{"type":"bearer","value":"gql-backend-token"}}}}. It returns 201.
  2. Deploy it: POST /api/v0.9/graphql-apis/b12-gql/deployments with {"name":"d1","base":"current","gatewayId":"<gateway-id>"}. Wait for DEPLOYED.
  3. Read the stored artifact for that deployment from platform-api's database: SELECT content FROM deployments WHERE uuid='<deploymentId>'. It contains value: gql-backend-token, as shown above.
  4. The gateway's copy (GET /api/management/v1/graphql-apis on the gateway controller) shows "upstream":{"main":{"url":"<echo-backend>/graphql"}} with no auth.
  5. Call the API through the gateway: POST <router>/b12 with {"query":"{hello}"}. It returns 200, and the echo backend shows no Authorization header.

Severity Level of the Issue

Severity/Major (Important functionality is broken. Should be prioritized. Doesn't need immediate attention)

Environment Details (with versions)

  • Source: main at f5c93849.
  • platform-api built from source (SQLite).
  • Gateway images (gateway-controller / gateway-runtime 2026.09.24) built from that commit.
  • Echo backend: ghcr.io/wso2/api-platform/sample-service:latest.
  • macOS with Rancher Desktop.

Activity

  1. added theissue type on Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions