DefaultComponent - Validating URI

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

DefaultComponent - Validating URI

Claus Ibsen-2
Hi

I was messing CAMEL-1096 for camel-mail and I mistyped the URI adding
a 2nd ? char in the URI string.
However this one passes the validation. I was wondering if that normal?

eg:
pop3://localhost?username=james&mail.pop3.forgettopheaders=true?ddd=sss

Would validate into 2 parameters
username=james
mail.pop3.forgettopheaders=true?ddd=sss

So the 2nd parameter value is: true?ddd=sss

I was wondering if we should add some validation that a 2nd ? is not
allowed in the URI string?


/Claus Ibsen
Apache Camel Committer
Blog: http://davsclaus.blogspot.com/
Reply | Threaded
Open this post in threaded view
|

Re: DefaultComponent - Validating URI

Jon Anstey
I don't think we should allow a second '?' character.

+1 on adding validation for this.

On Sun, Nov 16, 2008 at 10:53 AM, Claus Ibsen <[hidden email]> wrote:

> Hi
>
> I was messing CAMEL-1096 for camel-mail and I mistyped the URI adding
> a 2nd ? char in the URI string.
> However this one passes the validation. I was wondering if that normal?
>
> eg:
> pop3://localhost?username=james&mail.pop3.forgettopheaders=true?ddd=sss
>
> Would validate into 2 parameters
> username=james
> mail.pop3.forgettopheaders=true?ddd=sss
>
> So the 2nd parameter value is: true?ddd=sss
>
> I was wondering if we should add some validation that a 2nd ? is not
> allowed in the URI string?
>
>
> /Claus Ibsen
> Apache Camel Committer
> Blog: http://davsclaus.blogspot.com/
>



--
Cheers,
Jon

http://janstey.blogspot.com/
Reply | Threaded
Open this post in threaded view
|

Re: DefaultComponent - Validating URI

hadrian
In reply to this post by Claus Ibsen-2
My personal preference would be to not add extra validation.  The main  
reason is that there are quite a few other characters that are not  
allowed either ('=' for instance) and in the general case url  
(semantical) validation is not an easy thing to do (i.e. the benefit  
would be quite limited imho).  The url parser did the right thing, and  
I think we could rely on developers testing their apps and make sure  
that the url they pass is indeed the intended one.

So a non-binding -1 from me.

Cheers
Hadrian


On Nov 16, 2008, at 9:23 AM, Claus Ibsen wrote:

> Hi
>
> I was messing CAMEL-1096 for camel-mail and I mistyped the URI adding
> a 2nd ? char in the URI string.
> However this one passes the validation. I was wondering if that  
> normal?
>
> eg:
> pop3://localhost?username=james&mail.pop3.forgettopheaders=true?
> ddd=sss
>
> Would validate into 2 parameters
> username=james
> mail.pop3.forgettopheaders=true?ddd=sss
>
> So the 2nd parameter value is: true?ddd=sss
>
> I was wondering if we should add some validation that a 2nd ? is not
> allowed in the URI string?
>
>
> /Claus Ibsen
> Apache Camel Committer
> Blog: http://davsclaus.blogspot.com/

Reply | Threaded
Open this post in threaded view
|

Re: DefaultComponent - Validating URI

Jon Anstey
Good point Hadrian. Also maybe somebody out there is depending on this
functionality? Maybe we could just log a warning if we see a second '?'

On Tue, Nov 18, 2008 at 3:07 AM, Hadrian Zbarcea <[hidden email]> wrote:

> My personal preference would be to not add extra validation.  The main
> reason is that there are quite a few other characters that are not allowed
> either ('=' for instance) and in the general case url (semantical)
> validation is not an easy thing to do (i.e. the benefit would be quite
> limited imho).  The url parser did the right thing, and I think we could
> rely on developers testing their apps and make sure that the url they pass
> is indeed the intended one.
>
> So a non-binding -1 from me.
>
> Cheers
> Hadrian
>
>
>
> On Nov 16, 2008, at 9:23 AM, Claus Ibsen wrote:
>
>  Hi
>>
>> I was messing CAMEL-1096 for camel-mail and I mistyped the URI adding
>> a 2nd ? char in the URI string.
>> However this one passes the validation. I was wondering if that normal?
>>
>> eg:
>> pop3://localhost?username=james&mail.pop3.forgettopheaders=true?ddd=sss
>>
>> Would validate into 2 parameters
>> username=james
>> mail.pop3.forgettopheaders=true?ddd=sss
>>
>> So the 2nd parameter value is: true?ddd=sss
>>
>> I was wondering if we should add some validation that a 2nd ? is not
>> allowed in the URI string?
>>
>>
>> /Claus Ibsen
>> Apache Camel Committer
>> Blog: http://davsclaus.blogspot.com/
>>
>
>


--
Cheers,
Jon

http://janstey.blogspot.com/
Reply | Threaded
Open this post in threaded view
|

Re: DefaultComponent - Validating URI

hadrian
What about other invalid characters?  We don't need extra validation  
imho.  Claus figured out pretty quickly what was wrong. I would assume  
other users won't have a hard time with what Camel offers already.  
I'd like to keep Camel lean.

What I would like to see though is more tools.  Those *should*  
validate as well as possible that a url is correct.

My $0.02,
Hadrian

On Nov 18, 2008, at 7:55 AM, Jon Anstey wrote:

> Good point Hadrian. Also maybe somebody out there is depending on this
> functionality? Maybe we could just log a warning if we see a second  
> '?'
>
> On Tue, Nov 18, 2008 at 3:07 AM, Hadrian Zbarcea  
> <[hidden email]> wrote:
>
>> My personal preference would be to not add extra validation.  The  
>> main
>> reason is that there are quite a few other characters that are not  
>> allowed
>> either ('=' for instance) and in the general case url (semantical)
>> validation is not an easy thing to do (i.e. the benefit would be  
>> quite
>> limited imho).  The url parser did the right thing, and I think we  
>> could
>> rely on developers testing their apps and make sure that the url  
>> they pass
>> is indeed the intended one.
>>
>> So a non-binding -1 from me.
>>
>> Cheers
>> Hadrian
>>
>>
>>
>> On Nov 16, 2008, at 9:23 AM, Claus Ibsen wrote:
>>
>> Hi
>>>
>>> I was messing CAMEL-1096 for camel-mail and I mistyped the URI  
>>> adding
>>> a 2nd ? char in the URI string.
>>> However this one passes the validation. I was wondering if that  
>>> normal?
>>>
>>> eg:
>>> pop3://localhost?username=james&mail.pop3.forgettopheaders=true?
>>> ddd=sss
>>>
>>> Would validate into 2 parameters
>>> username=james
>>> mail.pop3.forgettopheaders=true?ddd=sss
>>>
>>> So the 2nd parameter value is: true?ddd=sss
>>>
>>> I was wondering if we should add some validation that a 2nd ? is not
>>> allowed in the URI string?
>>>
>>>
>>> /Claus Ibsen
>>> Apache Camel Committer
>>> Blog: http://davsclaus.blogspot.com/
>>>
>>
>>
>
>
> --
> Cheers,
> Jon
>
> http://janstey.blogspot.com/

Reply | Threaded
Open this post in threaded view
|

Re: DefaultComponent - Validating URI

Jon Anstey
On Tue, Nov 18, 2008 at 9:38 AM, Hadrian Zbarcea <[hidden email]> wrote:

> What about other invalid characters?  We don't need extra validation imho.
>  Claus figured out pretty quickly what was wrong. I would assume other users
> won't have a hard time with what Camel offers already.  I'd like to keep
> Camel lean.


OK, I see how this could get a bit out of hand :)


>
>
> What I would like to see though is more tools.  Those *should* validate as
> well as possible that a url is correct.


I believe the FUSE tooling already does this for a subset of endpoints
http://fusesource.com/products/fuse-integration-designer. So we're getting
closer!


>
>
> My $0.02,
> Hadrian
>
>
> On Nov 18, 2008, at 7:55 AM, Jon Anstey wrote:
>
>  Good point Hadrian. Also maybe somebody out there is depending on this
>> functionality? Maybe we could just log a warning if we see a second '?'
>>
>> On Tue, Nov 18, 2008 at 3:07 AM, Hadrian Zbarcea <[hidden email]>
>> wrote:
>>
>>  My personal preference would be to not add extra validation.  The main
>>> reason is that there are quite a few other characters that are not
>>> allowed
>>> either ('=' for instance) and in the general case url (semantical)
>>> validation is not an easy thing to do (i.e. the benefit would be quite
>>> limited imho).  The url parser did the right thing, and I think we could
>>> rely on developers testing their apps and make sure that the url they
>>> pass
>>> is indeed the intended one.
>>>
>>> So a non-binding -1 from me.
>>>
>>> Cheers
>>> Hadrian
>>>
>>>
>>>
>>> On Nov 16, 2008, at 9:23 AM, Claus Ibsen wrote:
>>>
>>> Hi
>>>
>>>>
>>>> I was messing CAMEL-1096 for camel-mail and I mistyped the URI adding
>>>> a 2nd ? char in the URI string.
>>>> However this one passes the validation. I was wondering if that normal?
>>>>
>>>> eg:
>>>> pop3://localhost?username=james&mail.pop3.forgettopheaders=true?ddd=sss
>>>>
>>>> Would validate into 2 parameters
>>>> username=james
>>>> mail.pop3.forgettopheaders=true?ddd=sss
>>>>
>>>> So the 2nd parameter value is: true?ddd=sss
>>>>
>>>> I was wondering if we should add some validation that a 2nd ? is not
>>>> allowed in the URI string?
>>>>
>>>>
>>>> /Claus Ibsen
>>>> Apache Camel Committer
>>>> Blog: http://davsclaus.blogspot.com/
>>>>
>>>>
>>>
>>>
>>
>> --
>> Cheers,
>> Jon
>>
>> http://janstey.blogspot.com/
>>
>
>


--
Cheers,
Jon

http://janstey.blogspot.com/
Reply | Threaded
Open this post in threaded view
|

Re: DefaultComponent - Validating URI

Claus Ibsen-2
In reply to this post by hadrian
Hi

Actually I only disconvered it as I was running a unit test that
expected it to be "true" but it was "true?ddd=xxx"

And end user could by mistake add parameters that he think are
seperated but is acutally only one parameter but since the type maybe
is a string then its true?ddd=xxx and not two parameters with types
of: boolean and string.

But since it's a valid URI then we can't get any help there. But maybe
have a WARN logging for stuff that really looks as invalid parameters
such as have duplicate ? chars.

Are anyone familiar with other frameworks that is URI based and how
they handle such a problem?

I am using IDEA that is a clever editor and it doesn't give me a hint
that the URI is probably wrong. So I doubt that tooling is helping out
much.


/Claus Ibsen
Apache Camel Committer
Blog: http://davsclaus.blogspot.com/



On Tue, Nov 18, 2008 at 2:08 PM, Hadrian Zbarcea <[hidden email]> wrote:

> What about other invalid characters?  We don't need extra validation imho.
>  Claus figured out pretty quickly what was wrong. I would assume other users
> won't have a hard time with what Camel offers already.  I'd like to keep
> Camel lean.
>
> What I would like to see though is more tools.  Those *should* validate as
> well as possible that a url is correct.
>
> My $0.02,
> Hadrian
>
> On Nov 18, 2008, at 7:55 AM, Jon Anstey wrote:
>
>> Good point Hadrian. Also maybe somebody out there is depending on this
>> functionality? Maybe we could just log a warning if we see a second '?'
>>
>> On Tue, Nov 18, 2008 at 3:07 AM, Hadrian Zbarcea <[hidden email]>
>> wrote:
>>
>>> My personal preference would be to not add extra validation.  The main
>>> reason is that there are quite a few other characters that are not
>>> allowed
>>> either ('=' for instance) and in the general case url (semantical)
>>> validation is not an easy thing to do (i.e. the benefit would be quite
>>> limited imho).  The url parser did the right thing, and I think we could
>>> rely on developers testing their apps and make sure that the url they
>>> pass
>>> is indeed the intended one.
>>>
>>> So a non-binding -1 from me.
>>>
>>> Cheers
>>> Hadrian
>>>
>>>
>>>
>>> On Nov 16, 2008, at 9:23 AM, Claus Ibsen wrote:
>>>
>>> Hi
>>>>
>>>> I was messing CAMEL-1096 for camel-mail and I mistyped the URI adding
>>>> a 2nd ? char in the URI string.
>>>> However this one passes the validation. I was wondering if that normal?
>>>>
>>>> eg:
>>>> pop3://localhost?username=james&mail.pop3.forgettopheaders=true?ddd=sss
>>>>
>>>> Would validate into 2 parameters
>>>> username=james
>>>> mail.pop3.forgettopheaders=true?ddd=sss
>>>>
>>>> So the 2nd parameter value is: true?ddd=sss
>>>>
>>>> I was wondering if we should add some validation that a 2nd ? is not
>>>> allowed in the URI string?
>>>>
>>>>
>>>> /Claus Ibsen
>>>> Apache Camel Committer
>>>> Blog: http://davsclaus.blogspot.com/
>>>>
>>>
>>>
>>
>>
>> --
>> Cheers,
>> Jon
>>
>> http://janstey.blogspot.com/
>
>
Reply | Threaded
Open this post in threaded view
|

Re: DefaultComponent - Validating URI

Willem.Jiang
Administrator
It is easy to find if there are duplicate '?' characters in the URI
string. (Just one if statement in the DefaultComponent.validateURI() method)
BTW, there are already some check points in the valiateURI(), we could
add more if we need.

Just my 2 cents.

Willem

Claus Ibsen wrote:

> Hi
>
> Actually I only disconvered it as I was running a unit test that
> expected it to be "true" but it was "true?ddd=xxx"
>
> And end user could by mistake add parameters that he think are
> seperated but is acutally only one parameter but since the type maybe
> is a string then its true?ddd=xxx and not two parameters with types
> of: boolean and string.
>
> But since it's a valid URI then we can't get any help there. But maybe
> have a WARN logging for stuff that really looks as invalid parameters
> such as have duplicate ? chars.
>
> Are anyone familiar with other frameworks that is URI based and how
> they handle such a problem?
>
> I am using IDEA that is a clever editor and it doesn't give me a hint
> that the URI is probably wrong. So I doubt that tooling is helping out
> much.
>
>
> /Claus Ibsen
> Apache Camel Committer
> Blog: http://davsclaus.blogspot.com/
>
>
>
> On Tue, Nov 18, 2008 at 2:08 PM, Hadrian Zbarcea <[hidden email]> wrote:
>> What about other invalid characters?  We don't need extra validation imho.
>>  Claus figured out pretty quickly what was wrong. I would assume other users
>> won't have a hard time with what Camel offers already.  I'd like to keep
>> Camel lean.
>>
>> What I would like to see though is more tools.  Those *should* validate as
>> well as possible that a url is correct.
>>
>> My $0.02,
>> Hadrian
>>
>> On Nov 18, 2008, at 7:55 AM, Jon Anstey wrote:
>>
>>> Good point Hadrian. Also maybe somebody out there is depending on this
>>> functionality? Maybe we could just log a warning if we see a second '?'
>>>
>>> On Tue, Nov 18, 2008 at 3:07 AM, Hadrian Zbarcea <[hidden email]>
>>> wrote:
>>>
>>>> My personal preference would be to not add extra validation.  The main
>>>> reason is that there are quite a few other characters that are not
>>>> allowed
>>>> either ('=' for instance) and in the general case url (semantical)
>>>> validation is not an easy thing to do (i.e. the benefit would be quite
>>>> limited imho).  The url parser did the right thing, and I think we could
>>>> rely on developers testing their apps and make sure that the url they
>>>> pass
>>>> is indeed the intended one.
>>>>
>>>> So a non-binding -1 from me.
>>>>
>>>> Cheers
>>>> Hadrian
>>>>
>>>>
>>>>
>>>> On Nov 16, 2008, at 9:23 AM, Claus Ibsen wrote:
>>>>
>>>> Hi
>>>>> I was messing CAMEL-1096 for camel-mail and I mistyped the URI adding
>>>>> a 2nd ? char in the URI string.
>>>>> However this one passes the validation. I was wondering if that normal?
>>>>>
>>>>> eg:
>>>>> pop3://localhost?username=james&mail.pop3.forgettopheaders=true?ddd=sss
>>>>>
>>>>> Would validate into 2 parameters
>>>>> username=james
>>>>> mail.pop3.forgettopheaders=true?ddd=sss
>>>>>
>>>>> So the 2nd parameter value is: true?ddd=sss
>>>>>
>>>>> I was wondering if we should add some validation that a 2nd ? is not
>>>>> allowed in the URI string?
>>>>>
>>>>>
>>>>> /Claus Ibsen
>>>>> Apache Camel Committer
>>>>> Blog: http://davsclaus.blogspot.com/
>>>>>
>>>>
>>>
>>> --
>>> Cheers,
>>> Jon
>>>
>>> http://janstey.blogspot.com/
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: DefaultComponent - Validating URI

Hiram Chirino
In reply to this post by Claus Ibsen-2
I think the validation needs to go in at the component level.
It should be able to detect that  'true?ddd=sss' is not valid value
for  'mail.pop3.forgettopheaders' parameter.

For some other component/parameter a '?' in the value might be valid.

Regards,
Hiram

On Sun, Nov 16, 2008 at 9:23 AM, Claus Ibsen <[hidden email]> wrote:

> Hi
>
> I was messing CAMEL-1096 for camel-mail and I mistyped the URI adding
> a 2nd ? char in the URI string.
> However this one passes the validation. I was wondering if that normal?
>
> eg:
> pop3://localhost?username=james&mail.pop3.forgettopheaders=true?ddd=sss
>
> Would validate into 2 parameters
> username=james
> mail.pop3.forgettopheaders=true?ddd=sss
>
> So the 2nd parameter value is: true?ddd=sss
>
> I was wondering if we should add some validation that a 2nd ? is not
> allowed in the URI string?
>
>
> /Claus Ibsen
> Apache Camel Committer
> Blog: http://davsclaus.blogspot.com/
>



--
Regards,
Hiram

Blog: http://hiramchirino.com

Open Source SOA
http://open.iona.com
Reply | Threaded
Open this post in threaded view
|

Re: DefaultComponent - Validating URI

Claus Ibsen-2
Hi

Yeah but the concrete example it wouldn't really be possible as it's
just a bunch of properties for the java mail API. It uses properties
and not setteres where we could use the IntrospectionHelper to set the
parameters. So a true?ddd=sss would not be able to be set as a boolean
and the parameter would be invalid and Camel will detect this.

So I guess in this use-case we will leave it as is and that for some
other components a ? char might be valid. However I can't think of
such an example.


/Claus Ibsen
Apache Camel Committer
Blog: http://davsclaus.blogspot.com/



On Wed, Nov 19, 2008 at 6:54 PM, Hiram Chirino <[hidden email]> wrote:

> I think the validation needs to go in at the component level.
> It should be able to detect that  'true?ddd=sss' is not valid value
> for  'mail.pop3.forgettopheaders' parameter.
>
> For some other component/parameter a '?' in the value might be valid.
>
> Regards,
> Hiram
>
> On Sun, Nov 16, 2008 at 9:23 AM, Claus Ibsen <[hidden email]> wrote:
>> Hi
>>
>> I was messing CAMEL-1096 for camel-mail and I mistyped the URI adding
>> a 2nd ? char in the URI string.
>> However this one passes the validation. I was wondering if that normal?
>>
>> eg:
>> pop3://localhost?username=james&mail.pop3.forgettopheaders=true?ddd=sss
>>
>> Would validate into 2 parameters
>> username=james
>> mail.pop3.forgettopheaders=true?ddd=sss
>>
>> So the 2nd parameter value is: true?ddd=sss
>>
>> I was wondering if we should add some validation that a 2nd ? is not
>> allowed in the URI string?
>>
>>
>> /Claus Ibsen
>> Apache Camel Committer
>> Blog: http://davsclaus.blogspot.com/
>>
>
>
>
> --
> Regards,
> Hiram
>
> Blog: http://hiramchirino.com
>
> Open Source SOA
> http://open.iona.com
>
Reply | Threaded
Open this post in threaded view
|

Re: DefaultComponent - Validating URI

Hiram Chirino
An example use case could be where you pass a SQL query as a parameter
and part of the query has a ? in it.

On Wed, Nov 19, 2008 at 1:23 PM, Claus Ibsen <[hidden email]> wrote:

> Hi
>
> Yeah but the concrete example it wouldn't really be possible as it's
> just a bunch of properties for the java mail API. It uses properties
> and not setteres where we could use the IntrospectionHelper to set the
> parameters. So a true?ddd=sss would not be able to be set as a boolean
> and the parameter would be invalid and Camel will detect this.
>
> So I guess in this use-case we will leave it as is and that for some
> other components a ? char might be valid. However I can't think of
> such an example.
>
>
> /Claus Ibsen
> Apache Camel Committer
> Blog: http://davsclaus.blogspot.com/
>
>
>
> On Wed, Nov 19, 2008 at 6:54 PM, Hiram Chirino <[hidden email]> wrote:
>> I think the validation needs to go in at the component level.
>> It should be able to detect that  'true?ddd=sss' is not valid value
>> for  'mail.pop3.forgettopheaders' parameter.
>>
>> For some other component/parameter a '?' in the value might be valid.
>>
>> Regards,
>> Hiram
>>
>> On Sun, Nov 16, 2008 at 9:23 AM, Claus Ibsen <[hidden email]> wrote:
>>> Hi
>>>
>>> I was messing CAMEL-1096 for camel-mail and I mistyped the URI adding
>>> a 2nd ? char in the URI string.
>>> However this one passes the validation. I was wondering if that normal?
>>>
>>> eg:
>>> pop3://localhost?username=james&mail.pop3.forgettopheaders=true?ddd=sss
>>>
>>> Would validate into 2 parameters
>>> username=james
>>> mail.pop3.forgettopheaders=true?ddd=sss
>>>
>>> So the 2nd parameter value is: true?ddd=sss
>>>
>>> I was wondering if we should add some validation that a 2nd ? is not
>>> allowed in the URI string?
>>>
>>>
>>> /Claus Ibsen
>>> Apache Camel Committer
>>> Blog: http://davsclaus.blogspot.com/
>>>
>>
>>
>>
>> --
>> Regards,
>> Hiram
>>
>> Blog: http://hiramchirino.com
>>
>> Open Source SOA
>> http://open.iona.com
>>
>



--
Regards,
Hiram

Blog: http://hiramchirino.com

Open Source SOA
http://open.iona.com
Reply | Threaded
Open this post in threaded view
|

Re: DefaultComponent - Validating URI

jstrachan
We should definitely try and add as much validation as possible; we
could leave it up to the component to do loose or heavy validation I
guess; letting components validate as much as they can given their
parameters and their types

There are times when doing things like JMS selector or SQL query, that
using a URI is probably not really ideal - and folks should configure
the endpoint beans directly with properties such as in Spring Java/XML
or with Guice.


2008/11/20 Hiram Chirino <[hidden email]>:

> An example use case could be where you pass a SQL query as a parameter
> and part of the query has a ? in it.
>
> On Wed, Nov 19, 2008 at 1:23 PM, Claus Ibsen <[hidden email]> wrote:
>> Hi
>>
>> Yeah but the concrete example it wouldn't really be possible as it's
>> just a bunch of properties for the java mail API. It uses properties
>> and not setteres where we could use the IntrospectionHelper to set the
>> parameters. So a true?ddd=sss would not be able to be set as a boolean
>> and the parameter would be invalid and Camel will detect this.
>>
>> So I guess in this use-case we will leave it as is and that for some
>> other components a ? char might be valid. However I can't think of
>> such an example.
>>
>>
>> /Claus Ibsen
>> Apache Camel Committer
>> Blog: http://davsclaus.blogspot.com/
>>
>>
>>
>> On Wed, Nov 19, 2008 at 6:54 PM, Hiram Chirino <[hidden email]> wrote:
>>> I think the validation needs to go in at the component level.
>>> It should be able to detect that  'true?ddd=sss' is not valid value
>>> for  'mail.pop3.forgettopheaders' parameter.
>>>
>>> For some other component/parameter a '?' in the value might be valid.
>>>
>>> Regards,
>>> Hiram
>>>
>>> On Sun, Nov 16, 2008 at 9:23 AM, Claus Ibsen <[hidden email]> wrote:
>>>> Hi
>>>>
>>>> I was messing CAMEL-1096 for camel-mail and I mistyped the URI adding
>>>> a 2nd ? char in the URI string.
>>>> However this one passes the validation. I was wondering if that normal?
>>>>
>>>> eg:
>>>> pop3://localhost?username=james&mail.pop3.forgettopheaders=true?ddd=sss
>>>>
>>>> Would validate into 2 parameters
>>>> username=james
>>>> mail.pop3.forgettopheaders=true?ddd=sss
>>>>
>>>> So the 2nd parameter value is: true?ddd=sss
>>>>
>>>> I was wondering if we should add some validation that a 2nd ? is not
>>>> allowed in the URI string?
>>>>
>>>>
>>>> /Claus Ibsen
>>>> Apache Camel Committer
>>>> Blog: http://davsclaus.blogspot.com/
>>>>
>>>
>>>
>>>
>>> --
>>> Regards,
>>> Hiram
>>>
>>> Blog: http://hiramchirino.com
>>>
>>> Open Source SOA
>>> http://open.iona.com
>>>
>>
>
>
>
> --
> Regards,
> Hiram
>
> Blog: http://hiramchirino.com
>
> Open Source SOA
> http://open.iona.com
>



--
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://fusesource.com/
Reply | Threaded
Open this post in threaded view
|

Re: DefaultComponent - Validating URI

Claus Ibsen-2
In reply to this post by Hiram Chirino
Actually the camel-sql component uses # as placeholders that itself
afterwards replaces to ? chars

I just think that even though it's possible to have ? as parameter
value its very seldom used and not widely known it's possible.


/Claus Ibsen
Apache Camel Committer
Blog: http://davsclaus.blogspot.com/



On Thu, Nov 20, 2008 at 7:15 PM, Hiram Chirino <[hidden email]> wrote:

> An example use case could be where you pass a SQL query as a parameter
> and part of the query has a ? in it.
>
> On Wed, Nov 19, 2008 at 1:23 PM, Claus Ibsen <[hidden email]> wrote:
>> Hi
>>
>> Yeah but the concrete example it wouldn't really be possible as it's
>> just a bunch of properties for the java mail API. It uses properties
>> and not setteres where we could use the IntrospectionHelper to set the
>> parameters. So a true?ddd=sss would not be able to be set as a boolean
>> and the parameter would be invalid and Camel will detect this.
>>
>> So I guess in this use-case we will leave it as is and that for some
>> other components a ? char might be valid. However I can't think of
>> such an example.
>>
>>
>> /Claus Ibsen
>> Apache Camel Committer
>> Blog: http://davsclaus.blogspot.com/
>>
>>
>>
>> On Wed, Nov 19, 2008 at 6:54 PM, Hiram Chirino <[hidden email]> wrote:
>>> I think the validation needs to go in at the component level.
>>> It should be able to detect that  'true?ddd=sss' is not valid value
>>> for  'mail.pop3.forgettopheaders' parameter.
>>>
>>> For some other component/parameter a '?' in the value might be valid.
>>>
>>> Regards,
>>> Hiram
>>>
>>> On Sun, Nov 16, 2008 at 9:23 AM, Claus Ibsen <[hidden email]> wrote:
>>>> Hi
>>>>
>>>> I was messing CAMEL-1096 for camel-mail and I mistyped the URI adding
>>>> a 2nd ? char in the URI string.
>>>> However this one passes the validation. I was wondering if that normal?
>>>>
>>>> eg:
>>>> pop3://localhost?username=james&mail.pop3.forgettopheaders=true?ddd=sss
>>>>
>>>> Would validate into 2 parameters
>>>> username=james
>>>> mail.pop3.forgettopheaders=true?ddd=sss
>>>>
>>>> So the 2nd parameter value is: true?ddd=sss
>>>>
>>>> I was wondering if we should add some validation that a 2nd ? is not
>>>> allowed in the URI string?
>>>>
>>>>
>>>> /Claus Ibsen
>>>> Apache Camel Committer
>>>> Blog: http://davsclaus.blogspot.com/
>>>>
>>>
>>>
>>>
>>> --
>>> Regards,
>>> Hiram
>>>
>>> Blog: http://hiramchirino.com
>>>
>>> Open Source SOA
>>> http://open.iona.com
>>>
>>
>
>
>
> --
> Regards,
> Hiram
>
> Blog: http://hiramchirino.com
>
> Open Source SOA
> http://open.iona.com
>