zn url with passwords

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

zn url with passwords

Camillo Bruni-3
Am I correct in the assumption that ZnURL does not support a password in the url authority?

'http://username@domain:1234/path?query_string#fragment_id' asZnUrl
vs
'http://username:password@domain:1234/path?query_string#fragment_id' asZnUrl

where the latter one fails. Then I just realized that

'http://username@domain:1234/path?query_string#fragment_id' asZnUrl host = 'username@domain'

I would have expected it to return only 'domain'.
Reply | Threaded
Open this post in threaded view
|

Re: zn url with passwords

Sven Van Caekenberghe-2

On 29 Jan 2013, at 13:01, Camillo Bruni <[hidden email]> wrote:

> Am I correct in the assumption that ZnURL does not support a password in the url authority?
>
> 'http://username@domain:1234/path?query_string#fragment_id' asZnUrl
> vs
> 'http://username:password@domain:1234/path?query_string#fragment_id' asZnUrl
>
> where the latter one fails. Then I just realized that
>
> 'http://username@domain:1234/path?query_string#fragment_id' asZnUrl host = 'username@domain'
>
> I would have expected it to return only 'domain'.

You are correct: username/password in URLs is not something that is supported by ZnUrl, by design actually.

Why do you need it ?

What would you do with it, expect to happen ?

You can always do

        ZnClient new
                url: 'http://domain:1234/path?query_string#fragment_id';
                username: 'username' password: 'password';
                get.

I guess it would not be impossible to extend ZnUrl, but it will make for an uglier object and parser….

ZnUrl started life as a clone from WAUrl from Seaside, and they don't support that either.

Sven

--
Sven Van Caekenberghe
http://stfx.eu
Smalltalk is the Red Pill


Reply | Threaded
Open this post in threaded view
|

Re: zn url with passwords

Damien Cassou
On Tue, Jan 29, 2013 at 1:46 PM, Sven Van Caekenberghe <[hidden email]> wrote:
> You are correct: username/password in URLs is not something that is supported by ZnUrl, by design actually.
>
> Why do you need it ?

we are implementing the Git protocol with the HTTP backend. Git urls
often comes with username inside and that's why we thought it would be
easier to just use #asZnUrl. And these username and password elements
are part of the standard
(http://en.wikipedia.org/wiki/URI_scheme#Examples).

--
Damien Cassou
http://damiencassou.seasidehosting.st

"Success is the ability to go from one failure to another without
losing enthusiasm."
Winston Churchill

Reply | Threaded
Open this post in threaded view
|

Re: zn url with passwords

Sven Van Caekenberghe-2

On 29 Jan 2013, at 14:49, Damien Cassou <[hidden email]> wrote:

> On Tue, Jan 29, 2013 at 1:46 PM, Sven Van Caekenberghe <[hidden email]> wrote:
>> You are correct: username/password in URLs is not something that is supported by ZnUrl, by design actually.
>>
>> Why do you need it ?
>
> we are implementing the Git protocol with the HTTP backend. Git urls
> often comes with username inside and that's why we thought it would be
> easier to just use #asZnUrl. And these username and password elements
> are part of the standard
> (http://en.wikipedia.org/wiki/URI_scheme#Examples).

I will see if I can add it in an elegant way.

I still feel it is a bit old school, from the FTP days, 99% of URLs won't ever have this.

But yes, I know it is used in some places, like git...

> --
> Damien Cassou
> http://damiencassou.seasidehosting.st
>
> "Success is the ability to go from one failure to another without
> losing enthusiasm."
> Winston Churchill


Reply | Threaded
Open this post in threaded view
|

Re: zn url with passwords

Camillo Bruni-3

On 2013-01-29, at 15:11, Sven Van Caekenberghe <[hidden email]> wrote:

>
> On 29 Jan 2013, at 14:49, Damien Cassou <[hidden email]> wrote:
>
>> On Tue, Jan 29, 2013 at 1:46 PM, Sven Van Caekenberghe <[hidden email]> wrote:
>>> You are correct: username/password in URLs is not something that is supported by ZnUrl, by design actually.
>>>
>>> Why do you need it ?
>>
>> we are implementing the Git protocol with the HTTP backend. Git urls
>> often comes with username inside and that's why we thought it would be
>> easier to just use #asZnUrl. And these username and password elements
>> are part of the standard
>> (http://en.wikipedia.org/wiki/URI_scheme#Examples).
>
> I will see if I can add it in an elegant way.
>
> I still feel it is a bit old school, from the FTP days, 99% of URLs won't ever have this.
>
> But yes, I know it is used in some places, like git...

well, we can easily write around it and keep the passwords separate.
might make more sense anyway :)
Reply | Threaded
Open this post in threaded view
|

Re: zn url with passwords

Damien Cassou
On Tue, Jan 29, 2013 at 3:13 PM, Camillo Bruni <[hidden email]> wrote:
> well, we can easily write around it and keep the passwords separate.
> might make more sense anyway :)

the username is very often present however


--
Damien Cassou
http://damiencassou.seasidehosting.st

"Success is the ability to go from one failure to another without
losing enthusiasm."
Winston Churchill

Reply | Threaded
Open this post in threaded view
|

Re: zn url with passwords

Sven Van Caekenberghe-2
In reply to this post by Sven Van Caekenberghe-2

On 29 Jan 2013, at 15:11, Sven Van Caekenberghe <[hidden email]> wrote:

> On 29 Jan 2013, at 14:49, Damien Cassou <[hidden email]> wrote:
>
>> On Tue, Jan 29, 2013 at 1:46 PM, Sven Van Caekenberghe <[hidden email]> wrote:
>>> You are correct: username/password in URLs is not something that is supported by ZnUrl, by design actually.
>>>
>>> Why do you need it ?
>>
>> we are implementing the Git protocol with the HTTP backend. Git urls
>> often comes with username inside and that's why we thought it would be
>> easier to just use #asZnUrl. And these username and password elements
>> are part of the standard
>> (http://en.wikipedia.org/wiki/URI_scheme#Examples).
>
> I will see if I can add it in an elegant way.
>
> I still feel it is a bit old school, from the FTP days, 99% of URLs won't ever have this.
>
> But yes, I know it is used in some places, like git...


I added this (in bleedingEdge) so that

        'git://[hidden email]/bar' asZnUrl

works as expected.

Sven

==================== Summary ====================

Name: Zinc-Resource-Meta-Core-SvenVanCaekenberghe.9
Author: SvenVanCaekenberghe
Time: 30 January 2013, 7:41:44 am
UUID: 9c2126e3-8881-49f5-8d59-38efbb6d796d
Ancestors: Zinc-Resource-Meta-Core-SvenVanCaekenberghe.8

Extended ZnUrl to support the optional user info (username and optional password) component;
Modified ZnUrl to allow any scheme, added #enforceKnownScheme


--
Sven Van Caekenberghe
http://stfx.eu
Smalltalk is the Red Pill


Reply | Threaded
Open this post in threaded view
|

Re: zn url with passwords

Damien Cassou
On Wed, Jan 30, 2013 at 7:50 PM, Sven Van Caekenberghe <[hidden email]> wrote:
>
> I added this (in bleedingEdge) so that
>
>         'git://[hidden email]/bar' asZnUrl
>
> works as expected.


thank you so much Sven!

--
Damien Cassou
http://damiencassou.seasidehosting.st

"Success is the ability to go from one failure to another without
losing enthusiasm."
Winston Churchill

Reply | Threaded
Open this post in threaded view
|

Re: zn url with passwords

Camillo Bruni-3

On 2013-01-31, at 10:58, Damien Cassou <[hidden email]> wrote:

> On Wed, Jan 30, 2013 at 7:50 PM, Sven Van Caekenberghe <[hidden email]> wrote:
>>
>> I added this (in bleedingEdge) so that
>>
>>        'git://[hidden email]/bar' asZnUrl
>>
>> works as expected.
>
>
> thank you so much Sven!

nice ;)