-
Notifications
You must be signed in to change notification settings - Fork 159
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
feat: add support for SEP-10 v3.1.0. #319
feat: add support for SEP-10 v3.1.0. #319
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.
this looks good to me but I'll yield to @leighmcculloch for the final approval
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.
Looks good to me, although one concern. @JakeUrban could you chime in?
* @return {@link ChallengeTransaction}, the decoded transaction envelope and client account ID contained within. | ||
* @throws InvalidSep10ChallengeException If the SEP-0010 validation fails, the exception will be thrown. | ||
* @throws IOException If read XDR string fails, the exception will be thrown. | ||
*/ | ||
public static ChallengeTransaction readChallengeTransaction(String challengeXdr, String serverAccountId, Network network, String[] domainNames) throws InvalidSep10ChallengeException, IOException { | ||
public static ChallengeTransaction readChallengeTransaction(String challengeXdr, String serverAccountId, Network network, String[] domainNames, String webAuthDomain) throws InvalidSep10ChallengeException, IOException { |
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.
In the Go SDK we need to put the webauth domain before the home domains to preserve an odd but awkward case that can break applications without them realizing, so I think there would be value in having all SDKs have that field first for consistency. But it also doesn't really matter. cc @JakeUrban
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 don't think it makes sense to try to keep function signatures consistent across languages. I'm pretty sure that ship has already sailed anyway. The change made looks good to me 👍
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.
Looks good to me, thanks @overcat
* @return {@link ChallengeTransaction}, the decoded transaction envelope and client account ID contained within. | ||
* @throws InvalidSep10ChallengeException If the SEP-0010 validation fails, the exception will be thrown. | ||
* @throws IOException If read XDR string fails, the exception will be thrown. | ||
*/ | ||
public static ChallengeTransaction readChallengeTransaction(String challengeXdr, String serverAccountId, Network network, String[] domainNames) throws InvalidSep10ChallengeException, IOException { | ||
public static ChallengeTransaction readChallengeTransaction(String challengeXdr, String serverAccountId, Network network, String[] domainNames, String webAuthDomain) throws InvalidSep10ChallengeException, IOException { |
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 don't think it makes sense to try to keep function signatures consistent across languages. I'm pretty sure that ship has already sailed anyway. The change made looks good to me 👍
@overcat could you try rebasing your branch on top of master? we need to retrigger circle ci so that the PR can be merged |
e697d86
to
38a11da
Compare
Thank you all. |
resolve #315
webAuthDomain
parameter was added to the following functionsSep10Challenge#newChallenge(KeyPair, Network, String, String, String, TimeBounds)
Sep10Challenge#readChallengeTransaction(String, String, Network, String, String)
Sep10Challenge#readChallengeTransaction(String, String, Network, String[], String)
Sep10Challenge#verifyChallengeTransactionSigners(String, String, Network, String, String, Set)
Sep10Challenge#verifyChallengeTransactionSigners(String, String, Network, String[], String, Set)
Sep10Challenge#verifyChallengeTransactionThreshold(String, String, Network, String[], String, int, Set)
Sep10Challenge#verifyChallengeTransactionThreshold(String, String, Network, String, String, int, Set)
webAuthDomain
parameter is expected to match the value of the Manage Data operation with the 'web_auth_domain' key, if present.