Skip to content

Replace jwx with manual RS256 JWT signing#18

Open
imhben wants to merge 9 commits intomainfrom
fix/nsc-schema
Open

Replace jwx with manual RS256 JWT signing#18
imhben wants to merge 9 commits intomainfrom
fix/nsc-schema

Conversation

@imhben
Copy link
Copy Markdown
Contributor

@imhben imhben commented Apr 1, 2026

Stop using lestrrat-go/jwx for building/signing the client assertion JWT and instead construct and sign the JWT manually. The code now marshals a RS256 header and the claims (iss, sub, aud, jti, iat, exp), base64-url encodes header and payload, computes a SHA-256 digest of the signing input, and signs with rsa.SignPKCS1v15. Imports were updated accordingly (added crypto, rand, sha256, encoding/base64; removed jwa/jwt). Error messages were adjusted to reflect the new steps. This removes the jwx dependency while preserving the original JWT claims and lifetime.

Stop using lestrrat-go/jwx for building/signing the client assertion JWT and instead construct and sign the JWT manually. The code now marshals a RS256 header and the claims (iss, sub, aud, jti, iat, exp), base64-url encodes header and payload, computes a SHA-256 digest of the signing input, and signs with rsa.SignPKCS1v15. Imports were updated accordingly (added crypto, rand, sha256, encoding/base64; removed jwa/jwt). Error messages were adjusted to reflect the new steps. This removes the jwx dependency while preserving the original JWT claims and lifetime.
iannorriswork and others added 2 commits April 1, 2026 14:40
* [FFS-4030] fix bug with sending json over

* logger context tweaking

* fix json format

* merging despite formatter errors because they were pre-existing conditions
---------

Co-authored-by: Ian Norris <iannorris@Ians-MacBook-Pro.local>
…#19)

* [FFS-3970] move documentation around and make sure instructions clear

* fold in request id header

---------

Co-authored-by: Ian Norris <iannorris@Ians-MacBook-Pro.local>
Code string `json:"code"`
}

func mapLegacyEnrollmentStatus(respBytes []byte) (SchoolEnrollmentStatus, error) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this test is a duplicate of the code--> can we refactor these test cases into seperate, legible tests explaining why we are testing the different responses?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

These have been split up now

Copy link
Copy Markdown
Contributor

@iannorriswork iannorriswork left a comment

Choose a reason for hiding this comment

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

split the oauth changes from the enrollment code checks

j-shilling and others added 6 commits April 3, 2026 08:41
* chore: pin audited pnpm transitive deps

* ci: add pnpm audit workflow

* Try setting up pnpm earlier

* Do not cache pnpm deps
Stop using lestrrat-go/jwx for building/signing the client assertion JWT and instead construct and sign the JWT manually. The code now marshals a RS256 header and the claims (iss, sub, aud, jti, iat, exp), base64-url encodes header and payload, computes a SHA-256 digest of the signing input, and signs with rsa.SignPKCS1v15. Imports were updated accordingly (added crypto, rand, sha256, encoding/base64; removed jwa/jwt). Error messages were adjusted to reflect the new steps. This removes the jwx dependency while preserving the original JWT claims and lifetime.
Stop using lestrrat-go/jwx for building/signing the client assertion JWT and instead construct and sign the JWT manually. The code now marshals a RS256 header and the claims (iss, sub, aud, jti, iat, exp), base64-url encodes header and payload, computes a SHA-256 digest of the signing input, and signs with rsa.SignPKCS1v15. Imports were updated accordingly (added crypto, rand, sha256, encoding/base64; removed jwa/jwt). Error messages were adjusted to reflect the new steps. This removes the jwx dependency while preserving the original JWT claims and lifetime.
Update education submit logic and tests to use the unified Response type, introduce typed errors for legacy NSC status handling, and consolidate duplicated legacy mapping code. Changes include: add errLegacyEnrollmentStatusRequired and errUnsupportedLegacyNSCStatusCode, return Response instead of EducationResponse on submit failure, deduplicate and simplify mapLegacyEnrollmentStatus to return typed errors (wrapping unsupported codes), add nolint for translateNSCResponse, and update tests to use the new education.Response type. Also add a nolint tag comment to the veteran Response CombinedDisabilityRating field to satisfy linting for external JSON tag casing.
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