thephpleague / oauth2-server

A spec compliant, secure by default PHP OAuth 2.0 Server
https://oauth2.thephpleague.com
MIT License
6.53k stars 1.12k forks source link

Integration with StackPHP #200

Closed alexbilbie closed 8 years ago

alexbilbie commented 10 years ago

Integration with StackPHP

zerkms commented 9 years ago

Why to tie with frameworks when it's an independent library?

hannesvdvreken commented 9 years ago

StackPHP is not a framework. It's a framework interoperability tool.

zerkms commented 9 years ago

@hannesvdvreken why to tie with anything?

I've taken it and without any problems used in symfony. If one needs integration with something - why not make it a separate project, that refers to this library as a dependency?

hannesvdvreken commented 9 years ago

Yeah, but people like libraries with utility classes that they can just use to tie it in their application in no time.

zerkms commented 9 years ago

So why put everything into one repository/project?

Doesn't splitting it into different projects each one with its own particular responsibility make it better design?

hannesvdvreken commented 9 years ago

It's better to add a stackphp middleware than to add framework specific classes for every single framework.

zerkms commented 9 years ago

@hannesvdvreken the question was: why to add it to the library? Why not create a separate project that provides integration?

Composition, you know.

hannesvdvreken commented 9 years ago

StackPHP will only be a dev dependency.

zerkms commented 9 years ago

@hannesvdvreken the question is still: why a library need to know about environment it will be used in? Why not just leave a library to be a pure library.

And any integration, even as simple or as trivial as another dependency (but still biased and opinionated) to be another project?

hannesvdvreken commented 9 years ago

I would agree with you if it would be symfony or zend specific classes, but StackPHP is meant to be used in any application. So it's optional but also an invitation to use good app design.

This will be my last response, sorry, as I don't have more time to discuss. Have a nice day.

zerkms commented 9 years ago

It violates SRP.

But hey, it's your project, design it as you wish.

hannesvdvreken commented 9 years ago

I just noticed this is a 7 month old issue. Don't worry about it, it probably will not be executed any time soon ;-)

alexbilbie commented 9 years ago

I've just woken up in my timezone so to answer your questions, the middleware will be a single class with no additional dependencies required because anyone implementing it will already have pulled them in themselves. On Fri, 20 Mar 2015 at 07:04 Hannes Van De Vreken notifications@github.com wrote:

I would agree with you if it would be symfony or zend specific classes, but StackPHP is meant to be used in any application. So it's optional but also an invitation to use good app design.

This will be my last response, sorry, as I don't have more time to discuss. Have a nice day.

— Reply to this email directly or view it on GitHub https://github.com/thephpleague/oauth2-server/issues/200#issuecomment-83941052 .

hannesvdvreken commented 9 years ago

As I said: just a dev dependency.

zerkms commented 9 years ago

just a dev dependency.

Dev dependencies are not installed by default (or at all) when a library is a dependency itself. I cannot see how it can be a pure dev dependency :-)

alexbilbie commented 9 years ago

What's the dev dependency you're referring to? As I said implementing the middleware won't result in any new dependencies being added to the project On Fri, 20 Mar 2015 at 07:08 Ivan Kurnosov notifications@github.com wrote:

just a dev dependency.

Dev dependencies are not installed by default when a library is a dependency itself. I cannot see how it can be a pure dev dependency :-)

— Reply to this email directly or view it on GitHub https://github.com/thephpleague/oauth2-server/issues/200#issuecomment-83941347 .

zerkms commented 9 years ago

@alexbilbie middleware is integration. Why not have it separately?

OAuth library provides the protocol implementation, why spoil it with information about the environment it will be hosted in?

Especially keeping in mind that StackPHP is not an industry standard and not everyone follows them.

zerkms commented 9 years ago

@hannesvdvreken it will not be a dev dependency. It will be a middleware (in terms of StackPHP) implementation.

So a class that has nothing to do with the library (and OAuth2 protocol) directly, just a glue layer with a specific "architecture"

zerkms commented 9 years ago

@alexbilbie simple example: https://github.com/thecodingmachine/silex-middleware

So they implemented a middleware for silex outside of silex, not as a part of it.

alexbilbie commented 9 years ago

I agree. It'll be a separate package. But as that separate package doesn't exist yet I'm just tracking it in here.

zerkms commented 9 years ago

White begins and wins!

Sorry for being nasty and/or annoying, I wish the project the best design :-)

alexbilbie commented 8 years ago

Closing for now; v5 will include PSR7 middleware