mirror of
https://github.com/versia-pub/api.git
synced 2025-12-08 01:08:19 +01:00
Compare commits
No commits in common. "71cb7738dee75c74a64e870341d7b8b27275ee01" and "ae5c3bb281e126d62c5fb34ee922c121fc1507f2" have entirely different histories.
71cb7738de
...
ae5c3bb281
|
|
@ -152,7 +152,7 @@ export class SignatureValidator {
|
||||||
new TextEncoder().encode(body),
|
new TextEncoder().encode(body),
|
||||||
);
|
);
|
||||||
|
|
||||||
const expectedSignedString = `${method.toLowerCase()} ${encodeURI(url.pathname)} ${timestamp.getTime() / 1000} ${arrayBufferToBase64(digest)}`;
|
const expectedSignedString = `${method.toLowerCase()} ${encodeURIComponent(url.pathname)} ${timestamp.getTime() / 1000} ${arrayBufferToBase64(digest)}`;
|
||||||
|
|
||||||
// Check if signed string is valid
|
// Check if signed string is valid
|
||||||
const isValid = await crypto.subtle.verify(
|
const isValid = await crypto.subtle.verify(
|
||||||
|
|
@ -305,7 +305,7 @@ export class SignatureConstructor {
|
||||||
new TextEncoder().encode(body ?? ""),
|
new TextEncoder().encode(body ?? ""),
|
||||||
);
|
);
|
||||||
|
|
||||||
const signedString = `${requestOrMethod.toLowerCase()} ${encodeURI(
|
const signedString = `${requestOrMethod.toLowerCase()} ${encodeURIComponent(
|
||||||
url.pathname,
|
url.pathname,
|
||||||
)} ${finalTimestamp.getTime() / 1000} ${arrayBufferToBase64(digest)}`;
|
)} ${finalTimestamp.getTime() / 1000} ${arrayBufferToBase64(digest)}`;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"$schema": "https://jsr.io/schema/config-file.v1.json",
|
"$schema": "https://jsr.io/schema/config-file.v1.json",
|
||||||
"name": "@versia/federation",
|
"name": "@versia/federation",
|
||||||
"version": "0.2.1",
|
"version": "0.2.0",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./index.ts",
|
".": "./index.ts",
|
||||||
"./types": "./types.ts",
|
"./types": "./types.ts",
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "@versia/federation",
|
"name": "@versia/federation",
|
||||||
"displayName": "Versia Federation",
|
"displayName": "Versia Federation",
|
||||||
"version": "0.2.1",
|
"version": "0.2.0",
|
||||||
"author": {
|
"author": {
|
||||||
"email": "jesse.wierzbinski@lysand.org",
|
"email": "jesse.wierzbinski@lysand.org",
|
||||||
"name": "Jesse Wierzbinski (CPlusPatch)",
|
"name": "Jesse Wierzbinski (CPlusPatch)",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue