v1.1.0 Fixed key generation by using correct generation for timestamp format
This commit is contained in:
parent
18605dfc64
commit
6a236c5d68
@ -1,4 +1,5 @@
|
|||||||
const crypto = require('node:crypto');
|
const crypto = require('node:crypto');
|
||||||
|
const { DateTime } = require('luxon');
|
||||||
|
|
||||||
class EncryptionHelper {
|
class EncryptionHelper {
|
||||||
static encryptDataAESGCM(plainText, key) {
|
static encryptDataAESGCM(plainText, key) {
|
||||||
@ -17,8 +18,9 @@ class EncryptionHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static makeEncryptedParameter(username, key) {
|
static makeEncryptedParameter(username, key) {
|
||||||
const timestamp = new Date().toISOString().replace('T', ' ').split('.')[0];
|
const timestamp = DateTime.now().setZone('Europe/Berlin');
|
||||||
const plainText = `${timestamp} ${username}`;
|
const tsFormatted = timestamp.toFormat('yyyy-MM-dd HH:mm:ss');
|
||||||
|
const plainText = `${tsFormatted} ${username}`;
|
||||||
|
|
||||||
const hash = crypto.createHash('sha256').update(key, 'utf8').digest();
|
const hash = crypto.createHash('sha256').update(key, 'utf8').digest();
|
||||||
const encryptedData = this.encryptDataAESGCM(plainText, hash);
|
const encryptedData = this.encryptDataAESGCM(plainText, hash);
|
||||||
|
12
npm-shrinkwrap.json
generated
12
npm-shrinkwrap.json
generated
@ -1,16 +1,16 @@
|
|||||||
{
|
{
|
||||||
"name": "virtueller-stundenplan",
|
"name": "virtueller-stundenplan",
|
||||||
"version": "1.0.0",
|
"version": "1.1.0",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "virtueller-stundenplan",
|
"name": "virtueller-stundenplan",
|
||||||
"version": "1.0.0",
|
"version": "1.1.0",
|
||||||
"license": "CC-BY-NC-4.0",
|
"license": "CC-BY-NC-4.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^1.8.4",
|
"axios": "^1.8.4",
|
||||||
"luxon": "^3.5.0"
|
"luxon": "^3.6.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/asynckit": {
|
"node_modules/asynckit": {
|
||||||
@ -256,9 +256,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/luxon": {
|
"node_modules/luxon": {
|
||||||
"version": "3.5.0",
|
"version": "3.6.1",
|
||||||
"resolved": "https://registry.npmjs.org/luxon/-/luxon-3.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/luxon/-/luxon-3.6.1.tgz",
|
||||||
"integrity": "sha512-rh+Zjr6DNfUYR3bPwJEnuwDdqMbxZW7LOQfUN4B54+Cl+0o5zaU9RJ6bcidfDtC1cWCZXQ+nvX8bf6bAji37QQ==",
|
"integrity": "sha512-tJLxrKJhO2ukZ5z0gyjY1zPh3Rh88Ej9P7jNrZiHMUXHae1yvI2imgOZtL1TO8TW6biMMKfTtAOoEJANgtWBMQ==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=12"
|
"node": ">=12"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "virtueller-stundenplan",
|
"name": "virtueller-stundenplan",
|
||||||
"version": "1.0.0",
|
"version": "1.1.0",
|
||||||
"description": "A library to access the data from virtueller-stundenplan.org",
|
"description": "A library to access the data from virtueller-stundenplan.org",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@ -19,6 +19,6 @@
|
|||||||
"license": "CC-BY-NC-4.0",
|
"license": "CC-BY-NC-4.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^1.8.4",
|
"axios": "^1.8.4",
|
||||||
"luxon": "^3.5.0"
|
"luxon": "^3.6.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user