-
Notifications
You must be signed in to change notification settings - Fork 64
[Compliance] allow_access endpoint records should be checked before calling ask_user callback #36
Comments
@nullstyle do you know if there are any plans to change the general behavior w/r/t this? At current, it looks like either you implement I can imagine intended or deprecated scenarios (I don’t really know the history/genesis of this feature) where you whitelist/blacklist w/ the API and fall back to the callback or something, but that certainly doesn’t seem to be how it works now. Just trying to understand the direction this is moving in (if any) for documenting. |
ask_user is a fallback in case allow_access fails. So it would be:
|
Hmmm, it could be that I’m reading it wrong, but it seems like the only time the database is checked (i.e. we look at the …so it can’t really fall back. Is what you’re describing the intended behavior and the current implementation just isn’t correct? |
I haven't looked at the implementation. What I described is how it should work |
It works exactly as @jedmccaleb explained. Excerpt from if rh.Config.Callbacks.AskUser == "" {
// There is no ask_user callback specified
// Check if domain or user*domain is in allowed table
if "record exists in a DB" {
return compliance.AuthStatusOk
} else {
return compliance.AuthStatusDenied
}
} else {
// Send request to ask_user callback
if "callback returned OK" {
return compliance.AuthStatusOk
} else {
return compliance.AuthStatusDenied
}
}
Yeah, you're right. This sentence is true, however, when
These two options seem similar but |
Right! I started this issue as a result of reading that code :) I think the confusion here is that we each understood @jedmccaleb's answer very differently. He wrote:
Which I interpreted like:
And you interpreted like:
For my part, I definitely thought he meant the former, but now I don’t know. Can you clarify, @jedmccaleb? If the latter, everything about the code is 👍. If the former, it seems like there’s a bug in the code in addition to the documentation issue. Anyway! I can do a PR for clarifying all this in the readme, but I want to make sure the current state of the code matches the intended design (our point of confusion above). If it does not, I should probably hold off, because documenting the current state of affairs will set up wrong future expectations for users and documenting the intended state of affairs would lead someone to think they can use the service in a way that won’t actually work today :P |
OK, I think I understand now. I checked the Compliance Server design doc and there's a following sentence:
It's not clear and can be implemented in at least two different ways. So yeah, let's wait for Jed to clarify. PS. @Mr0grog I can share this doc with you but I don't have your email. Send me a message :) |
Yeah Rob's first interpretation is correct. To rewrite your code bartek:
but don't fix it till scott lands his changes |
After all the discussion in stellar-deprecated#36, this attempts to improve the README for compliance server to explain how `/allow_access`, `/remove_access`, and `callbacks.ask_user` are intended to work together. NOTE the current code does not reflect this documentation; it still needs to be updated to fix stellar-deprecated#36.
After all the discussion in stellar-deprecated#36, this attempts to improve the README for compliance server to explain how `/allow_access`, `/remove_access`, and `callbacks.ask_user` are intended to work together. NOTE the current code does not reflect this documentation; it still needs to be updated to fix stellar-deprecated#36.
The readme for compliance currently states that if the
ask_user
callback is not specified, “then the customer information won't be given to the other FI.” This isn’t actually true—it falls back to users and domains that have been whitelisted using theallow_access
endpoint.Additionally, the description of the
allow_access
endpoint and its effects is incredibly unclear. I definitely didn’t understand it until I spent some time browsing the source, which a user definitely should not need to do.The text was updated successfully, but these errors were encountered: