Skip to content

Commit

Permalink
chore: proposal to remove dep
Browse files Browse the repository at this point in the history
  • Loading branch information
alban bertolini authored and alban bertolini committed Mar 8, 2024
1 parent 9ddd0db commit a49ac73
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"json-diff": "1.0.0",
"jsonapi-serializer": "3.6.2",
"jsonwebtoken": "8.5.1",
"jwt-decode": "2.2.0",
"lodash": "4.17.21",
"mkdirp": "1.0.4",
"mongodb": "4.17.2",
Expand Down
13 changes: 9 additions & 4 deletions test/fixtures/api.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const nock = require('nock');
const jwt = require('jsonwebtoken');
const ProjectSerializer = require('../../src/serializers/project');
const EnvironmentSerializer = require('../../src/serializers/environment');
const JobSerializer = require('../../src/serializers/job');
Expand Down Expand Up @@ -140,13 +139,15 @@ function authenticationFailed(scope) {
* @param {import('nock').Scope} scope
*/
function authenticationSucceeded(scope) {
const a =
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3MDk5MDUwMTgsImV4cCI6MTcwOTk5MTQxOH0.EuQsuKhEGyEm4MXCZKMuFyk6V9bDM8wnrWcZ05mnp0c';
return scope
.post(
'/oidc/token',
'grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Adevice_code&device_code=DEVICE-CODE&client_id=the-client-id',
)
.reply(200, {
access_token: jwt.sign({}, 'key', { expiresIn: '1day' }),
access_token: a,
});
}

Expand All @@ -169,7 +170,8 @@ function createAuthenticationToken(scope) {
data: {
id: 42,
attributes: {
token: jwt.sign({}, 'key', { expiresIn: '1day' }),
token:
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3MDk5MDUwMTgsImV4cCI6MTcwOTk5MTQxOH0.EuQsuKhEGyEm4MXCZKMuFyk6V9bDM8wnrWcZ05mnp0c',
},
},
});
Expand Down Expand Up @@ -203,7 +205,10 @@ module.exports = {
loginValid: () =>
nock('http://localhost:3001')
.post('/api/sessions', { email: '[email protected]', password: 'valid_pwd' })
.reply(200, { token: jwt.sign({}, 'key', { expiresIn: '1day' }) }),
.reply(200, {
token:
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3MDk5MDUwMTgsImV4cCI6MTcwOTk5MTQxOH0.EuQsuKhEGyEm4MXCZKMuFyk6V9bDM8wnrWcZ05mnp0c',
}),

loginInvalid: () =>
nock('http://localhost:3001')
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8065,11 +8065,6 @@ jws@^4.0.0:
jwa "^2.0.0"
safe-buffer "^5.0.1"

[email protected]:
version "2.2.0"
resolved "https://registry.yarnpkg.com/jwt-decode/-/jwt-decode-2.2.0.tgz#7d86bd56679f58ce6a84704a657dd392bba81a79"
integrity sha512-86GgN2vzfUu7m9Wcj63iUkuDzFNYFVmjeDm2GzWpUk+opB0pEpMsw6ePCMrhYkumz2C1ihqtZzOMAg7FiXcNoQ==

keytar@^7.3.0:
version "7.9.0"
resolved "https://registry.yarnpkg.com/keytar/-/keytar-7.9.0.tgz#4c6225708f51b50cbf77c5aae81721964c2918cb"
Expand Down

0 comments on commit a49ac73

Please sign in to comment.