[ckan-changes] [okfn/ckan] c60cbb: [#1210] Add auth_user_obj to context in check_acce...

GitHub noreply at github.com
Wed Sep 11 11:11:44 UTC 2013


  Branch: refs/heads/master
  Home:   https://github.com/okfn/ckan
  Commit: c60cbbe3fe0e2516edf57344fa7ac81d897cd080
      https://github.com/okfn/ckan/commit/c60cbbe3fe0e2516edf57344fa7ac81d897cd080
  Author: amercader <amercadero at gmail.com>
  Date:   2013-08-23 (Fri, 23 Aug 2013)

  Changed paths:
    M ckan/logic/__init__.py
    M ckan/tests/logic/test_init.py

  Log Message:
  -----------
  [#1210] Add auth_user_obj to context in check_access

If not already there or ignore_auth is True, and the context has a user
name, try to see if the user actually exists in the DB, and store the
object (or None if not found) in context['auth_user_obj']. The check if
performed only once per context object.


  Commit: 89767240d397e30597451a3f0fb267b0671d5d7b
      https://github.com/okfn/ckan/commit/89767240d397e30597451a3f0fb267b0671d5d7b
  Author: amercader <amercadero at gmail.com>
  Date:   2013-08-27 (Tue, 27 Aug 2013)

  Changed paths:
    M ckan/logic/__init__.py

  Log Message:
  -----------
  [#1210] Fix side_effect_free check

It should be in place if it is an action function from get.py and it
hasn't already been set.


  Commit: 923118ce89216bee2fb274d81f376deec97a638c
      https://github.com/okfn/ckan/commit/923118ce89216bee2fb274d81f376deec97a638c
  Author: amercader <amercadero at gmail.com>
  Date:   2013-08-27 (Tue, 27 Aug 2013)

  Changed paths:
    M ckan/logic/__init__.py
    M ckan/new_authz.py

  Log Message:
  -----------
  [#1210] Require a logged in user by default except for get actions

By default, any auth function not in get.py will not allow anonymous
access, ie will require a logged in user to be performed. Core auth
functions are automatically configured when building the `AuthFunctions`
cache, but two decorators are provided to allow defining exceptions
in both cases and extensions to define the behaviour on their own auth
functions. The decoratos are `auth_allow_anonymous_access` and
`auth_disllow_anonymous_access`.

`check_access` will check for the auth_allow_anonymous_access attribute
on the auth function, and if False and there isn't a validated user
object in the context, it will raise a NotAuthorized exception.


  Commit: 13f07b7f2a6fdfc26996a737503df11800203470
      https://github.com/okfn/ckan/commit/13f07b7f2a6fdfc26996a737503df11800203470
  Author: amercader <amercadero at gmail.com>
  Date:   2013-08-27 (Tue, 27 Aug 2013)

  Changed paths:
    M ckan/controllers/storage.py
    M ckan/logic/auth/create.py
    M ckan/logic/auth/update.py
    M ckan/tests/logic/test_init.py

  Log Message:
  -----------
  [#1210] Fix auth tests and tweak auth functions

Add the anon access decorator to some functions as they require it in
some circumstances.

The storage controller was calling `is_authorized_boolean` directly,
which should be never done (same for `is_authorized`).

It would be god to refactor password_reset out of user_update, so
user_update does not require anon access.


  Commit: ffbf901e45055f34e2460a40b4cc84cec617e12d
      https://github.com/okfn/ckan/commit/ffbf901e45055f34e2460a40b4cc84cec617e12d
  Author: amercader <amercadero at gmail.com>
  Date:   2013-08-27 (Tue, 27 Aug 2013)

  Changed paths:
    M ckan/plugins/toolkit.py
    M doc/toolkit.rst

  Log Message:
  -----------
  [#1210] Add decorators to the plugins toolkit


  Commit: 9488125dbd873cff0cd0ee54f70a7d2567f81dfb
      https://github.com/okfn/ckan/commit/9488125dbd873cff0cd0ee54f70a7d2567f81dfb
  Author: amercader <amercadero at gmail.com>
  Date:   2013-08-27 (Tue, 27 Aug 2013)

  Changed paths:
    M ckan/tests/logic/test_init.py
    M ckanext/datastore/logic/auth.py

  Log Message:
  -----------
  [#1210] Yet more tests fixes


  Commit: 1988837c58a54a13871236a81f6ceb7e0a779180
      https://github.com/okfn/ckan/commit/1988837c58a54a13871236a81f6ceb7e0a779180
  Author: amercader <amercadero at gmail.com>
  Date:   2013-08-28 (Wed, 28 Aug 2013)

  Changed paths:
    M ckan/controllers/admin.py
    M ckan/controllers/api.py
    M ckan/controllers/feed.py
    M ckan/controllers/home.py
    M ckan/controllers/package.py
    M ckan/controllers/related.py
    M ckan/controllers/revision.py
    M ckan/controllers/tag.py
    M ckan/controllers/user.py

  Log Message:
  -----------
  [#1210] Add user object to context in controllers

The base controller already checked whether there was a user object in
the db for the user name provided. If we added it to the context we save
the same check on check_access.


  Commit: be81ab9fff5e37eb1066c7ce4f89bc887e522943
      https://github.com/okfn/ckan/commit/be81ab9fff5e37eb1066c7ce4f89bc887e522943
  Author: amercader <amercadero at gmail.com>
  Date:   2013-08-29 (Thu, 29 Aug 2013)

  Changed paths:
    M ckan/logic/__init__.py
    M ckan/new_authz.py

  Log Message:
  -----------
  [#1210] Minor changes after review


  Commit: a0b6faca09af223224b5b2659c3f1a83b2212278
      https://github.com/okfn/ckan/commit/a0b6faca09af223224b5b2659c3f1a83b2212278
  Author: amercader <amercadero at gmail.com>
  Date:   2013-08-29 (Thu, 29 Aug 2013)

  Changed paths:
    M ckan/logic/__init__.py
    M ckan/plugins/interfaces.py

  Log Message:
  -----------
  [#1210] Add some docs


  Commit: 86b4e89a5cbdb7d1d846d5465f454877b36b540b
      https://github.com/okfn/ckan/commit/86b4e89a5cbdb7d1d846d5465f454877b36b540b
  Author: amercader <amercadero at gmail.com>
  Date:   2013-09-11 (Wed, 11 Sep 2013)

  Changed paths:
    M CONTRIBUTING.rst
    M ckan/config/deployment.ini_tmpl
    M ckan/config/solr/schema-2.0.xml
    M ckan/lib/base.py
    M ckan/lib/cli.py
    M ckan/lib/dictization/model_dictize.py
    M ckan/lib/helpers.py
    M ckan/lib/navl/dictization_functions.py
    M ckan/lib/plugins.py
    M ckan/lib/search/__init__.py
    M ckan/lib/search/index.py
    M ckan/lib/search/query.py
    M ckan/logic/__init__.py
    M ckan/logic/action/get.py
    M ckan/pastertemplates/template/setup.py_tmpl
    M ckan/plugins/interfaces.py
    M ckan/plugins/toolkit.py
    A ckan/plugins/toolkit_sphinx_extension.py
    M ckan/templates/package/snippets/additional_info.html
    M ckan/templates/user/request_reset.html
    M ckan/tests/logic/test_action.py
    M ckanext/datastore/logic/action.py
    M ckanext/datastore/plugin.py
    M ckanext/datastore/tests/test_create.py
    A ckanext/example_iauthfunctions/__init__.py
    A ckanext/example_iauthfunctions/plugin.py
    A ckanext/example_iauthfunctions/plugin_v1.py
    A ckanext/example_iauthfunctions/plugin_v2.py
    A ckanext/example_iauthfunctions/plugin_v3.py
    A ckanext/example_iauthfunctions/tests/test_example_iauthfunctions.py
    M ckanext/multilingual/solr/schema.xml
    M doc/api.rst
    M doc/authorization.rst
    M doc/background-tasks.rst
    M doc/ckan-coding-standards.rst
    M doc/conf.py
    M doc/configuration.rst
    M doc/data-viewer.rst
    M doc/datastore.rst
    M doc/documentation-guidelines.rst
    A doc/extensions/best-practices.rst
    A doc/extensions/converters.rst
    A doc/extensions/index.rst
    A doc/extensions/plugin-interfaces.rst
    A doc/extensions/plugins-toolkit.rst
    A doc/extensions/testing-extensions.rst
    A doc/extensions/tutorial.rst
    A doc/extensions/validators.rst
    M doc/index.rst
    M doc/python-coding-standards.rst
    M doc/tag-vocabularies.rst
    R doc/toolkit.rst
    R doc/writing-extensions.rst
    M setup.py

  Log Message:
  -----------
  Merge branch 'master' into 1210-auth-checks-improvements

Conflicts due to changes in the docstrings for #943. Added relevant
missing bits.

Conflicts:
	ckan/logic/__init__.py
	ckan/plugins/interfaces.py
	doc/toolkit.rst


  Commit: e01b8c07aca9efcb5583f6f96a495cccec9e824c
      https://github.com/okfn/ckan/commit/e01b8c07aca9efcb5583f6f96a495cccec9e824c
  Author: amercader <amercadero at gmail.com>
  Date:   2013-09-11 (Wed, 11 Sep 2013)

  Changed paths:
    M ckan/logic/__init__.py

  Log Message:
  -----------
  [#1210] check_access should always get an action name


  Commit: 452a4c5cd7bfd19b56ade5a38d3eb23747f9c27a
      https://github.com/okfn/ckan/commit/452a4c5cd7bfd19b56ade5a38d3eb23747f9c27a
  Author: amercader <amercadero at gmail.com>
  Date:   2013-09-11 (Wed, 11 Sep 2013)

  Changed paths:
    M ckanext/example_iauthfunctions/plugin.py
    M ckanext/example_iauthfunctions/tests/test_example_iauthfunctions.py

  Log Message:
  -----------
  [#1210] Fix test in ExampleIAuthFunctions Plugin


  Commit: bd200d09a5709646d33c5894c6926f4db160bf53
      https://github.com/okfn/ckan/commit/bd200d09a5709646d33c5894c6926f4db160bf53
  Author: amercader <amercadero at gmail.com>
  Date:   2013-09-11 (Wed, 11 Sep 2013)

  Changed paths:
    M ckanext/example_iauthfunctions/tests/test_example_iauthfunctions.py

  Log Message:
  -----------
  [#1210] pep8 fix


  Commit: e2d9ce5c3c22941a4f7c5633c3da3bbdd8e79f21
      https://github.com/okfn/ckan/commit/e2d9ce5c3c22941a4f7c5633c3da3bbdd8e79f21
  Author: John Glover <j at johnglover.net>
  Date:   2013-09-11 (Wed, 11 Sep 2013)

  Changed paths:
    M ckan/controllers/admin.py
    M ckan/controllers/api.py
    M ckan/controllers/feed.py
    M ckan/controllers/home.py
    M ckan/controllers/package.py
    M ckan/controllers/related.py
    M ckan/controllers/revision.py
    M ckan/controllers/storage.py
    M ckan/controllers/tag.py
    M ckan/controllers/user.py
    M ckan/logic/__init__.py
    M ckan/logic/auth/create.py
    M ckan/logic/auth/update.py
    M ckan/new_authz.py
    M ckan/plugins/interfaces.py
    M ckan/plugins/toolkit.py
    M ckan/tests/logic/test_init.py
    M ckanext/datastore/logic/auth.py
    M ckanext/example_iauthfunctions/plugin.py
    M ckanext/example_iauthfunctions/tests/test_example_iauthfunctions.py

  Log Message:
  -----------
  Merge pull request #1210 from okfn/1210-auth-checks-improvements

Auth checks improvements for logged in users


Compare: https://github.com/okfn/ckan/compare/8dbd071c9e99...e2d9ce5c3c22


More information about the ckan-changes mailing list