Page MenuHomePhabricator

D10099.id.diff
No OneTemporary

D10099.id.diff

diff --git a/keyserver/src/creators/invite-link-creator.js b/keyserver/src/creators/invite-link-creator.js
--- a/keyserver/src/creators/invite-link-creator.js
+++ b/keyserver/src/creators/invite-link-creator.js
@@ -2,6 +2,7 @@
import Filter from 'bad-words';
+import { inviteLinkBlobHash } from 'lib/shared/invite-links.js';
import type {
CreateOrUpdatePublicLinkRequest,
InviteLink,
@@ -152,7 +153,7 @@
function getInviteLinkBlob(
request: CreateOrUpdatePublicLinkRequest,
): Promise<BlobDownloadResult> {
- const hash = `invite_${request.name}`;
+ const hash = inviteLinkBlobHash(request.name);
return download(hash);
}
diff --git a/keyserver/src/deleters/link-deleters.js b/keyserver/src/deleters/link-deleters.js
--- a/keyserver/src/deleters/link-deleters.js
+++ b/keyserver/src/deleters/link-deleters.js
@@ -1,5 +1,6 @@
// @flow
+import { inviteLinkBlobHash } from 'lib/shared/invite-links.js';
import type { DisableInviteLinkRequest } from 'lib/types/link-types.js';
import { threadPermissions } from 'lib/types/thread-permission-types.js';
import { ServerError } from 'lib/utils/errors.js';
@@ -32,7 +33,7 @@
if (row?.blobHolder) {
await deleteBlob(
{
- hash: `invite_${request.name}`,
+ hash: inviteLinkBlobHash(request.name),
holder: row.blobHolder,
},
true,
diff --git a/lib/shared/invite-links.js b/lib/shared/invite-links.js
--- a/lib/shared/invite-links.js
+++ b/lib/shared/invite-links.js
@@ -11,4 +11,8 @@
const defaultErrorMessage = 'Unknown error.';
-export { inviteLinkErrorMessages, defaultErrorMessage };
+function inviteLinkBlobHash(secret: string): string {
+ return `invite_${secret}`;
+}
+
+export { inviteLinkErrorMessages, defaultErrorMessage, inviteLinkBlobHash };

File Metadata

Mime Type
text/plain
Expires
Tue, Dec 24, 7:03 AM (19 h, 57 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2698863
Default Alt Text
D10099.id.diff (1 KB)

Event Timeline