mirror of
https://github.com/wkulhanek/bonob.git
synced 2025-12-21 17:33:29 +01:00
arm64 and amd64 image support (#88)
* Ability to build arm7 docker image using buildx * Build arm64 and amd64 images
This commit is contained in:
@@ -63,24 +63,25 @@ describe("auth", () => {
|
||||
|
||||
const expiresIn = "1h";
|
||||
const secret = `secret-${uuid()}`;
|
||||
const smapiLoginTokens = new JWTSmapiLoginTokens(clock, secret, expiresIn);
|
||||
const key = uuid();
|
||||
const smapiLoginTokens = new JWTSmapiLoginTokens(clock, secret, expiresIn, () => key);
|
||||
|
||||
describe("issuing a new token", () => {
|
||||
it("should issue a token that can then be verified", () => {
|
||||
const serviceToken = uuid();
|
||||
const serviceToken = `service-token-${uuid()}`;
|
||||
|
||||
const smapiToken = smapiLoginTokens.issue(serviceToken);
|
||||
|
||||
expect(smapiToken.token).toEqual(
|
||||
jwt.sign(
|
||||
{
|
||||
serviceToken,
|
||||
iat: Math.floor(clock.now().toDate().getDate() / 1000),
|
||||
},
|
||||
secret + SMAPI_TOKEN_VERSION + smapiToken.key,
|
||||
{ expiresIn }
|
||||
)
|
||||
const expected = jwt.sign(
|
||||
{
|
||||
serviceToken,
|
||||
iat: clock.now().unix(),
|
||||
},
|
||||
secret + SMAPI_TOKEN_VERSION + key,
|
||||
{ expiresIn }
|
||||
);
|
||||
|
||||
expect(smapiToken.token).toEqual(expected);
|
||||
expect(smapiToken.token).not.toContain(serviceToken);
|
||||
expect(smapiToken.token).not.toContain(secret);
|
||||
expect(smapiToken.token).not.toContain(":");
|
||||
@@ -100,7 +101,7 @@ describe("auth", () => {
|
||||
clock,
|
||||
secret,
|
||||
expiresIn,
|
||||
() => uuid(),
|
||||
uuid,
|
||||
SMAPI_TOKEN_VERSION
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user