mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
core: fix storage sign
This commit is contained in:
11 files changed
+38
-25
No files matched your search
+2
-2
@@ -17,9 +17,9 @@ const withoutTypes = (data) => ({
|
||||
const compilerOptionsBase = {
|
||||
target: 'es2022',
|
||||
lib: ['es2022'],
|
||||
module: 'commonjs',
|
||||
module: 'preserve',
|
||||
esModuleInterop: true,
|
||||
moduleResolution: 'node',
|
||||
moduleResolution: 'bundler',
|
||||
jsx: 'react',
|
||||
sourceMap: false,
|
||||
composite: true,
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"license": "MIT",
|
||||
"main": "react.yaml",
|
||||
"dependencies": {
|
||||
"@stylistic/eslint-plugin": "^3.1.0",
|
||||
"@stylistic/eslint-plugin": "^4.2.0",
|
||||
"@typescript-eslint/eslint-plugin": "^8.26.0",
|
||||
"@typescript-eslint/parser": "^8.26.0",
|
||||
"eslint-config-airbnb": "^19.0.4",
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
"@aws-sdk/lib-storage": "3.726.1",
|
||||
"@aws-sdk/s3-presigned-post": "3.726.1",
|
||||
"@aws-sdk/s3-request-presigner": "3.726.1",
|
||||
"@cordisjs/core": "4.0.0-alpha.2",
|
||||
"@cordisjs/logger": "1.0.0-alpha.1",
|
||||
"@cordisjs/core": "4.0.0-alpha.3",
|
||||
"@cordisjs/logger": "1.0.0-alpha.2",
|
||||
"@cordisjs/plugin-timer": "1.0.0-alpha.0",
|
||||
"@graphql-tools/schema": "^10.0.21",
|
||||
"@hydrooj/common": "workspace:^",
|
||||
@@ -43,7 +43,7 @@
|
||||
"moment-timezone": "^0.5.47",
|
||||
"mongodb": "^5.9.2",
|
||||
"mongodb-uri": "^0.9.7",
|
||||
"nanoid": "^5.1.2",
|
||||
"nanoid": "^5.1.3",
|
||||
"nodemailer": "^6.10.0",
|
||||
"notp": "^2.0.3",
|
||||
"p-queue": "^8.1.0",
|
||||
|
||||
@@ -25,8 +25,6 @@ import { ContestDetailBaseHandler } from './contest';
|
||||
import { postJudge } from './judge';
|
||||
|
||||
class RecordListHandler extends ContestDetailBaseHandler {
|
||||
tdoc?: Tdoc;
|
||||
|
||||
@param('page', Types.PositiveInt, true)
|
||||
@param('pid', Types.ProblemId, true)
|
||||
@param('tid', Types.ObjectId, true)
|
||||
@@ -131,7 +129,6 @@ class RecordListHandler extends ContestDetailBaseHandler {
|
||||
|
||||
class RecordDetailHandler extends ContestDetailBaseHandler {
|
||||
rdoc: RecordDoc;
|
||||
tdoc?: Tdoc;
|
||||
|
||||
@param('rid', Types.ObjectId)
|
||||
async prepare(domainId: string, rid: ObjectId) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { AttestationFormat, CredentialDeviceType } from '@simplewebauthn/server';
|
||||
import type { AuthenticationExtensionsAuthenticatorOutputs } from '@simplewebauthn/server/esm/helpers/decodeAuthenticatorExtensions';
|
||||
import type { ParsedAuthenticatorData } from '@simplewebauthn/server/helpers';
|
||||
import type fs from 'fs';
|
||||
import type { Dictionary, NumericDictionary } from 'lodash';
|
||||
import type { Binary, FindCursor, ObjectId } from 'mongodb';
|
||||
@@ -80,7 +80,7 @@ export interface Authenticator {
|
||||
userVerified: boolean;
|
||||
credentialDeviceType: CredentialDeviceType;
|
||||
credentialBackedUp: boolean;
|
||||
authenticatorExtensionResults?: AuthenticationExtensionsAuthenticatorOutputs;
|
||||
authenticatorExtensionResults?: ParsedAuthenticatorData['extensionsData'];
|
||||
authenticatorAttachment: 'platform' | 'cross-platform';
|
||||
}
|
||||
|
||||
|
||||
@@ -370,8 +370,10 @@ class LocalStorageService {
|
||||
}
|
||||
|
||||
async isLinkValid(link: string) {
|
||||
const [target, expire, secret] = link.split('/');
|
||||
const expected = md5(`${target}/${expire}/${this.config.secret}`);
|
||||
const parts = link.split('/');
|
||||
const secret = parts.pop();
|
||||
parts.push(this.config.secret);
|
||||
const expected = md5(parts.join('/'));
|
||||
return expected === secret;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@blueprintjs/core": "^5.17.5",
|
||||
"@cordisjs/core": "4.0.0-alpha.2",
|
||||
"@cordisjs/core": "4.0.0-alpha.3",
|
||||
"@fontsource/dm-mono": "^5.2.5",
|
||||
"@fontsource/fira-code": "^5.2.5",
|
||||
"@fontsource/inconsolata": "^5.2.5",
|
||||
@@ -80,7 +80,7 @@
|
||||
"monaco-editor-webpack-plugin": "^7.1.0",
|
||||
"monaco-themes": "^0.4.4",
|
||||
"monaco-yaml": "5.1.1",
|
||||
"nanoid": "^5.1.2",
|
||||
"nanoid": "^5.1.3",
|
||||
"normalize.css": "^8.0.1",
|
||||
"nprogress": "^0.2.0",
|
||||
"p-queue": "^8.1.0",
|
||||
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
declare module '*.vue' {
|
||||
export default {} as any;
|
||||
}
|
||||
@@ -14,14 +14,14 @@
|
||||
"react-dom": "^19.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.21.0",
|
||||
"@eslint/js": "^9.22.0",
|
||||
"@types/react": "^19.0.10",
|
||||
"@types/react-dom": "^19.0.4",
|
||||
"@vitejs/plugin-react-swc": "^3.8.0",
|
||||
"eslint": "^9.21.0",
|
||||
"eslint": "^9.22.0",
|
||||
"eslint-plugin-react-hooks": "^5.2.0",
|
||||
"eslint-plugin-react-refresh": "^0.4.19",
|
||||
"globals": "^15.15.0",
|
||||
"globals": "^16.0.0",
|
||||
"typescript": "~5.8.2",
|
||||
"typescript-eslint": "^8.26.0",
|
||||
"vite": "^6.2.1"
|
||||
|
||||
@@ -7,20 +7,31 @@ import type AdmZip from 'adm-zip';
|
||||
import fs from 'fs-extra';
|
||||
import moment, { isMoment, Moment } from 'moment-timezone';
|
||||
import { ObjectId } from 'mongodb';
|
||||
import Logger from 'reggol';
|
||||
import { Exporter, Factory, Logger as Reggol } from 'reggol';
|
||||
import type * as superagent from 'superagent';
|
||||
export * as yaml from 'js-yaml';
|
||||
export * as fs from 'fs-extra';
|
||||
|
||||
Logger.levels.base = process.env.DEV ? 3 : 2;
|
||||
Logger.targets[0].showTime = 'dd hh:mm:ss';
|
||||
Logger.targets[0].label = {
|
||||
const factory = new Factory();
|
||||
|
||||
factory.addExporter(new Exporter.Console({
|
||||
showDiff: false,
|
||||
showTime: 'dd hh:mm:ss',
|
||||
label: {
|
||||
align: 'right',
|
||||
width: 9,
|
||||
margin: 1,
|
||||
};
|
||||
},
|
||||
timestamp: Date.now(),
|
||||
}));
|
||||
|
||||
export { Logger, moment };
|
||||
function createLogger(name: string) {
|
||||
return factory.createLogger(name);
|
||||
}
|
||||
|
||||
export type Logger = Reggol & { new(name: string): Reggol & Logger };
|
||||
export const Logger = createLogger as any as Logger;
|
||||
export { moment };
|
||||
|
||||
const encrypt = (algorithm, content) => crypto.createHash(algorithm).update(content).digest('hex');
|
||||
export const sha1 = (content: string) => encrypt('sha1', content);
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
"js-yaml": "^4.1.0",
|
||||
"moment-timezone": "^0.5.47",
|
||||
"mongodb": "^5.9.2",
|
||||
"reggol": "^1.7.1",
|
||||
"reggol": "^2.0.3",
|
||||
"search-query-parser": "^1.6.0",
|
||||
"systeminformation": "^5.25.11"
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user