mirror of
https://github.com/karl0ss/homepage.git
synced 2025-05-03 22:13:39 +01:00
finished linting
This commit is contained in:
parent
c692eb700f
commit
60dc38e6c4
@ -1,13 +1,13 @@
|
|||||||
/* eslint-disable no-underscore-dangle */
|
/* eslint-disable no-underscore-dangle */
|
||||||
import crypto from 'crypto';
|
import crypto from 'crypto';
|
||||||
import querystring from 'querystring';
|
import querystring from 'querystring';
|
||||||
|
|
||||||
import { sha256, uniqueRid, validateRid, createEncryptionToken, decrypt, encrypt } from "./tools"
|
import { sha256, uniqueRid, validateRid, createEncryptionToken, decrypt, encrypt } from "./tools"
|
||||||
|
|
||||||
import getServiceWidget from "utils/config/service-helpers";
|
import getServiceWidget from "utils/config/service-helpers";
|
||||||
import { httpProxy } from "utils/proxy/http";
|
import { httpProxy } from "utils/proxy/http";
|
||||||
import createLogger from "utils/logger";
|
import createLogger from "utils/logger";
|
||||||
|
|
||||||
|
|
||||||
const proxyName = "jdownloaderProxyHandler";
|
const proxyName = "jdownloaderProxyHandler";
|
||||||
const logger = createLogger(proxyName);
|
const logger = createLogger(proxyName);
|
||||||
|
|
||||||
@ -28,7 +28,8 @@ async function getWidget(req) {
|
|||||||
|
|
||||||
async function login(loginSecret, deviceSecret, params) {
|
async function login(loginSecret, deviceSecret, params) {
|
||||||
const rid = uniqueRid();
|
const rid = uniqueRid();
|
||||||
const path = `/my/connect?${querystring.stringify(Object.assign({}, params, { rid }))}`;
|
const path = `/my/connect?${querystring.stringify({...params, rid})}`;
|
||||||
|
|
||||||
const signature = crypto
|
const signature = crypto
|
||||||
.createHmac('sha256', loginSecret)
|
.createHmac('sha256', loginSecret)
|
||||||
.update(path)
|
.update(path)
|
||||||
@ -63,7 +64,7 @@ async function login(loginSecret, deviceSecret, params) {
|
|||||||
|
|
||||||
async function getDevice(serverEncryptionToken, deviceName, params) {
|
async function getDevice(serverEncryptionToken, deviceName, params) {
|
||||||
const rid = uniqueRid();
|
const rid = uniqueRid();
|
||||||
const path = `/my/listdevices?${querystring.stringify(Object.assign({}, params, { rid }))}`;
|
const path = `/my/listdevices?${querystring.stringify({...params, rid})}`;
|
||||||
const signature = crypto
|
const signature = crypto
|
||||||
.createHmac('sha256', serverEncryptionToken)
|
.createHmac('sha256', serverEncryptionToken)
|
||||||
.update(path)
|
.update(path)
|
||||||
@ -99,7 +100,7 @@ function createBody(rid, query, params) {
|
|||||||
rid,
|
rid,
|
||||||
url: query
|
url: query
|
||||||
};
|
};
|
||||||
return params ? Object.assign({}, baseBody, { params: [JSON.stringify(params)] }) : baseBody;
|
return params ? {...baseBody, params: [JSON.stringify(params)] } : baseBody;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function queryPackages(deviceEncryptionToken, deviceId, sessionToken, params) {
|
async function queryPackages(deviceEncryptionToken, deviceId, sessionToken, params) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user