feat: implement url shortener for invitation urls
Description
Implementation of short urls. When a invitation is created, it's represented with two urls, long and short. The flow looks like this:
Let's say we have two agents A and B.
- On the A we create invitiation /this will return two urls/
- On B we call accept invitation with the short url
- B will make a get request to the short url and will expect A to respond with a json of the out of band record (Done in AFJ)
- Once B have the result everything continues as with the long urls.
This every other agent that consumes the short url, will work as long as they use AFJ. If not than additional get request must be added.
Changes:
- Added a separate express server, to the Inbout transporter, instead of the default one. This way we can add a handler for get requests.
- Added a handler for get requests that returns oob json
- Changed create Invitation method and dto to return the invitationUrl and shortInvitationUrl
- Add logic for creating short url based on peer url and oob id
Related issues
- No related issues
Testing
- manual testing
Checklist
-
I have updated the documentation (if necessary) -
I have added unit tests for new functionality (if applicable) -
My code follows the style guidelines of this project -
I have tested this code on my local machine before submitting this MR
Reviewers
Additional Notes
- no additional notes
Closes #15 (closed)
Edited by Zdravko Iliev