Page MenuHomePhabricator

D7108.diff
No OneTemporary

D7108.diff

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

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)

Event Timeline