Skip to content
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

Directly use resource server URL to generate URLs for Open Payments resources #3247

Open
1 task
mkurapov opened this issue Jan 28, 2025 · 0 comments
Open
1 task
Assignees
Labels
pkg: backend Changes in the backend package.

Comments

@mkurapov
Copy link
Contributor

mkurapov commented Jan 28, 2025

Context

Currently, in order to generate the URLs for Open Payments resources (like incoming payments, quotes, outgoing payments), we generate the URL as such:

  public getUrl(walletAddress: WalletAddress): string {
    const url = new URL(walletAddress.url)
    return `${url.origin}${Quote.urlPath}/${this.id}`
  }

However, this assumes that the wallet address URL origin is equal to the resource server. In a typical implementation, wallet address URL origin = resource server URL, but in the context of Open Payments, it doesn't need to be.

To allow for more flexibility, instead of using wallet address URL origin to getUrl on a resouce, we should use the Open Payments resource server URL directly.

Todos

  • Update the getUrl methods on our models to directly use the resource server URL instead of the wallet address URL origin
@github-project-automation github-project-automation bot moved this to Backlog in Rafiki Jan 28, 2025
@mkurapov mkurapov added the pkg: backend Changes in the backend package. label Jan 28, 2025
@mkurapov mkurapov moved this from Backlog to Todo in Rafiki Feb 18, 2025
@cozminu cozminu self-assigned this Feb 21, 2025
@cozminu cozminu moved this from Todo to In Progress in Rafiki Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: backend Changes in the backend package.
Projects
Status: In Progress
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants