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