dgraph-io / dgraph-io/dgraph

JWKS URL Parsing Fails [v24.0.5]

Open
#9,272 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Stale
Dominant language
Go
Stars
21.8k
Forks
1.6k
Avg merge
2d 5h
Merged PRs (30d)
9

Description

JWKS URL Parsing

Updating schema over /admin/endpoint with a dash separated subdomain fails and results in the below error.

{
    "errors": [
        {
            "message": "resolving updateGQLSchema failed because invalid character 'p' after top-level value (Locations: [{Line: 3, Column: 4}])",
            "extensions": {
                "code": "Error"
            }
        }
    ]
}

The following url would work in v23 and migrating to v24.0.5 schema validation threw an error:

# Dgraph.Authorization {"jwkurl": "https://dash-seperated-subdomain-api.example.com/.well-known/jwks"}

To Reproduce

Add a subdomain such as to the schema.graphql file and update the schema over the /admin/schema endpoint.

# Dgraph.Authorization {"jwkurl": "https://dash-seperated-subdomain-api.example.com/.well-known/jwks"}

this behavior is the same when using multiple urls as in

# Dgraph.Authorization {"jwkurls": ["https://dash-seperated-subdomain-api.example.com/.well-known/jwks"]}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure through the /admin/schema endpoint using the schema.graphql examples with dashed subdomains, testing both jwkurl and jwkurls. Trace the JWKS URL parsing and schema validation path; done means both forms accept the shown URL and schema updates succeed.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, graphql
Domain
databases, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.