Skip to content

Move acl security to authorization#3563

Merged
mmerickel merged 9 commits intoPylons:masterfrom
mmerickel:move-acl-security-to-authorization
Jan 17, 2020
Merged

Move acl security to authorization#3563
mmerickel merged 9 commits intoPylons:masterfrom
mmerickel:move-acl-security-to-authorization

Conversation

@mmerickel
Copy link
Copy Markdown
Member

@mmerickel mmerickel commented Jan 13, 2020

This deprecates the ACL-specific parts of pyramid.security and moves them into pyramid.authorization since ACL features are not specifically top-level in the security API any longer.

Here are the options:

  1. merge this, and isolate anything ACL-related in pyramid.authorization.
  2. come up with a way to un-deprecate effective_principals features so that it can be used by the framework as makes sense.

My feeling is that it's good to isolate this stuff into one spot, and if there is pushback by the community after release because request.effective_principals and the predicate are deprecated, then we can re-evaluate them by potentially adding an optional method to the security policy or something.

cc @luhn

Copy link
Copy Markdown
Member

@stevepiercy stevepiercy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM so far.

Needs a change log entry for how to upgrade to 2.0, pending choice of option 1 or 2 for how to proceed.

Also suggest adding versionchanged or deprecated reST directives where helpful.

@luhn
Copy link
Copy Markdown
Contributor

luhn commented Jan 13, 2020

👍

I agree it's the right way to organize things, even if its temporarily a bit more messy until we can remove the deprecated items.

Re effective_principals, I think if users still want to access it in a new security policy we should recommend they put it in authenticated_identity. It is part of the user's identity, imo. Also I'm loathe to add an extra method to the security policy that's only applicable for specific use cases. But I guess we'll see what the response is.

@mmerickel
Copy link
Copy Markdown
Member Author

mmerickel commented Jan 13, 2020

Ok I will fix the changelog and docs. There are more changes once #3557 is merged as well - I didn't fix the tutorials in this branch because I knew it would cause conflicts - so I will leave this open until then.

@mmerickel mmerickel added this to the 2.0 milestone Jan 13, 2020
Copy link
Copy Markdown
Member

@stevepiercy stevepiercy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For all single-quoted strings in docs/api/security.rst and docs/api/authorization.rst, should they be double-backticked instead as inline literals?

Copy link
Copy Markdown
Contributor

@merwok merwok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor markup tweaks to have names rendered as code and strings rendered as strings

Co-Authored-By: Éric Araujo <merwok@netwok.org>
Copy link
Copy Markdown
Member

@stevepiercy stevepiercy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mix of double-backticking thing and 'other' regarding ' is inconsistent. Suggest removing the single quotes.

Copy link
Copy Markdown
Contributor

@merwok merwok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apply markup fixes to overlooked mentions

@merwok
Copy link
Copy Markdown
Contributor

merwok commented Jan 15, 2020

The mix of double-backticking thing and 'other' regarding ' is inconsistent

If you mean that the doc for pyramid.security docs says

the value is the string ``'system.Everyone'``

but the one for pyramid.authorization has

the value is the string 'system.Everyone'

I have sent change suggestions to make them consistent.

If you mean the difference between

the name ``Everyone``

and

the value is the string ``'system.Everyone'``

then I don’t see the inconsistency: the name is not a string.

@mmerickel
Copy link
Copy Markdown
Member Author

I re-synced some of the docs after merging #3557. This should be good to go.

@mmerickel mmerickel merged commit a71df99 into Pylons:master Jan 17, 2020
@mmerickel mmerickel deleted the move-acl-security-to-authorization branch November 29, 2020 03:09
miketheman added a commit to miketheman/warehouse that referenced this pull request Nov 26, 2021
The import paths for these modules has changed in Pyramid 2.0, and
raises warnings.
There are other Pyramid 2.0 warnings, but are more involved than
changing an import path, and should be addressed as another commit.

Refs: Pylons/pyramid#3563

Signed-off-by: Mike Fiedler <miketheman@gmail.com>
di added a commit to pypi/warehouse that referenced this pull request Dec 1, 2021
* Fix PytestCollectionWarning

When collecting tests, this class raises a warning since it's named
`Test*`:

    PytestCollectionWarning: cannot collect test class 'TestAdminFlagValues'
    because it has a __new__ constructor

Set an attribute that informs pytest to ignore this class, and thus
remove the warning.

Refs: https://docs.pytest.org/en/6.2.x/example/pythoncollection.html#customizing-test-collection
(last lines)

Signed-off-by: Mike Fiedler <miketheman@gmail.com>

* Fix PytestDeprecationWarning

Current test warns:

    PytestDeprecationWarning: The --strict option is deprecated, use --strict-markers instead.

Marked as deprecated in pytest-dev/pytest#7985
Released in pytest 6.2.0

Signed-off-by: Mike Fiedler <miketheman@gmail.com>

* Fix DeprecationWarning pyramid import

The import paths for these modules has changed in Pyramid 2.0, and
raises warnings.
There are other Pyramid 2.0 warnings, but are more involved than
changing an import path, and should be addressed as another commit.

Refs: Pylons/pyramid#3563

Signed-off-by: Mike Fiedler <miketheman@gmail.com>

* Fix DeprecationWarning for jinja.contextfilter

A few instances of this warning are raised:

    DeprecationWarning: 'contextfilter' is renamed to 'pass_context',
    the old name will be removed in Jinja 3.1.

Replace the usages accordingly.

Refs: pallets/jinja#1389

Signed-off-by: Mike Fiedler <miketheman@gmail.com>

* Fix DeprecationWarning for jinja.Markup

The pass-through import of markup.Markup() has been deprecated in Jinja
3.0, and will be removed in Jinja 3.1. Warnings raised:

    DeprecationWarning: 'jinja2.Markup' is deprecated and will be removed in Jinja 3.1.
    Import 'markupsafe.Markup' instead.

Replace the import paths.

TODO: Determine if the requirements/main.in needs to be changed as well.

Refs: pallets/jinja#1391

Signed-off-by: Mike Fiedler <miketheman@gmail.com>

* Fix DeprecationWarning for babel.numbers.from_number

Warnings raised:

    DeprecationWarning: Use babel.numbers.format_decimal() instead.

Deprecated since 2.6.0

Refs: python-babel/babel#538

Signed-off-by: Mike Fiedler <miketheman@gmail.com>

Co-authored-by: Dustin Ingram <di@users.noreply.github.com>
domdfcoding pushed a commit to domdfcoding/warehouse that referenced this pull request Jun 7, 2022
* Fix PytestCollectionWarning

When collecting tests, this class raises a warning since it's named
`Test*`:

    PytestCollectionWarning: cannot collect test class 'TestAdminFlagValues'
    because it has a __new__ constructor

Set an attribute that informs pytest to ignore this class, and thus
remove the warning.

Refs: https://docs.pytest.org/en/6.2.x/example/pythoncollection.html#customizing-test-collection
(last lines)

Signed-off-by: Mike Fiedler <miketheman@gmail.com>

* Fix PytestDeprecationWarning

Current test warns:

    PytestDeprecationWarning: The --strict option is deprecated, use --strict-markers instead.

Marked as deprecated in pytest-dev/pytest#7985
Released in pytest 6.2.0

Signed-off-by: Mike Fiedler <miketheman@gmail.com>

* Fix DeprecationWarning pyramid import

The import paths for these modules has changed in Pyramid 2.0, and
raises warnings.
There are other Pyramid 2.0 warnings, but are more involved than
changing an import path, and should be addressed as another commit.

Refs: Pylons/pyramid#3563

Signed-off-by: Mike Fiedler <miketheman@gmail.com>

* Fix DeprecationWarning for jinja.contextfilter

A few instances of this warning are raised:

    DeprecationWarning: 'contextfilter' is renamed to 'pass_context',
    the old name will be removed in Jinja 3.1.

Replace the usages accordingly.

Refs: pallets/jinja#1389

Signed-off-by: Mike Fiedler <miketheman@gmail.com>

* Fix DeprecationWarning for jinja.Markup

The pass-through import of markup.Markup() has been deprecated in Jinja
3.0, and will be removed in Jinja 3.1. Warnings raised:

    DeprecationWarning: 'jinja2.Markup' is deprecated and will be removed in Jinja 3.1.
    Import 'markupsafe.Markup' instead.

Replace the import paths.

TODO: Determine if the requirements/main.in needs to be changed as well.

Refs: pallets/jinja#1391

Signed-off-by: Mike Fiedler <miketheman@gmail.com>

* Fix DeprecationWarning for babel.numbers.from_number

Warnings raised:

    DeprecationWarning: Use babel.numbers.format_decimal() instead.

Deprecated since 2.6.0

Refs: python-babel/babel#538

Signed-off-by: Mike Fiedler <miketheman@gmail.com>

Co-authored-by: Dustin Ingram <di@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants