-
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-418] Support auth with SEP10 in SEP38 #1130
Conversation
fun testAll() { | ||
println("Performing SEP38 tests...") | ||
`test sep38 info, price and prices endpoints`() | ||
`test selling over asset limit throws an exception`() | ||
`test endpoints does not required valid token when auth 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.
Can we also add tests for when authentication is enabled?
@@ -451,6 +451,8 @@ sep38: | |||
# Whether to enable SEP-38 | |||
# | |||
enabled: false | |||
# Whether to require SEP-10 authentication for SEP-38 requests. | |||
requires_sep10: false |
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.
SEP-38 has other endpoints that require authentication such as POST /quote
. Should we change the name of this flag or schema (nesting it under sep38.endpoints.info.authentication_required
, for example) so that this is clear?
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.
Please feel free to merge after the comments are resolved.
@@ -451,6 +451,8 @@ sep38: | |||
# Whether to enable SEP-38 | |||
# | |||
enabled: false | |||
# Whether to require SEP-10 authentication for SEP-38 requests. | |||
requires_sep10: false |
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 feel requires_sep10
is vague because some of the endpoints already requires sep10.
How about:
requires_sep10: false | |
enforce_sep10: false |
sep38.endpoints.info.authentication_required
seems a bit over engineering.
|
||
init { | ||
sep38Client = Sep38Client(toml.getString("ANCHOR_QUOTE_SERVER"), jwt) | ||
sep38ClientWithoutJwt = Sep38Client(toml.getString("ANCHOR_QUOTE_SERVER"), "Invalid Token") |
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 only used in test endpoints does not required valid token when auth is disabled()
. It's better to use local var.
Description
Add sep38.requires_sep10 configuration with default value to FALSE
Context
Currently, according to the SEP-38 spec, some of the SEP38 endpoints have SEP-10 as optional. This task seeks ensure we support this optionality by add configurability to these endpoints' SEP-10 requirements.
Testing
Tests were added to verify url pattern was added to filter if auth is required