core: fix storage sign

This commit is contained in:
undefined committed 2025-03-09 21:18:49 +08:00
1 parent c4301a5333
commit d0e817787b
11 files changed
+41 -28

No files matched your search

+3 -3
View File
@@ -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",
-3
View File
@@ -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) {
+2 -2
View File
@@ -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';
}
+4 -2
View File
@@ -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;
}