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

Working auth with storing data in pgsql #119

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

emcifuntik
Copy link

No description provided.

Copy link
Owner

@naim94a naim94a left a 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);

Copy link
Owner

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 {
Copy link
Owner

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() {
Copy link
Owner

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.

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.

None yet

2 participants