-
Notifications
You must be signed in to change notification settings - Fork 34
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
[ANCHOR-775] Implement SEP-45 #1623
[ANCHOR-775] Implement SEP-45 #1623
Conversation
32ffa58
to
4c2f3b2
Compare
4c2f3b2
to
48d9e11
Compare
9532d94
to
43a9752
Compare
@@ -70,6 +73,18 @@ void validateConfig(AppConfig config, Errors errors) { | |||
config.getHorizonUrl())); | |||
} | |||
} | |||
|
|||
if (isEmpty(config.getRpcUrl())) { | |||
// TODO: this can only be empty when SEP-45 is disabled |
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.
Maybe check this in sep45Config
like checking secretConfig there?
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 created ANCHOR-955 to add all the validation + refactor the configuration a little bit. This PR is the bare minimum to get the implementation working.
public class PropertySep45Config implements Sep45Config, Validator { | ||
private Boolean enabled; | ||
private String webAuthDomain; | ||
private String webAuthContractId; |
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.
Is this optional?
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.
It's not. The configs will be validated in ANCHOR-955.
/** | ||
* Creates the arguments for the web_auth_verify function. | ||
* | ||
* @param request the challenge request |
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.
comment
LGTM. Feel free to merge once the minors are addressed. |
import org.stellar.anchor.api.sep.sep45.ValidationRequest; | ||
import org.stellar.anchor.api.sep.sep45.ValidationResponse; | ||
|
||
public interface ISep45Service { |
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.
public interface ISep45Service { | |
public interface Sep45Service { |
Unless ISep45Service
is used somewhere else, we don't have to create the interface.
For ISep10Service
, it was probably created for some legacy reasons that I can't remember. May be we may remove it as well.
import org.stellar.sdk.responses.sorobanrpc.SimulateTransactionResponse; | ||
|
||
@Getter | ||
public class Rpc { |
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.
public class Rpc { | |
public class StellarRpc { |
Rpc
is too generic.
@@ -40,6 +40,9 @@ stellar_network: | |||
# The horizon server endpoint. | |||
horizon_url: https://horizon-testnet.stellar.org | |||
|
|||
# The rpc server endpoint. | |||
rpc_url: https://soroban-testnet.stellar.org |
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.
rpc_url: https://soroban-testnet.stellar.org | |
stellar_rpc_url: https://soroban-testnet.stellar.org |
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.
These configurations are already nested under stellar_network
so I think keeping it as rpc_url
is fine.
Description
This PR implements the core logic of SEP-45.
SEP-45 shares a common configuration with SEP-10 so I decided to keep the SEP-45 config simple and fix it at a later point in time. Tests and comments for the configuration have not been implemented as part of this PR.
Context
C-account implementation
Testing
./gradlew test
Documentation
Stellar docs need to be updated
Known limitations
Client domain verification has not been tested yet.