SmapiAuthTokens that expire, with sonos refreshAuthToken functionality (#81)

Bearer token to Authorization header for stream requests
Versioned SMAPI Tokens
This commit is contained in:
Simon J
2021-12-02 11:03:52 +11:00
committed by GitHub
parent 89340dd454
commit d1300b8119
24 changed files with 1792 additions and 1330 deletions

View File

@@ -18,7 +18,7 @@ describe("InMemoryLinkCodes", () => {
describe('when token is valid', () => {
it('should associate the token', () => {
const linkCode = linkCodes.mint();
const association = { authToken: "token123", nickname: "bob", userId: "1" };
const association = { serviceToken: "token123", nickname: "bob", userId: "1" };
linkCodes.associate(linkCode, association);
@@ -29,7 +29,7 @@ describe("InMemoryLinkCodes", () => {
describe('when token is valid', () => {
it('should throw an error', () => {
const invalidLinkCode = "invalidLinkCode";
const association = { authToken: "token456", nickname: "bob", userId: "1" };
const association = { serviceToken: "token456", nickname: "bob", userId: "1" };
expect(() => linkCodes.associate(invalidLinkCode, association)).toThrow(`Invalid linkCode ${invalidLinkCode}`)
});