Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3539971
D11970.id40061.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D11970.id40061.diff
View Options
diff --git a/keyserver/src/responders/relationship-responders.js b/keyserver/src/responders/relationship-responders.js
--- a/keyserver/src/responders/relationship-responders.js
+++ b/keyserver/src/responders/relationship-responders.js
@@ -9,7 +9,7 @@
type RelationshipRequest,
farcasterRelationshipRequestValidator,
} from 'lib/types/relationship-types.js';
-import { tShape } from 'lib/utils/validation-utils.js';
+import { tShape, tUserID } from 'lib/utils/validation-utils.js';
import type { Viewer } from '../session/viewer.js';
import { updateRelationships } from '../updaters/relationship-updaters.js';
@@ -20,7 +20,7 @@
traditionalRelationshipActionsList,
'relationship action',
),
- userIDs: t.list(t.String),
+ userIDs: t.list(tUserID),
});
export const updateRelationshipInputValidator: TUnion<RelationshipRequest> =
diff --git a/keyserver/src/responders/thread-responders.js b/keyserver/src/responders/thread-responders.js
--- a/keyserver/src/responders/thread-responders.js
+++ b/keyserver/src/responders/thread-responders.js
@@ -34,6 +34,7 @@
tColor,
tPassword,
tID,
+ tUserID,
} from 'lib/utils/validation-utils.js';
import {
@@ -71,7 +72,7 @@
export const roleChangeRequestInputValidator: TInterface<RoleChangeRequest> =
tShape<RoleChangeRequest>({
threadID: tID,
- memberIDs: t.list(t.String),
+ memberIDs: t.list(tUserID),
role: t.refinement(tID, str => {
if (str.indexOf('|') !== -1) {
str = str.split('|')[1];
@@ -91,7 +92,7 @@
export const removeMembersRequestInputValidator: TInterface<RemoveMembersRequest> =
tShape<RemoveMembersRequest>({
threadID: tID,
- memberIDs: t.list(t.String),
+ memberIDs: t.list(tUserID),
});
async function memberRemovalResponder(
@@ -122,7 +123,7 @@
description: t.maybe(t.String),
color: t.maybe(tColor),
parentThreadID: t.maybe(tID),
- newMemberIDs: t.maybe(t.list(t.String)),
+ newMemberIDs: t.maybe(t.list(tUserID)),
avatar: t.maybe(updateUserAvatarRequestValidator),
}),
accountPassword: t.maybe(tPassword),
@@ -140,7 +141,7 @@
description: t.maybe(t.String),
color: t.maybe(tColor),
parentThreadID: t.maybe(tID),
- initialMemberIDs: t.maybe(t.list(t.String)),
+ initialMemberIDs: t.maybe(t.list(tUserID)),
calendarQuery: t.maybe(entryQueryInputValidator),
};
const newThreadRequestInputValidator: TUnion<ServerNewThreadRequest> = t.union([
diff --git a/keyserver/src/responders/user-responders.js b/keyserver/src/responders/user-responders.js
--- a/keyserver/src/responders/user-responders.js
+++ b/keyserver/src/responders/user-responders.js
@@ -82,6 +82,7 @@
tOldValidUsername,
tRegex,
tID,
+ tUserID,
} from 'lib/utils/validation-utils.js';
import {
@@ -695,7 +696,7 @@
export const keyserverAuthRequestInputValidator: TInterface<KeyserverAuthRequest> =
tShape<KeyserverAuthRequest>({
- userID: t.String,
+ userID: tUserID,
deviceID: t.String,
calendarQuery: entryQueryInputValidator,
deviceTokenUpdateRequest: t.maybe(deviceTokenUpdateRequestInputValidator),
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 27, 4:06 AM (10 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2710381
Default Alt Text
D11970.id40061.diff (3 KB)
Attached To
Mode
D11970: [lib] Use tUserID in validators in keyserver/
Attached
Detach File
Event Timeline
Log In to Comment