Code Monkey home page Code Monkey logo

Comments (6)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024

Original comment by leah.culver on 14 Jan 2009 at 9:31

  • Added labels: Lib-Python

from oauth.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
Right now there's only one kind of OAuth exception for the Python and PHP 
libraries.
The spec mentions 400 and 401 errors separately in section 10. Should we 
distinguish
between the two?

http://oauth.net/core/1.0/#http_codes

Original comment by leah.culver on 14 Jan 2009 at 11:23

  • Changed title: Separate 400 and 401 exceptions?
  • Added labels: Lib-PHP, Type-Enhancement
  • Removed labels: Type-Defect

from oauth.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
I think it would be very useful differentiate the different types of problems a
service provider can report to the consumer.

As it is at the moment it is difficult to write a server that can correctly 
tell a
consumer that it is unauthorised (indicating that it needs to authenticate) vs. 
that
it sent an broken request (indicating that the code needs fixing).

On the spec side, it'd be nice if the standardised error reporting options were 
a bit
more expressive than choice between two HTTP status codes ...


Original comment by [email protected] on 16 Jan 2009 at 7:56

from oauth.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
Here's a proposed patch (following) my post to the list (pending moderation, 
maybe).

Original comment by [email protected] on 28 Mar 2011 at 8:45

Attachments:

from oauth.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
One of the reasons why I never got around to changing all the exceptions to 
include a 400/401 flag was that I never got around to deciding which way was 
better:
1) Having a error-code like you do (makes testing harder, as PHPUnit can only 
test on exception names, not content)
2) Having two different exception classes

I might think that option 2 is preferable and it shouldn't break BC if we just 
introduce two new exceptions that both inherit from the current.. 
Anyways, for future reference - it would be nice if any patch included updates 
to the test-case so they are kept up to date :)

Regards
Morten

Original comment by [email protected] on 29 Mar 2011 at 5:28

from oauth.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
Well... the solution I've used makes it quite easy by calling code to test 
wether there's an exception return code or not, and address this in a proper 
way...

So I don't know about what phpunit supports, but definitely, for the client 
code to have only different strings (5 or 6) to be checked by string comparison 
is definitely not handy.

Do you have an any such alternative implementation ?

And yes, unit tests would be nice... but I think my time is limited, and we 
could wait until such tests are necessary because of some regression I've 
introduced along with my patch ? ;)

Original comment by [email protected] on 6 Apr 2011 at 7:23

from oauth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.