Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3520450
D13629.id44959.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
14 KB
Referenced Files
None
Subscribers
None
D13629.id44959.diff
View Options
diff --git a/services/identity/src/grpc_services/authenticated.rs b/services/identity/src/grpc_services/authenticated.rs
--- a/services/identity/src/grpc_services/authenticated.rs
+++ b/services/identity/src/grpc_services/authenticated.rs
@@ -26,11 +26,11 @@
KeyserverKeysResponse, LinkFarcasterAccountRequest, OutboundKeyInfo,
OutboundKeysForUserRequest, OutboundKeysForUserResponse,
PeersDeviceListsRequest, PeersDeviceListsResponse,
- PrimaryDeviceLogoutRequest, RefreshUserPrekeysRequest,
- UpdateDeviceListRequest, UpdateUserPasswordFinishRequest,
- UpdateUserPasswordStartRequest, UpdateUserPasswordStartResponse,
- UploadOneTimeKeysRequest, UserDevicesPlatformDetails, UserIdentitiesRequest,
- UserIdentitiesResponse,
+ PrimaryDeviceLogoutRequest, PrivilegedDeleteUsersRequest,
+ RefreshUserPrekeysRequest, UpdateDeviceListRequest,
+ UpdateUserPasswordFinishRequest, UpdateUserPasswordStartRequest,
+ UpdateUserPasswordStartResponse, UploadOneTimeKeysRequest,
+ UserDevicesPlatformDetails, UserIdentitiesRequest, UserIdentitiesResponse,
};
use super::protos::unauth::Empty;
@@ -622,6 +622,14 @@
Ok(Response::new(response))
}
+ #[tracing::instrument(skip_all)]
+ async fn privileged_delete_users(
+ &self,
+ _request: tonic::Request<PrivilegedDeleteUsersRequest>,
+ ) -> Result<tonic::Response<Empty>, tonic::Status> {
+ unimplemented!()
+ }
+
#[tracing::instrument(skip_all)]
async fn get_device_list_for_user(
&self,
diff --git a/shared/protos/identity_auth.proto b/shared/protos/identity_auth.proto
--- a/shared/protos/identity_auth.proto
+++ b/shared/protos/identity_auth.proto
@@ -64,6 +64,12 @@
(identity.unauth.Empty) {}
rpc DeleteWalletUser(identity.unauth.Empty) returns (identity.unauth.Empty) {}
+ // Called by Comm staff to delete user accounts. Usage is strictly limited to
+ // accounts flagged for violating terms of service.
+ rpc PrivilegedDeleteUsers(PrivilegedDeleteUsersRequest) returns
+ (identity.unauth.Empty) {};
+
+
/* Device list actions */
// Returns device list history
@@ -239,6 +245,12 @@
bytes opaque_login_response = 2;
}
+// PrivilegedDeleteUsers
+
+message PrivilegedDeleteUsersRequest {
+ repeated string user_ids = 1;
+}
+
// GetDeviceListForUser
message GetDeviceListRequest {
diff --git a/web/protobufs/identity-auth-client.cjs b/web/protobufs/identity-auth-client.cjs
--- a/web/protobufs/identity-auth-client.cjs
+++ b/web/protobufs/identity-auth-client.cjs
@@ -871,6 +871,67 @@
};
+/**
+ * @const
+ * @type {!grpc.web.MethodDescriptor<
+ * !proto.identity.auth.PrivilegedDeleteUsersRequest,
+ * !proto.identity.unauth.Empty>}
+ */
+const methodDescriptor_IdentityClientService_PrivilegedDeleteUsers = new grpc.web.MethodDescriptor(
+ '/identity.auth.IdentityClientService/PrivilegedDeleteUsers',
+ grpc.web.MethodType.UNARY,
+ proto.identity.auth.PrivilegedDeleteUsersRequest,
+ identity_unauth_pb.Empty,
+ /**
+ * @param {!proto.identity.auth.PrivilegedDeleteUsersRequest} request
+ * @return {!Uint8Array}
+ */
+ function(request) {
+ return request.serializeBinary();
+ },
+ identity_unauth_pb.Empty.deserializeBinary
+);
+
+
+/**
+ * @param {!proto.identity.auth.PrivilegedDeleteUsersRequest} request The
+ * request proto
+ * @param {?Object<string, string>} metadata User defined
+ * call metadata
+ * @param {function(?grpc.web.RpcError, ?proto.identity.unauth.Empty)}
+ * callback The callback function(error, response)
+ * @return {!grpc.web.ClientReadableStream<!proto.identity.unauth.Empty>|undefined}
+ * The XHR Node Readable Stream
+ */
+proto.identity.auth.IdentityClientServiceClient.prototype.privilegedDeleteUsers =
+ function(request, metadata, callback) {
+ return this.client_.rpcCall(this.hostname_ +
+ '/identity.auth.IdentityClientService/PrivilegedDeleteUsers',
+ request,
+ metadata || {},
+ methodDescriptor_IdentityClientService_PrivilegedDeleteUsers,
+ callback);
+};
+
+
+/**
+ * @param {!proto.identity.auth.PrivilegedDeleteUsersRequest} request The
+ * request proto
+ * @param {?Object<string, string>=} metadata User defined
+ * call metadata
+ * @return {!Promise<!proto.identity.unauth.Empty>}
+ * Promise that resolves to the response
+ */
+proto.identity.auth.IdentityClientServicePromiseClient.prototype.privilegedDeleteUsers =
+ function(request, metadata) {
+ return this.client_.unaryCall(this.hostname_ +
+ '/identity.auth.IdentityClientService/PrivilegedDeleteUsers',
+ request,
+ metadata || {},
+ methodDescriptor_IdentityClientService_PrivilegedDeleteUsers);
+};
+
+
/**
* @const
* @type {!grpc.web.MethodDescriptor<
@@ -1299,4 +1360,3 @@
module.exports = proto.identity.auth;
-
diff --git a/web/protobufs/identity-auth-client.cjs.flow b/web/protobufs/identity-auth-client.cjs.flow
--- a/web/protobufs/identity-auth-client.cjs.flow
+++ b/web/protobufs/identity-auth-client.cjs.flow
@@ -102,6 +102,13 @@
response: identityStructs.Empty) => void
): grpcWeb.ClientReadableStream<identityStructs.Empty>;
+ privilegedDeleteUsers(
+ request: identityAuthStructs.PrivilegedDeleteUsersRequest,
+ metadata: grpcWeb.Metadata | void,
+ callback: (err: grpcWeb.RpcError,
+ response: identityStructs.Empty) => void
+ ): grpcWeb.ClientReadableStream<identityStructs.Empty>;
+
getDeviceListForUser(
request: identityAuthStructs.GetDeviceListRequest,
metadata: grpcWeb.Metadata | void,
@@ -222,6 +229,11 @@
metadata?: grpcWeb.Metadata
): Promise<identityStructs.Empty>;
+ privilegedDeleteUsers(
+ request: identityAuthStructs.PrivilegedDeleteUsersRequest,
+ metadata?: grpcWeb.Metadata
+ ): Promise<identityStructs.Empty>;
+
getDeviceListForUser(
request: identityAuthStructs.GetDeviceListRequest,
metadata?: grpcWeb.Metadata
@@ -258,4 +270,3 @@
): Promise<identityStructs.Empty>;
}
-
diff --git a/web/protobufs/identity-auth-structs.cjs b/web/protobufs/identity-auth-structs.cjs
--- a/web/protobufs/identity-auth-structs.cjs
+++ b/web/protobufs/identity-auth-structs.cjs
@@ -43,6 +43,7 @@
goog.exportSymbol('proto.identity.auth.PeersDeviceListsResponse', null, global);
goog.exportSymbol('proto.identity.auth.PlatformDetails', null, global);
goog.exportSymbol('proto.identity.auth.PrimaryDeviceLogoutRequest', null, global);
+goog.exportSymbol('proto.identity.auth.PrivilegedDeleteUsersRequest', null, global);
goog.exportSymbol('proto.identity.auth.RefreshUserPrekeysRequest', null, global);
goog.exportSymbol('proto.identity.auth.UpdateDeviceListRequest', null, global);
goog.exportSymbol('proto.identity.auth.UpdateUserPasswordFinishRequest', null, global);
@@ -430,6 +431,27 @@
*/
proto.identity.auth.DeletePasswordUserStartResponse.displayName = 'proto.identity.auth.DeletePasswordUserStartResponse';
}
+/**
+ * Generated by JsPbCodeGenerator.
+ * @param {Array=} opt_data Optional initial data array, typically from a
+ * server response, or constructed directly in Javascript. The array is used
+ * in place and becomes part of the constructed object. It is not cloned.
+ * If no data is provided, the constructed object will be empty, but still
+ * valid.
+ * @extends {jspb.Message}
+ * @constructor
+ */
+proto.identity.auth.PrivilegedDeleteUsersRequest = function(opt_data) {
+ jspb.Message.initialize(this, opt_data, 0, -1, proto.identity.auth.PrivilegedDeleteUsersRequest.repeatedFields_, null);
+};
+goog.inherits(proto.identity.auth.PrivilegedDeleteUsersRequest, jspb.Message);
+if (goog.DEBUG && !COMPILED) {
+ /**
+ * @public
+ * @override
+ */
+ proto.identity.auth.PrivilegedDeleteUsersRequest.displayName = 'proto.identity.auth.PrivilegedDeleteUsersRequest';
+}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
@@ -4237,6 +4259,162 @@
+/**
+ * List of repeated fields within this message type.
+ * @private {!Array<number>}
+ * @const
+ */
+proto.identity.auth.PrivilegedDeleteUsersRequest.repeatedFields_ = [1];
+
+
+
+if (jspb.Message.GENERATE_TO_OBJECT) {
+/**
+ * Creates an object representation of this proto.
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
+ * Optional fields that are not set will be set to undefined.
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
+ * For the list of reserved names please see:
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
+ * JSPB instance for transitional soy proto support:
+ * http://goto/soy-param-migration
+ * @return {!Object}
+ */
+proto.identity.auth.PrivilegedDeleteUsersRequest.prototype.toObject = function(opt_includeInstance) {
+ return proto.identity.auth.PrivilegedDeleteUsersRequest.toObject(opt_includeInstance, this);
+};
+
+
+/**
+ * Static version of the {@see toObject} method.
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
+ * the JSPB instance for transitional soy proto support:
+ * http://goto/soy-param-migration
+ * @param {!proto.identity.auth.PrivilegedDeleteUsersRequest} msg The msg instance to transform.
+ * @return {!Object}
+ * @suppress {unusedLocalVariables} f is only used for nested messages
+ */
+proto.identity.auth.PrivilegedDeleteUsersRequest.toObject = function(includeInstance, msg) {
+ var f, obj = {
+ userIdsList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f
+ };
+
+ if (includeInstance) {
+ obj.$jspbMessageInstance = msg;
+ }
+ return obj;
+};
+}
+
+
+/**
+ * Deserializes binary data (in protobuf wire format).
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
+ * @return {!proto.identity.auth.PrivilegedDeleteUsersRequest}
+ */
+proto.identity.auth.PrivilegedDeleteUsersRequest.deserializeBinary = function(bytes) {
+ var reader = new jspb.BinaryReader(bytes);
+ var msg = new proto.identity.auth.PrivilegedDeleteUsersRequest;
+ return proto.identity.auth.PrivilegedDeleteUsersRequest.deserializeBinaryFromReader(msg, reader);
+};
+
+
+/**
+ * Deserializes binary data (in protobuf wire format) from the
+ * given reader into the given message object.
+ * @param {!proto.identity.auth.PrivilegedDeleteUsersRequest} msg The message object to deserialize into.
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
+ * @return {!proto.identity.auth.PrivilegedDeleteUsersRequest}
+ */
+proto.identity.auth.PrivilegedDeleteUsersRequest.deserializeBinaryFromReader = function(msg, reader) {
+ while (reader.nextField()) {
+ if (reader.isEndGroup()) {
+ break;
+ }
+ var field = reader.getFieldNumber();
+ switch (field) {
+ case 1:
+ var value = /** @type {string} */ (reader.readString());
+ msg.addUserIds(value);
+ break;
+ default:
+ reader.skipField();
+ break;
+ }
+ }
+ return msg;
+};
+
+
+/**
+ * Serializes the message to binary data (in protobuf wire format).
+ * @return {!Uint8Array}
+ */
+proto.identity.auth.PrivilegedDeleteUsersRequest.prototype.serializeBinary = function() {
+ var writer = new jspb.BinaryWriter();
+ proto.identity.auth.PrivilegedDeleteUsersRequest.serializeBinaryToWriter(this, writer);
+ return writer.getResultBuffer();
+};
+
+
+/**
+ * Serializes the given message to binary data (in protobuf wire
+ * format), writing to the given BinaryWriter.
+ * @param {!proto.identity.auth.PrivilegedDeleteUsersRequest} message
+ * @param {!jspb.BinaryWriter} writer
+ * @suppress {unusedLocalVariables} f is only used for nested messages
+ */
+proto.identity.auth.PrivilegedDeleteUsersRequest.serializeBinaryToWriter = function(message, writer) {
+ var f = undefined;
+ f = message.getUserIdsList();
+ if (f.length > 0) {
+ writer.writeRepeatedString(
+ 1,
+ f
+ );
+ }
+};
+
+
+/**
+ * repeated string user_ids = 1;
+ * @return {!Array<string>}
+ */
+proto.identity.auth.PrivilegedDeleteUsersRequest.prototype.getUserIdsList = function() {
+ return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 1));
+};
+
+
+/**
+ * @param {!Array<string>} value
+ * @return {!proto.identity.auth.PrivilegedDeleteUsersRequest} returns this
+ */
+proto.identity.auth.PrivilegedDeleteUsersRequest.prototype.setUserIdsList = function(value) {
+ return jspb.Message.setField(this, 1, value || []);
+};
+
+
+/**
+ * @param {string} value
+ * @param {number=} opt_index
+ * @return {!proto.identity.auth.PrivilegedDeleteUsersRequest} returns this
+ */
+proto.identity.auth.PrivilegedDeleteUsersRequest.prototype.addUserIds = function(value, opt_index) {
+ return jspb.Message.addToRepeatedField(this, 1, value, opt_index);
+};
+
+
+/**
+ * Clears the list making it empty but non-null.
+ * @return {!proto.identity.auth.PrivilegedDeleteUsersRequest} returns this
+ */
+proto.identity.auth.PrivilegedDeleteUsersRequest.prototype.clearUserIdsList = function() {
+ return this.setUserIdsList([]);
+};
+
+
+
if (jspb.Message.GENERATE_TO_OBJECT) {
diff --git a/web/protobufs/identity-auth-structs.cjs.flow b/web/protobufs/identity-auth-structs.cjs.flow
--- a/web/protobufs/identity-auth-structs.cjs.flow
+++ b/web/protobufs/identity-auth-structs.cjs.flow
@@ -439,6 +439,24 @@
opaqueLoginResponse: Uint8Array | string,
}
+declare export class PrivilegedDeleteUsersRequest extends Message {
+ getUserIdsList(): Array<string>;
+ setUserIdsList(value: Array<string>): PrivilegedDeleteUsersRequest;
+ clearUserIdsList(): PrivilegedDeleteUsersRequest;
+ addUserIds(value: string, index?: number): PrivilegedDeleteUsersRequest;
+
+ serializeBinary(): Uint8Array;
+ toObject(includeInstance?: boolean): PrivilegedDeleteUsersRequestObject;
+ static toObject(includeInstance: boolean, msg: PrivilegedDeleteUsersRequest): PrivilegedDeleteUsersRequestObject;
+ static serializeBinaryToWriter(message: PrivilegedDeleteUsersRequest, writer: BinaryWriter): void;
+ static deserializeBinary(bytes: Uint8Array): PrivilegedDeleteUsersRequest;
+ static deserializeBinaryFromReader(message: PrivilegedDeleteUsersRequest, reader: BinaryReader): PrivilegedDeleteUsersRequest;
+}
+
+export type PrivilegedDeleteUsersRequestObject = {
+ userIdsList: Array<string>,
+}
+
export type SinceTimestampCase = 0 | 2;
declare export class GetDeviceListRequest extends Message {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 24, 12:21 AM (18 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2697477
Default Alt Text
D13629.id44959.diff (14 KB)
Attached To
Mode
D13629: [proto] privileged delete users RPC
Attached
Detach File
Event Timeline
Log In to Comment