Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added endpoint to deactivate an account #143

Merged
merged 11 commits into from
Aug 20, 2024

Conversation

BichraiX
Copy link
Collaborator

@BichraiX BichraiX commented Aug 20, 2024

Added this endpoint from the spec : https://spec.matrix.org/v1.11/client-server-api/#post_matrixclientv3accountdeactivate

  • Modified multiple files error sending to replace e/err by e/err.toString() so that the logger logs the error message received.
  • Modified the SafeClientEvent class and tests to directly handle a ClientEvent instead of any object.
  • Added TODOs in /register for the future and added feature to fill new database tables with device information.
  • Refactored delete3pid function to be callable outside of the endpoint to delete a 3pid association.
  • Moved /whoami tests to new file account.test.ts along with the new tests to /deactivate endpoint.
  • Deactivate endpoint is not finished and requires implementing the /leave endpoint in the future.

const insertDeletedPushersPromises = pushers.map(async (pusher) => {
await limit(() =>
clientServer.matrixDb.insert('deleted_pushers', {
stream_id: randomString(64), // TODO: Update when stream ordering is implemented since the stream_id has to keep track of the order of operations

Check notice

Code scanning / devskim

A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note

Suspicious comment
eventRows[0].origin_server_ts !== null &&
eventRows[0].origin_server_ts !== undefined
? (eventRows[0].origin_server_ts as number)
: 0, // TODO : Discuss default value

Check notice

Code scanning / devskim

A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note

Suspicious comment
sender:
eventRows[0] !== null && eventRows[0] !== undefined
? (eventRows[0].sender as string)
: '', // TODO : Discuss default value

Check notice

Code scanning / devskim

A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note

Suspicious comment
})
}
// await updateMembership(room, userId, Membership.LEAVE)
// TODO : Replace this after implementing method to update room membership from the spec

Check notice

Code scanning / devskim

A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note

Suspicious comment
clientServer: MatrixClientServer,
userId: string
): Promise<void> => {
// TODO : Implement this after implementing endpoint '/_matrix/client/v3/rooms/{roomId}/leave' from the spec at : https://spec.matrix.org/v1.11/client-server-api/#post_matrixclientv3roomsroomidleave

Check notice

Code scanning / devskim

A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note

Suspicious comment
@@ -63,6 +63,7 @@
}
clientServer.matrixDb
.updateWithConditions(
// TODO : Replace with upsert

Check notice

Code scanning / devskim

A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note

Suspicious comment
@@ -165,6 +165,16 @@
ip,
user_agent: userAgent
})
const newDeviceAuthProviderPromise = clientServer.matrixDb.insert(
// TODO : Fill the auth_provider_id and auth_provider_session_id rows with the right values after implementing SSO login

Check notice

Code scanning / devskim

A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note

Suspicious comment
@@ -388,6 +409,9 @@
}
)
} else {
// We don't handle the threepid_guest_access_tokens table and give the guest an access token like any user.
// This might be problematic to restrict the endpoints guests have access to as specified in the spec
// TODO : Review this after implementing endpoints not available to guest accounts. Maybe modify the authenticate function.

Check notice

Code scanning / devskim

A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note

Suspicious comment
@BichraiX BichraiX requested a review from guimard August 20, 2024 12:33
@guimard guimard merged commit d3202da into full-id-service Aug 20, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants