Repository navigation
Conversation
A misconfigured ILP_ADDRESS (for example an invalid prefix) did not stop the backend from starting. The problem only showed when an Open Payments payment used the address. Read ILP_ADDRESS through envIlpAddress(), which checks it with isValidIlpAddress() from ilp-packet and throws a clear error at startup when the address is not valid. Closes interledger#3945
✅ Deploy Preview for brilliant-pasca-3e80ec ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This branch has not been deployed
This file contains hidden or 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
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.
Changes proposed in this pull request
ILP_ADDRESSthrough a newenvIlpAddress()inpackages/backend/src/config/app.ts. It checks the value withisValidIlpAddress()fromilp-packet(already a backend dependency) and throws at startup when the address is not valid.packages/backend/src/config/app.test.ts: valid addresses are accepted, six invalid ones (invalid,test,test..rafiki,test.raf iki,TEST.rafiki,test.rafiki.) make loading the config throw, and a missing variable still throws the existing "must be set" error.Context
Before this, a misconfigured
ILP_ADDRESSsuch as an invalid prefix let the backend start, and the problem only showed up when an Open Payments payment used the address (see the issue). EveryILP_ADDRESSvalue in this repository (localenv, the integration setup, the Jest env) passes the validator, so existing setups are not affected.Testing: the new test fails on
main(6 of 10 cases fail, because nothing throws) and passes with this change (10 of 10). I ran it with a copy of the backend Jest config that dropsglobalSetup,globalTeardownand the custom environment, because those need Docker and I could not run Docker here; this test does not use the database. ESLint and Prettier pass on the changed files. I did not run the rest of the backend test suite.I used an AI assistant (Claude) while working on this; I reviewed and tested the change.
fixes #3945
Checklist
fixes #number