Loading sources/src/develocity/short-lived-token.ts +1 −1 Changes for sources/src/develocity/short-lived-token.ts: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -72,7 +72,7 @@ class ShortLivedTokenClient { retryInterval = 1000 async fetchToken(serverUrl: string, accessKey: HostnameAccessKey, expiry: string): Promise<HostnameAccessKey> { const queryParams = expiry ? `?expiresInHours${expiry}` : '' const queryParams = expiry ? `?expiresInHours=${expiry}` : '' const sanitizedServerUrl = !serverUrl.endsWith('/') ? `${serverUrl}/` : serverUrl const headers = { 'Content-Type': 'application/json', Loading sources/test/jest/short-lived-token.test.ts +10 Changes for sources/test/jest/short-lived-token.test.ts: 10 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -114,4 +114,14 @@ describe('short lived tokens', () => { .resolves .toBeNull() }) it('get short lived token with custom expiry', async () => { nock('https://dev') .post('/api/auth/token?expiresInHours=4') .reply(200, 'token') expect.assertions(1) await expect(getToken('dev=key1', '4')) .resolves .toEqual({"keys": [{"hostname": "dev", "key": "token"}]}) }) }) Loading
sources/src/develocity/short-lived-token.ts +1 −1 Changes for sources/src/develocity/short-lived-token.ts: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -72,7 +72,7 @@ class ShortLivedTokenClient { retryInterval = 1000 async fetchToken(serverUrl: string, accessKey: HostnameAccessKey, expiry: string): Promise<HostnameAccessKey> { const queryParams = expiry ? `?expiresInHours${expiry}` : '' const queryParams = expiry ? `?expiresInHours=${expiry}` : '' const sanitizedServerUrl = !serverUrl.endsWith('/') ? `${serverUrl}/` : serverUrl const headers = { 'Content-Type': 'application/json', Loading
sources/test/jest/short-lived-token.test.ts +10 Changes for sources/test/jest/short-lived-token.test.ts: 10 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -114,4 +114,14 @@ describe('short lived tokens', () => { .resolves .toBeNull() }) it('get short lived token with custom expiry', async () => { nock('https://dev') .post('/api/auth/token?expiresInHours=4') .reply(200, 'token') expect.assertions(1) await expect(getToken('dev=key1', '4')) .resolves .toEqual({"keys": [{"hostname": "dev", "key": "token"}]}) }) })