Code Monkey home page Code Monkey logo

Comments (4)

sam2332 avatar sam2332 commented on June 8, 2024

how are you going to send headers for requesting said user and pass?
remember the realm needs to be changeable

from bulletphp.

vlucas avatar vlucas commented on June 8, 2024

The auth challenge might be left up to the user - this would just be to retrieve the supplied username and password from a provided Authorization header in the current request.

from bulletphp.

netom avatar netom commented on June 8, 2024

I imagine this as a part of a solution that would make it possible to declare conditions on a request, and then either fire up an engine that checks all conditions, or just executing the checks as they occur.

This could be useful for validating forms, file uploads, doing basic and digest auth, oauth token checks, etc.

One way is to write methods of Request that manipulate a description of things to check and then manually call a method ->check() that actually executes stuff. This is fairly simple, and with clever implementation it's easy to decouple the code for checks from the places where they're actually needed. This together with Bullets URL parsing mechanism would leave the code fairly clean and self-explanatory while imposing no overhead whatsoever on those not using the feature.

from bulletphp.

vlucas avatar vlucas commented on June 8, 2024

Yeah, I was initially thinking about implementing this as a call-time parsing, so if the $request->user() or $request->password() methods were called, THEN it would check for the Authorization header and do all the parsing - I would not front-load any of this since it's all just in the basic request data anyways.

from bulletphp.

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.