Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Escape or disallow ILPAddress reserved characters when creating accounts #5

Open
sappenin opened this issue Jan 16, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@sappenin
Copy link
Contributor

sappenin commented Jan 16, 2020

If an account has a disallowed character, we need to encode the value so that we don't accidentally add things into the ILP address during SPSP resolution. For example, if an account is created with an id of test+david (e.g., the + is an illegal character, the account will be created but the routing-table entry will be invalid (hermes will throw the following exception):

19:39:52.480 [qtp428061834-17] WARN  o.i.s.s.services.NewAccountService - Failed to create route
java.lang.IllegalArgumentException: The 'test+david' segment has an invalid format
	at org.interledger.core.InterledgerAddressPrefix$AbstractInterledgerAddressPrefix.check(InterledgerAddressPrefix.java:244)
	at org.interledger.core.InterledgerAddressPrefixBuilder$ImmutableInterledgerAddressPrefix.validate(InterledgerAddressPrefixBuilder.java:193)
	at org.interledger.core.InterledgerAddressPrefixBuilder$ImmutableInterledgerAddressPrefix.access$100(InterledgerAddressPrefixBuilder.java:117)
	at org.interledger.core.InterledgerAddressPrefixBuilder.build(InterledgerAddressPrefixBuilder.java:99)
	at org.interledger.core.InterledgerAddressPrefix.of(InterledgerAddressPrefix.java:70)
	at org.interledger.core.InterledgerAddressPrefix.with(InterledgerAddressPrefix.java:152)
	at org.interledger.spsp.server.services.NewAccountService.createAccount(NewAccountService.java:68)
	at org.interledger.spsp.s...

One thing that is not an issue is dots (.) (e.g., david.foo). These work properly.

@sappenin sappenin reopened this Mar 20, 2020
@sappenin sappenin added the bug Something isn't working label Mar 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant