forked from inrupt/solid-client-authn-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixing issue "URL query parameters do not get removed in htu field in…
- Loading branch information
1 parent
93ac2d4
commit b26d0cf
Showing
2 changed files
with
16 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,6 +66,19 @@ describe("createDpopHeader", () => { | |
expect(payload.htu).toBe("https://some.resource/"); | ||
}); | ||
|
||
it("creates a JWT with 'htu' that needs to be normalized", async () => { | ||
const header = await createDpopHeader( | ||
"https://user:[email protected]/?query#hash", | ||
"GET", | ||
await mockKeyPair() | ||
); | ||
const { payload } = await jwtVerify(header, (await mockJwk()).publicKey); | ||
expect(payload.htm).toBe("GET"); | ||
expect(payload.jti).toBeDefined(); | ||
// The IRI is normalized, hence the trailing '/' | ||
expect(payload.htu).toBe("https://some.resource/"); | ||
}); | ||
|
||
it("creates a JWT with the appropriate protected header", async () => { | ||
const header = await createDpopHeader( | ||
"https://some.resource", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters