<feed xmlns='http://www.w3.org/2005/Atom'>
<title>genenetwork3/gn3/auth/authorisation/checks.py, branch auth/implement-authorization-code-flow</title>
<subtitle>GeneNetwork3 REST API for data science and machine learning
</subtitle>
<id>http://git.genenetwork.org/genenetwork3/atom?h=auth%2Fimplement-authorization-code-flow</id>
<link rel='self' href='http://git.genenetwork.org/genenetwork3/atom?h=auth%2Fimplement-authorization-code-flow'/>
<link rel='alternate' type='text/html' href='http://git.genenetwork.org/genenetwork3/'/>
<updated>2023-04-27T03:46:48+00:00</updated>
<entry>
<title>auth: Retrieve `system:*` privileges from resource roles</title>
<updated>2023-04-27T03:46:48+00:00</updated>
<author>
<name>Frederick Muriuki Muriithi</name>
</author>
<published>2023-04-27T03:33:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.genenetwork.org/genenetwork3/commit/?id=f2c09dc2dc2528c75fcf5b80aa4b530a0b5eef08'/>
<id>urn:sha1:f2c09dc2dc2528c75fcf5b80aa4b530a0b5eef08</id>
<content type='text'>
With the assignment of `system:*` privileges to roles, we need to check for
their existence when doing authorisation.

This commit provides a hack for that, seeing as user groups (and the system
itself) are not treated as resources, and therefore the way to fetch the
privileges is not entirely consistent.
</content>
</entry>
<entry>
<title>auth: groups: handle join requests.</title>
<updated>2023-02-08T14:44:50+00:00</updated>
<author>
<name>Frederick Muriuki Muriithi</name>
</author>
<published>2023-02-08T14:24:35+00:00</published>
<link rel='alternate' type='text/html' href='http://git.genenetwork.org/genenetwork3/commit/?id=9b94ec57c504acb6ef815d134144c4c357c71f17'/>
<id>urn:sha1:9b94ec57c504acb6ef815d134144c4c357c71f17</id>
<content type='text'>
</content>
</entry>
<entry>
<title>auth: tests: mock token acquisition. Fix minor bugs.</title>
<updated>2023-02-03T12:15:26+00:00</updated>
<author>
<name>Frederick Muriuki Muriithi</name>
</author>
<published>2023-02-03T12:15:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.genenetwork.org/genenetwork3/commit/?id=e6dd74a3fab65355c0aa187ee31d5ee74a888649'/>
<id>urn:sha1:e6dd74a3fab65355c0aa187ee31d5ee74a888649</id>
<content type='text'>
</content>
</entry>
<entry>
<title>auth: Improve authorisation</title>
<updated>2023-02-02T11:15:29+00:00</updated>
<author>
<name>Frederick Muriuki Muriithi</name>
</author>
<published>2023-02-02T11:15:29+00:00</published>
<link rel='alternate' type='text/html' href='http://git.genenetwork.org/genenetwork3/commit/?id=ecce454ca9d0f374e22da8401206e3b1695dbded'/>
<id>urn:sha1:ecce454ca9d0f374e22da8401206e3b1695dbded</id>
<content type='text'>
Retrieve the token, and user in the authorisation decorator to enable checking
of privileges.
</content>
</entry>
<entry>
<title>auth: create group: Fix group creation.</title>
<updated>2023-01-23T11:30:20+00:00</updated>
<author>
<name>Frederick Muriuki Muriithi</name>
</author>
<published>2023-01-23T11:30:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.genenetwork.org/genenetwork3/commit/?id=b9139c2356f75103bc5fd17f074f4ee0e74b64aa'/>
<id>urn:sha1:b9139c2356f75103bc5fd17f074f4ee0e74b64aa</id>
<content type='text'>
* gn3/auth/authorisation/checks.py: Enable passing user to authorisation
  checking function. Raise error on authorisation failure for consistent error
  handling.
* gn3/auth/authorisation/groups.py: Add user to group, updating the privileges
  as appropriate.
* gn3/auth/authorisation/resources.py: Fix resources querying
* gn3/auth/authorisation/roles.py: Assign/revoke roles by name
* gn3/auth/authorisation/views.py: Create group
* migrations/auth/20221108_01_CoxYh-create-the-groups-table.py: Add
  group_metadata field
* tests/unit/auth/fixtures/group_fixtures.py: fix tests
* tests/unit/auth/test_groups.py: fix tests
* tests/unit/auth/test_resources.py: fix tests
* tests/unit/auth/test_roles.py: fix tests
</content>
</entry>
<entry>
<title>auth: update privileges format</title>
<updated>2023-01-16T09:14:24+00:00</updated>
<author>
<name>Frederick Muriuki Muriithi</name>
</author>
<published>2023-01-16T09:14:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.genenetwork.org/genenetwork3/commit/?id=98dc0c5b1a67a7c7b97a1fa02211e9f99360edce'/>
<id>urn:sha1:98dc0c5b1a67a7c7b97a1fa02211e9f99360edce</id>
<content type='text'>
Save privileges with ids of the form &lt;top-level&gt;:&lt;sub-level&gt;:&lt;privilege-name&gt;
rather than using a UUID, to reduce indirection levels.

* migrations/auth/20230116_01_KwuJ3-rework-privileges-schema.py: new migration
  to change the schema and IDs for the privileges.
* Update code to use new privileges format
  * gn3/auth/authorisation/checks.py
  * gn3/auth/authorisation/groups.py
  * gn3/auth/authorisation/privileges.py
  * gn3/auth/authorisation/resources.py
  * gn3/auth/authorisation/roles.py
  * migrations/auth/20230116_01_KwuJ3-rework-privileges-schema.py
  * tests/unit/auth/fixtures/role_fixtures.py
  * tests/unit/auth/test_groups.py
  * tests/unit/auth/test_privileges.py
  * tests/unit/auth/test_roles.py
</content>
</entry>
<entry>
<title>auth: Implement `create_resource` function</title>
<updated>2022-11-24T10:52:29+00:00</updated>
<author>
<name>Frederick Muriuki Muriithi</name>
</author>
<published>2022-11-24T10:42:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.genenetwork.org/genenetwork3/commit/?id=021b8dfcb99928b363e4546f626e3deb5793e392'/>
<id>urn:sha1:021b8dfcb99928b363e4546f626e3deb5793e392</id>
<content type='text'>
* gn3/auth/authentication/checks.py: new `authenticated_p` decorator to apply
  on any function that requires the user to be authenticated before it runs.
* gn3/auth/authorisation/checks.py: use a `auth.authentication.users.User`
  object rather than a UUID object in the global `g`.
* gn3/auth/authorisation/groups.py: Implement the `authenticated_user_group`
  function to get the group(s) in which the currently authenticated user
  belongs.
* gn3/auth/authorisation/resources.py: Implement the `create_resource`
  function correctly.
* tests/unit/auth/conftest.py: extract the User objects into a global variable
  for reusability with the tests.
* tests/unit/auth/test_resources.py: Use global user objects from conftest in
  the tests. Set a User object (rather than UUID) in the global `g` variable.
</content>
</entry>
<entry>
<title>auth: Return results of calling function directly</title>
<updated>2022-11-15T10:08:56+00:00</updated>
<author>
<name>Frederick Muriuki Muriithi</name>
</author>
<published>2022-11-15T10:08:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.genenetwork.org/genenetwork3/commit/?id=a11bd7a2c7f5b9a82ce70b7baf9eae92561ed905'/>
<id>urn:sha1:a11bd7a2c7f5b9a82ce70b7baf9eae92561ed905</id>
<content type='text'>
* gn3/auth/authorisation/checks.py: Return results of calling the function
  rather than a dict of values that include the results.
* gn3/auth/authorisation/groups.py: Use the newer form of `authorised_p`
  decorator.
* tests/unit/auth/test_groups.py: Update tests
</content>
</entry>
<entry>
<title>auth: Reorganise package - move function to `checks` module</title>
<updated>2022-11-15T03:20:59+00:00</updated>
<author>
<name>Frederick Muriuki Muriithi</name>
</author>
<published>2022-11-15T03:19:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.genenetwork.org/genenetwork3/commit/?id=b1ee0958815cbb7265d2c5ea3a8374b532054f3b'/>
<id>urn:sha1:b1ee0958815cbb7265d2c5ea3a8374b532054f3b</id>
<content type='text'>
* gn3/auth/authorisation/__init__.py: delete function
* gn3/auth/authorisation/checks.py: move function to `checks` module
</content>
</entry>
</feed>
