-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TokenHandler.js Implement token validator; move OAuthTransferToken de…
…f to top. TokenHandler.test.js Minimal testing of token handler
- Loading branch information
Anthony Ramirez
committed
Jan 21, 2025
1 parent
5405b66
commit ab4b222
Showing
2 changed files
with
67 additions
and
10 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
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { expect } from "chai"; | ||
import OAuthTokenHandler, { AccessTokenType } from "../services/auth/TokenHandler.js"; | ||
|
||
describe("OAuthTokenHandler provided unsupported resource server", () => { | ||
let test_token; | ||
beforeEach(() => { | ||
test_token = { | ||
data: { | ||
resource_server: "test.resource.server", | ||
other_tokens: [], | ||
access_token: "test.access_token", | ||
refresh_token: "test.refresh_token", | ||
expires_in: 123456789, | ||
scope: "test email", | ||
}, | ||
}; | ||
}); | ||
it("should throw an error during construction", () => { | ||
expect(() => { | ||
const token_handler = new OAuthTokenHandler(test_token); | ||
}).to.throw("Unsupported token"); | ||
}); | ||
}); |