Giter Site home page Giter Site logo

Comments (8)

hadrien avatar hadrien commented on September 26, 2024

Actually, pyramid_contextauth is context class based but we can easily implement inheritance based auth, can't we?

from pyramid_contextauth.

merwok avatar merwok commented on September 26, 2024

Yes, I think so :)

We may need to do something smarter than just isinstance, as we’ll want interfaces and subclasses to work, but the design of contextauth does not conflict with traversal.

from pyramid_contextauth.

merwok avatar merwok commented on September 26, 2024

Ah I remember now what problem I saw. In our apps that use dispatch, we define custom context factories in order to 1) delegate actual auth to them 2) access some stuff on the context instance, like facebook_data or order_info.

In a traversal-based app, we have resources as contexts, so we won’t be able to use context factories to parse the auth bits in the request.

I still think that having custom security contexts (distinct from resource contexts) is a good thing, we just need to find a way to attach them to the resource or request.

from pyramid_contextauth.

hadrien avatar hadrien commented on September 26, 2024

Why won't we able to use context factories to parse the auth bits in the request?

from pyramid_contextauth.

merwok avatar merwok commented on September 26, 2024

Passing factory=SomeSecurityContext with route dispatch changes the root resource used for that view. With traversal, we’re not using routes and we’re not overriding the root resource for some views, because our contexts are resources.

from pyramid_contextauth.

hadrien avatar hadrien commented on September 26, 2024

I still do not get it: We can register an authentication policy for a resource/context and run authentication for any request on the resource, right?

from pyramid_contextauth.

merwok avatar merwok commented on September 26, 2024

You’re right :)

from pyramid_contextauth.

merwok avatar merwok commented on September 26, 2024

My mistake was thinking that authz was done before traversal.

from pyramid_contextauth.

Related Issues (1)

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.