Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: improve JWT configuration page #873

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hgiasac
Copy link
Contributor

@hgiasac hgiasac commented Feb 5, 2025

Description 📝

Many JWT configurations in Hasura v2 are no longer valid in Hasura DDN. This PR rewrites the JWT configuration page to improve the correctness.

Quick Links 🚀

https://fix-jwt-auth-configuration.v3-docs-eny.pages.dev/auth/jwt/jwt-configuration/

Assertion Tests 🤖

@hasura-bot
Copy link
Contributor

@hgiasac Thanks for your PR! I've assigned @seanparkross to review it.

@hasura-bot
Copy link
Contributor

DX: Assertion Testing

✅ Diff

The changes in the PR provide a more structured and modern configuration format for JWT by replacing JSON with YAML and making certain fields clearer. This will likely improve the usability for users who prefer YAML syntax and those who find declarative configurations more intuitive. You have effectively split individual concerns into their specific configuration areas, such as 'claimsConfig' for claim-related settings and 'tokenLocation' for specifying the JWT location in the request. The replacement of the 'type' and 'key' minimum presence check with 'claimsConfig', 'tokenLocation', and 'key' is another positive change as it makes the minimum requirement more explicit.

✅ Integrated

The PR successfully integrates the piecewise updates into the overarching configuration documentation. The transition to the new format occurs across all relevant sections, maintaining overall consistency and coherence. The provided examples are in sync with the updated schema and should greatly help users to correctly configure JWT authentication. Furthermore, the PR maintains continuity with existing JWT claims and fields, only changing the way they are represented rather than the underlying functionality, which should ensure backward compatibility and ease of adoption for existing users.

"allowed_skew": "optional-number-of-seconds-in-integer",
"header": "optional-key-to-indicate-cookie-or-authorization-header"
}
```yaml title="globals/metadata/auth-config.hml"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hgiasac So this section has changed to be about the AuthConfig definition rather than the JWT token definition. Do we not need a JWT payload definition also?

Copy link
Contributor Author

@hgiasac hgiasac Feb 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. That JWT definition is a JSON string in v2 when configuring the HASURA_GRAPHQL_JWT_SECRET env variable. In Hasura DDN, JWT is just an auth mode of AuthConfig and the syntax is different from v2.

We can link the definition to the JWT section in AuthConfig reference instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants