-
Notifications
You must be signed in to change notification settings - Fork 31
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
Fix domain/port discernment for transfers routed through epicbox #90
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- We are calling regex parsing on same data twice. Second time it is invalid and the domain is dropped as a result - Ports were never being marshalled through properly. that's been fixed here - Added logging to various areas for clearer discernment of data before its sent over wire
- Previously, this was being stripped in cases where address.domain == DEFAULT_EPICBOX_DOMAIN - This makes logs a bit confusing on epicbox side, so we should always include it
- Rather than explicitly typed 443 - No actual changes, just for readability
skykingisepic
approved these changes
Aug 16, 2023
who-biz
commented
Aug 17, 2023
close_connection: bool, | ||
) -> Result<(), Error> { | ||
let to = EpicboxAddress::from_str(&to.to_string())?; |
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 the important removal, where regex parsing was happening twice.
FYI, should give this two small changes tomorrow, upon a closer look. Reviews will become stale once I push those, and they'll need re-approved. |
- in epicbox adapter, we only handle canonical Epicbox addresses now - handling the other types here is irrelevant
blacktyger
approved these changes
Aug 17, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR includes 3 distinct fixes for
epic-wallet
usage when routing throughepicbox
.1. Silent overwriting of epicbox address domain & port
EpicboxAddress::from_str()
was being called twice prior to sending. This function validates and parses our user-provided epicbox destinationdomain
andport
instr
portion of request (which includes our actual destination, after being parsed by regex)epicbox.epic.tech
unintentionally.2. User-provided port was not being passed through to JSON request
Option
type not being unwrapped properly prior to sending to epicbox3.
EpicboxAddress::stripped()
member function was written in such a way that default domainepicbox.epic.tech
is removed from address<pubkey>@<domain>
is always passed through in-full.