-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add support for SRP as an alternative auth mechanism. #85
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.
Minor comments (documentation related mostly), but looks good to me! This is cool!
9C256576 D674DF74 96EA81D3 383B4813 D692C6E0 E0D5D8E2 50B98BE4 | ||
8E495C1D 6089DAD1 5DC7D7B4 6154D6B6 CE8EF4AD 69B15D49 82559B29 | ||
7BCF1885 C529F566 660E57EC 68EDBC3C 05726CC0 2FD4CBF4 976EAA9A | ||
FD5138FE 8376435B 9FC61D2F C0EB06E3 |
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.
Would these be better suited for a resource file? Or would that separate it too much from the code? (I'm guessing these are related to the multiplicative group generator?)
val bytes = x.toByteArray | ||
if (bytes.length >= 2 && bytes(0) == 0) bytes.tail else bytes | ||
} | ||
} |
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.
Neat!
// We will use SRP if manager supports it, so we send a PING to get manager features. | ||
val resp = Await.result(sendManagerRequest(2, "PING".toData), timeout) | ||
val features: Set[String] = resp match { | ||
case Cluster(_, Arr(features @ _*)) => Set(features.map(_.getString): _*) |
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'd recommend using a different name for mapping the matched value in Arr(..)
-- I probably get confused too easily, but seeing the name used twice in immediate parent-child scopes throws me off. It's also not immediately clear what the type of features
is in the case body. It looks like it may be a Labrad type (an array?), and you're grabbing the elements as a Seq
. For the sake of readability, could we expand this out a bit without sacrificing performance or functional-ness?
No description provided.