issue 47 - need some guidance

Showing 1-7 of 7 messages
issue 47 - need some guidance Stjepan 6/7/10 11:16 AM
Hello,

I've posted some comments regarding issue 47 (http://code.google.com/p/oauth-signpost/issues/detail?id=47), and need a little guidance to move forward with a fix.

Based on the code in HttpParameters.getAsQueryString:

public String getAsQueryString(Object key) {
        StringBuilder sb = new StringBuilder();
        key = OAuth.percentEncode((String) key);    // the provided key is first encoded
        Set<String> values = wrappedMap.get(key);  // and then used to grab the value

... I assume that all parameter keys should always be encoded before being placed into the wrappedMap.  Based on that assumption, for a client like SignatureBaseString.normalizeRequestParameters which pulls keys directly from the wrappedMap, we need a version of getAsQueryString which will not percentEncode (again) the provided key.  E.g.:

public String getAsQueryString(Object key, boolean percentEncode) {
        StringBuilder sb = new StringBuilder();
        if (percentEncode)
            key = OAuth.percentEncode((String) key);    // the provided key is first encoded if needed
        Set<String> values = wrappedMap.get(key);  // and then used to grab the value

and:
public String getAsQueryString(Object key) {
    return getAsQueryString(key, true);
}
If I'm understanding this correctly, I would also propose that the simple version of HttpParameters.put be changed to ensure that the parameter is percentEncoded by default (if the user knows it is unnecessary, she can explicitly call with percentEncode set to false):

    public String put(String key, String value) {
        return put(key, value, false);
    }

Thoughts?  If I attempt a fix, how exactly do you want me to commit it, and how do we get to a point release with the fix?

Best,

Stjepan

Re: issue 47 - need some guidance Stjepan 6/11/10 5:13 PM
On Mon, Jun 7, 2010 at 11:16 AM, Stjepan Rajko <stjepa...@gmail.com> wrote:
Hello,

I've posted some comments regarding issue 47 (http://code.google.com/p/oauth-signpost/issues/detail?id=47), and need a little guidance to move forward with a fix.

[snip]

Thoughts?  If I attempt a fix, how exactly do you want me to commit it, and how do we get to a point release with the fix?


Matthias, when do you think you might be able to look at this?  I am trying to decide between contributing a fix to the main repository and getting a point release from there (in which case I need access to your repo, and your guidance on how you'd like me to do this), or just doing a fix in my fork of 1.2.1.1 and using that instead.

Best,

Stjepan

Re: issue 47 - need some guidance Matthias 6/13/10 11:42 PM
go ahead and fork, I don't have time to work on this library for
perhaps the next few months. I'll come back to it at some point, but
currently I'm looking for people willing to take over the work for a
while.

2010/6/12 Stjepan Rajko <stjepa...@gmail.com>:

--
PLEASE NOTE OUR NEW ADDRESS!
-------------------------------------------------------

Matthias Käppler
Software Developer

Qype GmbH
Großer Burstah 50-52
20457 Hamburg
Telephone: +49 (0)40 - 219 019 2 - 260
Skype: m_kaeppler
Email: matt...@qype.com

Managing Director: Ian Brotherston
Amtsgericht Hamburg
HRB 95913

This e-mail and its attachments may contain confidential and/or
privileged information. If you are not the intended recipient (or have
received this e-mail in error) please notify the sender immediately
and destroy this e-mail and its attachments. Any unauthorized copying,
disclosure or distribution of this e-mail and  its attachments is
strictly forbidden. This notice also applies to future messages.

Re: issue 47 - need some guidance Stjepan 6/14/10 10:22 AM
2010/6/13 Matthias Käppler <m.kae...@googlemail.com>

go ahead and fork, I don't have time to work on this library for
perhaps the next few months. I'll come back to it at some point, but
currently I'm looking for people willing to take over the work for a
while.


Well, I'm trying to help with taking over work, but that will take at least some help from you (adding me to the repo and giving some guidelines on how you organize the releases in the repo so I know how to create a new point release).

Perhaps people behind project Amber (http://incubator.apache.org/projects/amber.html) would be interested in using your library as a starting point.

For now, I'll just do as you suggest and create a release from my fork.

Best,

Stjepan

Re: issue 47 - need some guidance Matthias 6/14/10 12:35 PM
sure I'll gladly add you, what's your github name? I already added you
to the Google code project, but the sources are on github.

as to the overall development stuff: my current approach is to do the
dev work in a branch that is named after the new release version,
since that's basically how the maven-release-plugin works. are you
familiar with that? it's a little annoying to use, but then again, it
takes a lot of work off your hands (such as signing JARs and stuff,
Sonatype demands that before publishing to their repos).

other than that, feel free to follow your usual workflows (that's the
beauty about Git, right!). If you add new features or change something
obscure which may not yet be covered by a test, please add tests for
it. As to documentation, I tried to write JavaDocs for the more
important stuff but admit I haven't been entirely disciplined about
that.

I haven't yet figured out how to create a really solid test suite,
since many things can only properly tested by running the lib against
an actual service provider (or better: all). What I at least do is run
the example apps using a freshly rolled JAR and check that everything
still works as expected (token exchange and normal request signing).
In the long term it would probably be good to have proper integrations
tests.

please let me know if you have further questions.

cheers,
Matthias

2010/6/14 Stjepan Rajko <stjepa...@gmail.com>:

--

PLEASE NOTE OUR NEW ADDRESS!
-------------------------------------------------------

Matthias Käppler
Software Developer

Qype GmbH
Großer Burstah 50-52
20457 Hamburg
Telephone: +49 (0)40 - 219 019 2 - 260
Skype: m_kaeppler
Email: matt...@qype.com

Managing Director: Ian Brotherston
Amtsgericht Hamburg
HRB 95913

This e-mail and its attachments may contain confidential and/or
privileged information. If you are not the intended recipient (or have
received this e-mail in error) please notify the sender immediately
and destroy this e-mail and its attachments. Any unauthorized copying,
disclosure or distribution of this e-mail and  its attachments is
strictly forbidden. This notice also applies to future messages.

Re: issue 47 - need some guidance Stjepan 6/14/10 12:37 PM
2010/6/14 Matthias Käppler <m.kae...@googlemail.com>

sure I'll gladly add you, what's your github name?

srajko

Thanks for the other info - I will study it to make sure I understand how to do things the right way before I mess with your repo.

Best,

Stjepan

Re: issue 47 - need some guidance Matthias 6/14/10 12:42 PM
done, thanks again for your help!

2010/6/14 Stjepan Rajko <stjepa...@gmail.com>:

--

PLEASE NOTE OUR NEW ADDRESS!
-------------------------------------------------------

Matthias Käppler
Software Developer

Qype GmbH
Großer Burstah 50-52
20457 Hamburg
Telephone: +49 (0)40 - 219 019 2 - 260
Skype: m_kaeppler
Email: matt...@qype.com

Managing Director: Ian Brotherston
Amtsgericht Hamburg
HRB 95913

This e-mail and its attachments may contain confidential and/or
privileged information. If you are not the intended recipient (or have
received this e-mail in error) please notify the sender immediately
and destroy this e-mail and its attachments. Any unauthorized copying,
disclosure or distribution of this e-mail and  its attachments is
strictly forbidden. This notice also applies to future messages.