I've been tinkering with pieces of ApiMain to attack the login through POST variables issue, and I think I have a patch for it. But, being new to shared development like this, I've never submitted anything before. How can I submit a patch? I'm sure just committing the new files is a bad idea, and I probably don't have permission to do that anyway. Is anyone willing to do a code test on their part to make sure it works? Of course I tested it on my end, but the more eyes, the better. Please let me know how I should submit. Thanks.
Eddie
Eddie Roger schreef:
But, being new to shared development like this, I've never submitted anything before. How can I submit a patch?
Just e-mail it and I'll test and commit it for you.
Roan Kattouw
Roan,
Thanks. Hope this works.
Eddie
On 11/2/07, Roan Kattouw roan.kattouw@home.nl wrote:
Eddie Roger schreef:
But, being new to shared development like this, I've never submitted anything before. How can I submit a patch?
Just e-mail it and I'll test and commit it for you.
Roan Kattouw
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Is setting session variables directly with the values provided by a client is safe? Shouldn't there be some check first? Just a thought, need to double check.
--Yuri
On 11/2/07, Eddie Roger eddieroger@gmail.com wrote:
Roan,
Thanks. Hope this works.
Eddie
On 11/2/07, Roan Kattouw roan.kattouw@home.nl wrote:
Eddie Roger schreef:
But, being new to shared development like this, I've never submitted anything before. How can I submit a patch?
Just e-mail it and I'll test and commit it for you.
Roan Kattouw
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-api
I'm not sure how "safe" it really is, and I'm interested in what you find. I will say I took I took a look at what goes on with a normal login, ultimately the session variables get set at cookie setting time, so I figured it was a good path to go here. I get that setting the variables unchecked has risk of interception on the way back from the API, but isn't that really the same risk as passing a password through POST? I hope this passes, though since I know that cookie handling is a peeve of mine in Ruby, and I think others would like to see this implemented, too. Thanks for looking at it.
Eddie
On Nov 2, 2007, at 6:48 PM, Yuri Astrakhan wrote:
Is setting session variables directly with the values provided by a client is safe? Shouldn't there be some check first? Just a thought, need to double check.
--Yuri
On 11/2/07, Eddie Roger eddieroger@gmail.com wrote:
Roan,
Thanks. Hope this works.
Eddie
On 11/2/07, Roan Kattouw roan.kattouw@home.nl wrote:
Eddie Roger schreef:
But, being new to shared development like this, I've never submitted anything before. How can I submit a patch?
Just e-mail it and I'll test and commit it for you.
Roan Kattouw
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Yuri Astrakhan schreef:
Is setting session variables directly with the values provided by a client is safe? Shouldn't there be some check first? Just a thought, need to double check.
User::newFromSession() should take care of that. I've tested the patch, gotten it to work and committed it [1]. In the same commit, I also removed ApiLogin's sessionID return value, as it didn't really work and was redundant anyway.
Roan Kattouw
[1] http://svn.wikimedia.org/viewvc/mediawiki?view=rev&revision=27151
Thanks for committing this! I'm really glad I could help, and excited to be able to use lg* vars instead of cookies. There's probably more patches where that came from - it's kind of a rush to see code actually submitted.
Eddie
On 11/3/07, Roan Kattouw roan.kattouw@home.nl wrote:
Yuri Astrakhan schreef:
Is setting session variables directly with the values provided by a client is safe? Shouldn't there be some check first? Just a thought, need to double check.
User::newFromSession() should take care of that. I've tested the patch, gotten it to work and committed it [1]. In the same commit, I also removed ApiLogin's sessionID return value, as it didn't really work and was redundant anyway.
Roan Kattouw
[1] http://svn.wikimedia.org/viewvc/mediawiki?view=rev&revision=27151
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Excelente, thx Roan :) Please make sure mw:API docs reflect the new behavior. --yuri
On 11/3/07, Roan Kattouw roan.kattouw@home.nl wrote:
Yuri Astrakhan schreef:
Is setting session variables directly with the values provided by a client is safe? Shouldn't there be some check first? Just a thought, need to double check.
User::newFromSession() should take care of that. I've tested the patch, gotten it to work and committed it [1]. In the same commit, I also removed ApiLogin's sessionID return value, as it didn't really work and was redundant anyway.
Roan Kattouw
[1] http://svn.wikimedia.org/viewvc/mediawiki?view=rev&revision=27151
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Yuri Astrakhan schreef:
Excelente, thx Roan :) Please make sure mw:API docs reflect the new behavior.
Thanks for reminding me, I'd forgotten.
Roan Kattouw
Roan Kattouw schreef:
Yuri Astrakhan schreef:
Excelente, thx Roan :) Please make sure mw:API docs reflect the new behavior.
Thanks for reminding me, I'd forgotten.
I checked the docs, and it turns out the new behavior is *already* described there, which is pretty weird:
In every call to api.php, the three values must either be passed as additional parameters, or as cookies within the request header. If any of the login values are given as part of the request, all cookie values are ignored. Please note that user name is passed in as '''lgname''', but returned as normalized '''lgusername'''. The first is used for authentication, whereas the second may be passed together with '''lgtoken''' and '''lguserid''' as tokens when making calls to other modules.
(from http://www.mediawiki.org/wiki/API:Login )
Roan Kattouw
That's the documentation I saw and based the patch on, and I think there was a fair amount of general confusion about why it would be documented and not work. So now it does.
On Nov 3, 2007, at 1:29 PM, Roan Kattouw wrote:
Roan Kattouw schreef:
Yuri Astrakhan schreef:
Excelente, thx Roan :) Please make sure mw:API docs reflect the new behavior.
Thanks for reminding me, I'd forgotten.
I checked the docs, and it turns out the new behavior is *already* described there, which is pretty weird:
In every call to api.php, the three values must either be passed as additional parameters, or as cookies within the request header. If any of the login values are given as part of the request, all cookie values are ignored. Please note that user name is passed in as '''lgname''', but returned as normalized '''lgusername'''. The first is used for authentication, whereas the second may be passed together with '''lgtoken''' and '''lguserid''' as tokens when making calls to other modules.
(from http://www.mediawiki.org/wiki/API:Login )
Roan Kattouw
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Oops :))) Now I remember writing something about it. No wonder the feature looked familiar :)
Still, we should always attempt to keep the docs in sync, especially when creating new features. We would get plenty of feedback and ideas to help make it better. The reason it is so hard to add API editing functionality is because so many other components (hooks) depend on internal code to behave a certain way, and changing that is very difficult. Creating new API functionality is very easy, but changing anything has already proven very difficult as so many client programs depend on it (e.g. categories parameter, using titles instead of eititles, etc.)
Thx!
On 11/3/07, Roan Kattouw roan.kattouw@home.nl wrote:
Roan Kattouw schreef:
Yuri Astrakhan schreef:
Excelente, thx Roan :) Please make sure mw:API docs reflect the new behavior.
Thanks for reminding me, I'd forgotten.
I checked the docs, and it turns out the new behavior is *already* described there, which is pretty weird:
In every call to api.php, the three values must either be passed as additional parameters, or as cookies within the request header. If any of the login values are given as part of the request, all cookie values are ignored. Please note that user name is passed in as '''lgname''', but returned as normalized '''lgusername'''. The first is used for authentication, whereas the second may be passed together with '''lgtoken''' and '''lguserid''' as tokens when making calls to other modules.
(from http://www.mediawiki.org/wiki/API:Login )
Roan Kattouw
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Eddie,
please attach the patch to the bug in MW bugzilla (http://bugzilla.wikimedia.org/), and someone will apply and test it.
Thanks! --Yuri
On 11/2/07, Eddie Roger eddieroger@gmail.com wrote:
I've been tinkering with pieces of ApiMain to attack the login through POST variables issue, and I think I have a patch for it. But, being new to shared development like this, I've never submitted anything before. How can I submit a patch? I'm sure just committing the new files is a bad idea, and I probably don't have permission to do that anyway. Is anyone willing to do a code test on their part to make sure it works? Of course I tested it on my end, but the more eyes, the better. Please let me know how I should submit. Thanks.
Eddie
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-api
mediawiki-api@lists.wikimedia.org