Skip to content

Conversation

@Earl0fPudding
Copy link
Contributor

@Earl0fPudding Earl0fPudding commented Aug 29, 2025

Hi Xe,

It's me again.
This change adds the DIFFICULTY_IN_JWT option, which allows one to add the difficulty field in the JWT claims which indicates with which difficulty the token has been generated.

In my case, I need it for routing my requests to Anubis in HAProxy based on this field. It can also be used for debugging purposes and so on.

Please let me know if this is OK or a separate test case is needed.

This is not a breaking change as this new option is false by default. I also simplified the MapClaims logic a bit.

Many thanks,
Martin

Checklist:

  • Added a description of the changes to the [Unreleased] section of docs/docs/CHANGELOG.md
  • Added test cases to the relevant parts of the codebase
  • Ran integration tests npm run test:integration (unsupported on Windows, please use WSL)

@Earl0fPudding Earl0fPudding changed the title Add option for adding difficulty field to JWT claims feat(lib): Add option for adding difficulty field to JWT claims Aug 29, 2025
@Earl0fPudding
Copy link
Contributor Author

Spelling and translation were needed for the checks to pass. It has nothing to do with my changes per se.

@Xe Xe force-pushed the difficulty-jtw-field branch from 8018e95 to 54c6cd5 Compare September 11, 2025 13:42
@Xe Xe enabled auto-merge (squash) September 11, 2025 13:46
@Xe Xe merged commit 8ed89a6 into TecharoHQ:main Sep 11, 2025
11 checks passed
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.

2 participants