Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3382890
D7108.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D7108.diff
View Options
diff --git a/keyserver/src/endpoints.js b/keyserver/src/endpoints.js
--- a/keyserver/src/endpoints.js
+++ b/keyserver/src/endpoints.js
@@ -57,6 +57,7 @@
oldPasswordUpdateResponder,
updateUserSettingsResponder,
policyAcknowledgmentResponder,
+ updateUserAvatarResponder,
} from './responders/user-responders.js';
import { codeVerificationResponder } from './responders/verification-responders.js';
import { uploadDeletionResponder } from './uploads/uploads.js';
@@ -242,6 +243,10 @@
responder: siweAuthResponder,
requiredPolicies: [],
},
+ update_user_avatar: {
+ responder: updateUserAvatarResponder,
+ requiredPolicies: baseLegalPolicies,
+ },
};
export { jsonEndpoints };
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
@@ -26,6 +26,7 @@
notificationTypeValues,
logInActionSources,
} from 'lib/types/account-types.js';
+import type { UpdateUserAvatarRequest } from 'lib/types/avatar-types.js';
import type {
IdentityKeysBlob,
SignedIdentityKeysBlob,
@@ -42,6 +43,7 @@
SubscriptionUpdateResponse,
} from 'lib/types/subscription-types.js';
import type { PasswordUpdate } from 'lib/types/user-types.js';
+import { updateUserAvatarRequestValidator } from 'lib/utils/avatar-utils.js';
import {
identityKeysBlobValidator,
signedIdentityKeysBlobValidator,
@@ -670,6 +672,14 @@
await viewerAcknowledgmentUpdater(viewer, request.policy);
}
+async function updateUserAvatarResponder(
+ viewer: Viewer,
+ input: any,
+): Promise<void> {
+ const request: UpdateUserAvatarRequest = input;
+ await validateInput(viewer, updateUserAvatarRequestValidator, request);
+}
+
export {
userSubscriptionUpdateResponder,
passwordUpdateResponder,
@@ -683,4 +693,5 @@
oldPasswordUpdateResponder,
updateUserSettingsResponder,
policyAcknowledgmentResponder,
+ updateUserAvatarResponder,
};
diff --git a/lib/types/endpoints.js b/lib/types/endpoints.js
--- a/lib/types/endpoints.js
+++ b/lib/types/endpoints.js
@@ -83,6 +83,7 @@
VERIFY_CODE: 'verify_code',
SIWE_NONCE: 'siwe_nonce',
SIWE_AUTH: 'siwe_auth',
+ UPDATE_USER_AVATAR: 'update_user_avatar',
});
type SocketPreferredEndpoint = $Values<typeof socketPreferredEndpoints>;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 29, 12:32 PM (22 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2596995
Default Alt Text
D7108.diff (2 KB)
Attached To
Mode
D7108: [keyserver] Introduce `updateUserAvatarResponder` endpoint scaffolding
Attached
Detach File
Event Timeline
Log In to Comment