-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
Convert icloud-auth to async, integrate anisette-v3 and support SMS auth #18
Conversation
…nd support passing serial number
icloud-auth/src/client.rs
Outdated
// NeedsSMS2FASent(Send2FAToDevices), | ||
NeedsDevice2FA(), | ||
Needs2FAVerification(), | ||
NeedsSMS2FA(), | ||
NeedsSMS2FAVerification(VerifyBody), | ||
NeedsLogin(), | ||
Failed(Error), | ||
} | ||
|
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.
I would maybe add a generic NeedSecondStep(action: String) too, to handle all the other cases (along with a way to skip the second step if Apple provided all the required tokens).
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 is a state machine, and the "Logged in" state is the finished state. Are there any other steps other than those two? I think it's better to panic now to bring attention to them if they ever show up. But I guess it could also be an error state?
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.
I'm not a Rust expert but from a coding standards and PR quality standpoint, looks good to me.
CI’s always been failing iirc, that error is from the code sign library not this |
OK, kind of assumed that. I'll make a ticket so it's noted. We should really fix that otherwise what's the point. |
#[error("Missing Libraries")] | ||
MissingLibraries, | ||
#[error("{0}")] | ||
Anyhow(#[from] anyhow::Error) |
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.
Did you end up keeping some code using anyhow?
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.
Don't think so, why?
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.
So why are we keeping that case in the enum? It could allow us to remove the anyhow crate dep altogether couldn't it?
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.
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.
I guess that'll be for another PR then
Test with
RUST_LOG=debug cargo test gsa_auth -- --nocapture