-
Notifications
You must be signed in to change notification settings - Fork 887
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pyramid 2.0 possible feature list #2362
Comments
I'd like to see the CSRF token stuff separated from the session, and become it's own stand-alone thing. |
Sure! I think it'd be helpful to open a different issue and link to it from your idea where we can talk about that particular API if you'd like. |
Re-work |
I'd like to be be able to access the currently expected "renderer" (and various other |
@jvanasco These features are not a breaking change thus not on the roadmap for pyramid 2.0. In fact everything you requested will be available in 1.7 with the new view derivers feature. |
well that's pretty wonderful! |
I am currently testing how the auth-api postmortem works. However so far I've concluded that |
Have the ISession stop requiring an explicit call to 'changed()' for mutable objects by automatically detecting changes. [http://docs.pylonsproject.org/projects/pyramid/en/latest/api/interfaces.html#pyramid.interfaces.ISession.changed] I did not realize Pyramid required this (or perhaps I forgot) and had some session manipulations that did not persist. This was awkward, as most other session systems do not require this. I handled this in our fork of a session library by hashing the serialized version of a session on creation, and comparing that to a second fingerprint on cleanup [if the session did not otherwise have a reason to persist]. This sort of change would likely not break any apps, but it could likely break session libraries. |
What? This is up to the session whether this is required. Under normal scenarios it is only required if you perform a deep change on a mutable collection stored in the session, for obvious reasons. The bundled session impl from pyramid does not require you to ever call request.session['foo']['bar']['baz'] = 1
request.session.changed()
# versus
obj = copy.deepcopy(request.session['foo'])
obj['foo']['bar']['baz'] = 1
request.session['foo'] = obj |
@jvanasco please open a specific issue instead of trying to talk about these things in the 2.0 feature list. It's really supposed to just be an aggregate of these various issues with their own discussion elsewhere. |
I would love to see an asyncio support/integration out of the box if pyramid would be 3.5+ only - that would be a killer feature in my opinion. |
What does asyncio support/integration mean within the Pyramid framework? What integration are you looking for Pyramid to provide? |
I was thinking about core integration or package maintenance of something that would make sense that build on top of these projects where it makes sense: https://pypi.python.org/pypi/aiopyramid So far my personal experience includes using pyramid + gevent (which doesn't require anything special on pyramids end), but asyncio seems to be the next logical step here. |
Another feature, incorporate @wichert s https://github.com/wichert/pyramid_authstack - its 40 something lines of code but i strongly believe this should be part of standard API. |
Allow to configure pserve (and others commands) via some hooks to make |
One point of confusion I've had is the permission argument on view_config and the fact that it only accepts one permission. Suppose I have editor and moderator groups right now I think the solve for not adding more than one permission is to make a new group called editormoderator and use that instead. It seemed really counter intuitive to me to do so. Perhaps there is a good reason for this that I'm unaware of, but I wanted to bring it up for 2.0 if there is a chance to revisit this. |
@nek4life The permission should be "edit", and then on your context you have an acl that grants both the For example:
Then your
And now anyone that has in their list of principals one of the following:
Will have the |
Late to the party here...The above link to the auth-api post-mortem has gone dead. (Which is a shame, since I've seen the same doc linked in a few SO responses.) Is this document available anyplace else? |
I've said it elsewhere, the auth postmortem would make things much better, but the authz policy should really get a reference to the request too - now people write their own wrapper classes to contain the actual context classes just to pass the request implicitly into the authorization policy. |
Hi all, Kotti solved this nicely: tl;dr: Consider a request in this structure: /users/me If I'm at 'me', request.context will be me. Passing along context to effective_principals might do the trick too? |
@robinharms Please open a separate issue if you wish to discuss this. The intricacies of a particular issue don't belong in this roadmap thread. I will mention that the principals do not come from the context at all - only the request - and so something smells a little bit about your analysis so far. |
@mmerickel OK I'll do that. Regarding principals, that's exactly the problem :) |
Two items for documentation consideration:
|
I'd be willing to make a call on what to do about #2607 (make append_slash_notfound_view use a subrequest) and to do the work that falls out for 2.0. |
A couple more to the list above:
|
I was thinking that first class out-of-the-box mixing sync and async requests from separate thread would be a killer feature for pyramid 2.x. |
async view functions certainly would be really useful.
|
Gonna link to this discussion: #3391 on why async support in Pyramid is a lot more fraught with issues than anyone is willing to admit at the moment. |
How about dropping the "path", alternate name for "pattern", argument from Configurator.add_route()? Let me know if you want an issue opened. So long as I'm commenting, here is a list of what I can find that's depreciated, or could be. All the .ini file keys which have 2 names. The names that don't begin with
|
Things are pretty close to finalized for Pyramid 2.0 - I'll point people at the changelog/whatsnew documents for what made the cut. There's actually no major backward incompatibilities. We'll be doing a 1.10.5 release that adds at least one or two deprecations to help people upgrade in important spots. |
I'm starting here a little 2.0 wishlist. I have no idea if an issue will be a good medium for the discussion but here goes. None of these are guaranteed to make the cut. There is no timeline for this yet. Personally I'm interested in MINOR incompatibilities that are large enough that we have refused to do until now (i.e. nothing that will require a fundamental redesign of a Pyramid app for a user).
Please keep the discussion away from here and in separate issues. Let's focus on simply compiling a list of possibilities.
likely
ISession
contract from pickleable objects to something more secure and portable like json. 2.0 feature request: Require that sessions are JSON serializable #2709check_csrf
view predicate in favor ofrequire_csrf
(already deprecated).custom_predicates
fromconfig.add_view
andview_config
(already deprecated).Removeconfig.set_request_property
(already deprecated).pcreate
and default scaffolds. deprecate pcreate and update scaffolds to cookiecutter #2384interesting, let's open an issue and talk about it
Separate CSRF tokens from theISession
into something else implementable without a session. Improve CSRF Support for Safety, REST, and Decoupling #1573config.include
without the base url inside having a/
suffix. route_prefix doesn't allow the prefix pattern to match without a trailing slash #406, Added support for a prefixed base url that does not contain a trailing slash #1639Drop PasteDeploy in favor of a better loading system. improve config file support #2419info
object instead ofconfig
. Currently the only purpose of this argument is forconfig.maybe_dotted
but it's poor practice to pass the ephemeralconfig
object around. define a new IPredicateInfo to mirror IDeriverInfo #2535use_tweens
argument torequest.invoke_subrequest
in order to make the nested request pipeline more sane. add first class transaction manager support #2606interesting but unlikely without a champion to start the discussion
remember
/forget
APIs in favor of a pattern that fits better with non-cookie workflows.pyramid.view_config
,pyramid.Configurator
, etc. This would greatly assist in maintainability of the public API for people using IDEs like pycharm where they may not be checking the docs to ensure an API is public. Probably use a lazy-instantiator like apipkg for this. add a top-level public api #2387view_config
to namespace arguments to be more clear about options versus predicates.config.add_view
,config.add_forbidden_view
,config.add_notfound_view
to accept only kwargs. Almost all of the parameters are indistinguishable from user-defined view options, so they could be treated all the same.NotFound
andForbidden
exceptions fromHTTPNotFound
andHTTPForbidden
. This would undo previous work to merge them in order to make exception views more understandable.other proposals
add_view
by default toGET
andPOST
. Pyramid 2.0 could restrict the request methods by default inadd_view
,view_config
. #2796The text was updated successfully, but these errors were encountered: