Skip to content

docs: improve JWT configuration page #873

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

Merged
merged 2 commits into from
Feb 6, 2025
Merged

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

hasura-bot commented Feb 5, 2025

DX: Assertion Testing

✅ Diff

The PR introduces a detailed, structured configuration example using YAML, which is in line with modern practices and tends to be easier for users to understand than JSON. Replacing 'stringified_json' with 'StringifiedJson' improves consistency in naming conventions. The splitting of claims_namespace and related fields into claimsConfig with namespace and locations adds clarity to the configuration structure. However, a minor point of feedback is to consistently use either singular or plural for 'claims' and 'namespace' across the documentation to avoid confusion.

✅ Integrated

The PR’s updated YAML configuration is consistent with the rest of the documentation and maintains the same level of detail and clarity seen in other sections. It introduces additional security measures by providing a defaults example for new required fields like audience and issuer, improving the overall usability of JWT configuration in the documentation. Also, the transition from loosely defined key types to specific fixed and jwkFromUrl key configurations simplifies the user's decision-making process and helps prevent potential misconfigurations. The integrated changes create a more straightforward, user-friendly guide that is beneficial for new and 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
Contributor

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.

Copy link

Deploying ddn-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 127d57c
Status:⚡️  Build in progress...

View logs

@seanparkross seanparkross enabled auto-merge (squash) February 6, 2025 13:58
@seanparkross seanparkross merged commit 6b0c0e3 into main Feb 6, 2025
3 of 4 checks passed
@seanparkross seanparkross deleted the fix-jwt-auth-configuration branch February 6, 2025 14:01
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