Age | Commit message (Expand) | Author |
2023-01-04 | auth: return group info as part of user details...* gn3/app.py: import blueprint from authorisation views inorder to get all
endpoints
* gn3/auth/authentication/oauth2/views.py: remove the `/user` endpoint
* gn3/auth/authorisation/views.py: add the `/user` endpoint and add the group
information to the user details.
| Frederick Muriuki Muriithi |
2023-01-04 | auth: Return only non-resource roles on `/user-roles` endpoint...Resource roles will be returned as part of the resources request.
* gn3/auth/authorisation/roles.py: Simplify query - only get non-resource
roles
* gn3/auth/authorisation/views.py: update docstring
| Frederick Muriuki Muriithi |
2023-01-03 | auth: Fetch all of a user's roles....* gn3/auth/authorisation/roles.py: Fetch roles from DB
* gn3/auth/authorisation/views.py: Provide API endpoint for user roles
* tests/unit/auth/test_roles.py: Tests to check fetching roles works correctly
Fix linting and typing issues in the following files:
* gn3/auth/authentication/oauth2/resource_server.py
* gn3/auth/authentication/oauth2/views.py
* tests/unit/auth/fixtures/oauth2_client_fixtures.py
| Frederick Muriuki Muriithi |
2023-01-03 | auth: rename fixtures: test_* -> fxtr_*...Since test functions are defined starting with "test_", rename the fixture to
more clearly indicate it is a fixture (fxtr_*), an not a test in itself.
| Frederick Muriuki Muriithi |
2022-12-31 | auth: Document new ideas for privileges | Frederick Muriuki Muriithi |
2022-12-28 | auth: Add resource server and /user endpoint...Add a resource server with the validator for the bearer token to protect the
resources endpoints.
Add a protected `/user` endpoint that returns the user details for valid
tokens.
* gn3/auth/authentication/oauth2/resource_server.py: new file
* gn3/auth/authentication/oauth2/views.py: add /user endpoint
| Frederick Muriuki Muriithi |
2022-12-23 | Update how to set configurations in README | zsloan |
2022-12-23 | Add a couple necessary environment variables | zsloan |
2022-12-22 | tests: Setup environment variables and configs...* gn3/settings.py: leave `OAUTH2_ACCESS_TOKEN_GENERATOR` in its default
setting
* tests/unit/auth/fixtures/oauth2_client_fixtures.py: setup
`AUTHLIB_INSECURE_TRANSPORT` before running the OAuth2 tests
* tests/unit/conftest.py: setup the test application's configuration correctly
for the tests.
| Frederick Muriuki Muriithi |
2022-12-22 | auth: implement OAuth2 flow....Add code to implement the OAuth2 flow.
* Add test fixtures for setting up users and OAuth2 clients
* Add tests for token generation with the "Password Grant" flow
* Fix some issues with test due to changes in the database connection's
row_factory
oauth2_auth_flow | Frederick Muriuki Muriithi |
2022-12-21 | auth: oauth2: users: Add expected property...* gn3/auth/authentication/users.py: authlib expects the user object to have a
`get_user_id` method.
| Frederick Muriuki Muriithi |
2022-12-21 | migrations: create the authorisation_code table...* migrations/auth/20221219_03_PcTrb-create-authorisation-code-table.py: new
migration
* tests/unit/auth/test_migrations_create_tables.py: test new migration
| Frederick Muriuki Muriithi |
2022-12-21 | migrations: create oauth2_tokens table...* migrations/auth/20221219_02_buSEU-create-oauth2-tokens-table.py
* tests/unit/auth/test_migrations_create_tables.py
| Frederick Muriuki Muriithi |
2022-12-21 | migrations: New migration...* migrations/auth/20221219_01_CI3tN-create-oauth2-clients-table.py: New
migration
* tests/unit/auth/test_migrations_create_tables.py: tests for new migration
| Frederick Muriuki Muriithi |
2022-12-21 | auth: Add default row_factory to sqlite3...* gn3/auth/db.py: For easier setting up of objects after querying, set the
default row_factory object that allows indexing by database field name.
| Frederick Muriuki Muriithi |
2022-12-21 | Enable authentication...* gn3/auth/authentication/routes.py: Add `/login` endpoint and a function to
validate the login credentials.
* gn3/auth/authentication/users.py: add function to fetch user details by
email
| Frederick Muriuki Muriithi |
2022-12-21 | gn3: (gn3.random -> gn3.chancy): Rename module to avoid conflicts....Rename the `gn3.random` module to gn3.chancy to avoid conflicts with Python's
`random` module.
* gn3/random.py -> gn3/chancy.py: rename module
* gn3/commands.py: update import
* gn3/computations/partial_correlations.py: update import
* gn3/computations/qtlreaper.py: update import
* gn3/computations/rust_correlation.py: update import
* gn3/db/correlations.py: update import
* gn3/db/traits.py: update import
* gn3/heatmaps.py: update import
* tests/integration/conftest.py: update import
| Frederick Muriuki Muriithi |
2022-12-12 | auth: functions to get user resources...* gn3/auth/authorisation/resources.py: add function to get the resources that
the user has access to.
| Frederick Muriuki Muriithi |
2022-12-12 | tests: Update fixtures to use for testing resources functions | Frederick Muriuki Muriithi |
2022-12-12 | auth: Add a way to check whether a user is a group leader...* gn3/auth/authorisation/groups.py: Add `is_group_leader` function
| Frederick Muriuki Muriithi |
2022-12-12 | auth: pass cursor object to `user_group` function | Frederick Muriuki Muriithi |
2022-12-12 | auth: Attach group to GroupRole, rather than group_id | Frederick Muriuki Muriithi |
2022-12-12 | tests: Reorganise fixtures...Split the fixtures into separate modules for easier management
* tests/unit/auth/conftest.py: Import all from the `fixtures` package. Delete
all fixtures from the file
* tests/unit/auth/fixtures/__init__.py: new `fixtures` package
* tests/unit/auth/fixtures/group_fixtures.py: new groups fixtures module
* tests/unit/auth/fixtures/migration_fixtures.py: new migrations fixtures
module
* tests/unit/auth/fixtures/resource_fixtures.py: new resources fixtures module
* tests/unit/auth/fixtures/role_fixtures.py: new roles fixtures module
* tests/unit/auth/fixtures/user_fixtures.py: new users fixtures module
| Frederick Muriuki Muriithi |
2022-12-08 | Remove unused import | Frederick Muriuki Muriithi |
2022-12-08 | auth: test for `user_resources` function (incomplete)...* gn3/auth/authorisation/resources.py: dummy `user_resources` function
* tests/unit/auth/conftest.py: (incomplete): Add some fixtures for testing the
`user_resources` function
* tests/unit/auth/test_resources.py: test the `user_resources` function
| Frederick Muriuki Muriithi |
2022-12-08 | tests: Fix issues caught by tests...The addition of the `public` field in the `resources` table, led to some
previously passing tests to fail. This commit fixes the failures, and cleans
up some pylint issues.
* gn3/auth/authorisation/resources.py: add `public` to db queries
* tests/unit/auth/test_groups.py: fix pylint issues
| Frederick Muriuki Muriithi |
2022-12-08 | auth: add test to retrieve public resources...* gn3/auth/authorisation/resources.py: new functions
* resource_categories: retrieves all resource categories
* public_resources: retrieves all public resources
* tests/unit/auth/test_resources.py: test `public_resources` function
| Frederick Muriuki Muriithi |
2022-12-08 | auth: add function to retrieve a user's group...* gn3/auth/authorisation/groups.py: new `user_group` function
* tests/unit/auth/test_groups.py: test `user_group` function
| Frederick Muriuki Muriithi |
2022-12-08 | migrations: Add column `public` to `resources` table...* migrations/auth/20221208_01_sSdHz-add-public-column-to-resources-table.py:
new migration script.
* tests/unit/auth/test_migrations_add_remove_columns.py: test new migration
script
| Frederick Muriuki Muriithi |
2022-12-06 | Use a dataset's name to fetch it's metadata from RDF...* gn3/api/metadata.py (jsonify_dataset_metadata): Rewrite metadata
end-point to use a dataset's name instead of it's accession_id.
* gn3/db/rdf.py (get_dataset_metadata): Replace accession_id with
name. Use one single RDF query instead of multiple queries.
| Munyoki Kilyungi |
2022-12-06 | migrations: Add `group_user_roles_on_resources` table...* migrations/auth/20221206_01_BbeF9-create-group-user-roles-on-resources-table.py:
new migration
* tests/unit/auth/test_migrations_create_tables.py: Test creation of table
* tests/unit/auth/test_migrations_indexes.py: Test creation of index
| Frederick Muriuki Muriithi |
2022-12-06 | mypy and pylint fixes | Alexander_Kabui |
2022-12-06 | remove noisy tests for constant array correlation | Alexander_Kabui |
2022-12-06 | update tests for lit correlation | Alexander_Kabui |
2022-12-02 | correlations: return `None` rather than zero for missing lit corrs...* gn3/computations/correlations.py: Return `None` for missing literature
correlations rather than zero. Update the sorting key to avoid issues with
comparing floats to NoneType objects
| Frederick Muriuki Muriithi |
2022-11-29 | remove trailing whitespace | AlexanderKabui |
2022-11-29 | remove unused function parameter | AlexanderKabui |
2022-11-29 | tests: fix failing test...* tests/unit/computations/test_rust_correlation.py: The underlying code
changed and the test needed to be updated to test the correct thing.
| Frederick Muriuki Muriithi |
2022-11-28 | Catch a URLError when virtuoso isn't running at all...* gn3/api/metadata.py: Import URLError.
(jsonify_dataset_metadata): Add URLError in except block.
| Munyoki Kilyungi |
2022-11-28 | Fix pylint errors...* gn3/api/general.py: Delete rdf import. Delete trailing white
spaces.
* gn3/api/metadata.py: Delete trailing white spaces.
| Munyoki Kilyungi |
2022-11-28 | Fail gracefully when virtuoso is not accessible...* gn3/api/metadata.py: import RemoteDisconnected.
(jsonify_dataset_metadata): Wrap get_dataset_metadata in try block.
| Munyoki Kilyungi |
2022-11-24 | auth: Check for authentication and fix errors...* gn3/auth/authorisation/groups.py: base `MembershipError` on new
`AuthorisationError` base exception. Use new authentication checking
decorator.
* gn3/auth/authorisation/privileges.py: Change argument to User object rather
than UUID object
* gn3/auth/authorisation/roles.py: Use new authentication checking decorator.
* tests/unit/auth/test_groups.py: use `conftest.TEST_USER`
* tests/unit/auth/test_privileges.py: use `conftest.TEST_USER`
* tests/unit/auth/test_roles.py: use `conftest.TEST_USER`
| Frederick Muriuki Muriithi |
2022-11-24 | auth: Implement `create_resource` function...* 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.
| Frederick Muriuki Muriithi |
2022-11-24 | auth: Define base exceptions...* gn3/auth/authentication/exceptions.py: define `AuthenticationError`
* gn3/auth/authorisation/exceptions.py: define `AuthorisationError`
| Frederick Muriuki Muriithi |
2022-11-24 | tests: Add test for `create_resource`...* gn3/auth/authorisation/resources.py: Define Resource and ResourceCategory
classes. Create the `create_resource` stub.
* tests/unit/auth/test_resources.py: test for `create_resource` function
| Frederick Muriuki Muriithi |
2022-11-23 | Create a new REST endpoint for fetching a phenotype's metadata...* gn3/api/general.py: (dataset_metadata) Delete.
* gn3/api/metadata.py: Import Blueprint, jsonify, current_app,
SPARQLWrapper and get_dataset_metadata.
(metadata): New Blueprint
(jsonify_dataset_metadata): New function/end-point.
* gn3/app.py: Import metadata
(create_app): Register metadata blueprint.
| Munyoki Kilyungi |
2022-11-21 | auth: Prevent group leader from being a member of multiple groups...* gn3/auth/authorisation/groups.py: Assign the group leader at group creation
time.
* tests/unit/auth/test_groups.py: Ensure the group leader is only ever a
member of a single group.
| Frederick Muriuki Muriithi |
2022-11-17 | auth: Finish implementation of `create_group_role`...* gn3/auth/authorisation/groups.py: Add `GroupRole` type. Fix typing
annotations. Fix bugs.
* tests/unit/auth/conftest.py: Fix bugs.
* tests/unit/auth/test_groups.py: Fix test to run.
| Frederick Muriuki Muriithi |
2022-11-17 | Migrations: Create `group_users` table...* migrations/auth/20221117_02_fmuZh-create-group-users-table.py: new migration
* tests/unit/auth/test_migrations_create_tables.py: test new migration
* tests/unit/auth/test_migrations_indexes.py: test new migration
| Frederick Muriuki Muriithi |
2022-11-17 | tests: Add test to check creation of roles attached to groups...* tests/unit/auth/conftest.py: Add fixtures to help with testing
* tests/unit/auth/test_groups.py: Add incomplete and failing test
| Frederick Muriuki Muriithi |