-
-
Notifications
You must be signed in to change notification settings - Fork 104
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
Working auth with storing data in pgsql #119
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR!
My primary concern is how unauthenticated/IDA<8 users would be handled.
@@ -37,3 +37,9 @@ CREATE TABLE IF NOT EXISTS funcs ( | |||
CREATE UNIQUE INDEX IF NOT EXISTS funcs_db ON funcs(chksum, db_id); | |||
CREATE INDEX IF NOT EXISTS funcs_ranking ON funcs(chksum,rank); | |||
CREATE INDEX IF NOT EXISTS func_chksum ON funcs(chksum); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be in a new database migration. (see diesel-cli migration generate
)
}).async_write(&mut stream).await?; | ||
return Ok(()); | ||
} | ||
} | ||
else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would cause all users of IDA<8 to fail to connect, as creds
would be None
.
|
||
let auth_state = state.db.auth_user(creds.username, creds.password).await; | ||
|
||
if !auth_state.is_ok() || !auth_state.unwrap() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auth_state.unwrap
would allow a temporary database failure to cause a panic.
No description provided.