taler
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Taler] mint base URL subtleties


From: Florian Dold
Subject: [Taler] mint base URL subtleties
Date: Tue, 8 Dec 2015 21:19:53 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0

Hi all,

we need to agree about some subtleties of the mint base URL.

1. URLs without a schema part.

According to RFC2396, URLs without the schema part are considered
relative URLs.  What should we do if the wallet-user enters such a URL?

a) Reject such URLs
b) Have the wallet normalize those URLs (making them an absolute URL by
adding 'http://') before storing them anywhere or using them in requests.

Note that we should never have relative URLs in any database / request
because some libs / languages give unexpected or even stupid results,
e.g. php with pecl-http:

  php > echo ( new http\Url("taler.net") );
  http://tripwire/taler.net

What were they thinking??  Adding the local hostname?  Not even just
'localhost'?

I'm leaning towards option 1.b., since that's what browsers commonly do.


2. URL joining

Joining an absolute with a relative URL has (in browsers and most
libraries I know) very specific semantics, which might not match what we
expect in Taler.  For example in Python3 (note the slashes):

  >>> urllib.parse.urljoin("http://taler.net/mint1";, "keys")
  'http://taler.net/keys'
  >>> urllib.parse.urljoin("http://taler.net/mint1/";, "keys")
  'http://taler.net/mint1/keys'

This raises the question:  When we're given a base URL, should it matter
that it ends with a slash or not?

Keeping the url joining semantics, we could have base URLSs like

  http://taler.net/mint/landingpage.html

and our '/keys' would still be http://taler.net/mint/keys.

However it's quite confusing to the user that the slash is so significant!

I see three options:

a) Normalize the mint URL to end with a slash when the user puts it into
the wallet
b) Implicitly add a slash (if it not exists) to the end of the base URL
when joining things
c) Make the slash 'significant'

Any opinions?

Gabor was leaning towards (2.b) I think; personally I don't really mind
but we must agree on something.

3) Multiple base URLs

How should multiple base URLs be handled?  Should there be a canonical
mint URL that's given in '/keys'?  What is stored in our wallet database
if the user adds a reserve with the same mint twice, but specifies
different URLs that the mint both provides?

One possibility is to store for each reserve the mint base URL that was
used, and for each mint in the DB the URL that we used last to update
it.  Not sure if that's really necessary though ...


Please let me know your opinion on this.

Cheers,
Florian



reply via email to

[Prev in Thread] Current Thread [Next in Thread]