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

Modified Ui Authentication #135

Merged
merged 33 commits into from
Aug 12, 2024
Merged

Conversation

BichraiX
Copy link
Collaborator

Modified UI Authentication to fill the right tables in the matrix database and have better error handling. Updated the endpoints that use Ui Auth (/add and /register) in order to comply with these changes.
Added a README file for UI authentication to clarify usage.

.then((deviceRows) => {
let initial_device_display_name
if (deviceRows.length > 0) {
// TODO : Refresh access tokens using refresh tokens and invalidate the previous access_token associated with the device after implementing the /refresh endpoint

Check notice

Code scanning / devskim

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

Suspicious comment
@@ -1,6 +1,7 @@
import { type expressAppHandler, send } from '@twake/utils'
import type MatrixClientServer from '..'

// TODO : Modify default value of sso login in config

Check notice

Code scanning / devskim

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

Suspicious comment
@BichraiX BichraiX marked this pull request as draft July 26, 2024 07:44
send(res, 200, {
access_token: accessToken,
device_id: deviceId,
user_id: userId,
expires_in_ms: 60000 // Arbitrary value, should probably be defined in the server config
expires_in_ms: 60000 // Arbitrary value, should probably be defined in the server config // TODO : Add this in the config

Check notice

Code scanning / devskim

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

Suspicious comment
access_token: accessToken,
device_id: deviceId,
user_id: userId,
expires_in_ms: 60000, // Arbitrary value, should probably be defined in the server config // TODO : Add this in the config

Check notice

Code scanning / devskim

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

Suspicious comment
id: refreshTokenId,
user_id: userId,
device_id: deviceId,
token: refreshToken // TODO : maybe add expiry_ts here

Check notice

Code scanning / devskim

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

Suspicious comment
device_id: deviceId,
valid_until_ms: 0,
refresh_token_id: refreshTokenId
}) // TODO : Add a token_lifetime in the config, replace the id with a correct one, and fill the 'puppets_user_id' row with the right value

Check notice

Code scanning / devskim

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

Suspicious comment
'users',
{
...commonUserData,
password_hash: hash.sha256(password) // TODO: Handle other hashing algorithms

Check notice

Code scanning / devskim

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

Suspicious comment
creation_time: epoch(),
clientdict: JSON.stringify(obj),
serverdict: JSON.stringify({}),
uri: req.url as string, // TODO : Ensure this is the right way to get the URI

Check notice

Code scanning / devskim

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

Suspicious comment
@BichraiX BichraiX marked this pull request as ready for review August 12, 2024 10:47
@BichraiX BichraiX requested a review from guimard August 12, 2024 10:48
@BichraiX BichraiX requested a review from guimard August 12, 2024 11:23
@BichraiX BichraiX requested a review from guimard August 12, 2024 11:39
@guimard
Copy link
Member

guimard commented Aug 12, 2024

@BichraiX : merge it when test succeeds

@guimard
Copy link
Member

guimard commented Aug 12, 2024

src/rooms/rooms.test.ts:15:8 - error TS2307: Cannot find module '../utils/setupTokens'

@BichraiX BichraiX merged commit 17026b9 into full-id-service Aug 12, 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.

4 participants