about summary refs log tree commit diff
AgeCommit message (Collapse)Author
2026-09-02test(gn-auth): public resource grants view-resource to all authenticated users HEAD mainClaude Sonnet 4.6
All resources marked public in gn-auth grant group:resource:view-resource to every user, not just anonymous callers. This test pins that contract: an authenticated admin posting _PUBLIC_TRAIT must receive the same view privilege as an unauthenticated caller. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Reviewed-By: Frederick M. Muriithi <fredmanglis@gmail.com>
2026-09-02test(gn-auth): authenticated data/authorisation structure and unknown-trait 404Claude Sonnet 4.6
Add two contract tests: - data/authorisation with token: verify the response body contains an 'authorisation' key with at least one item, confirming the response structure is the same as the no-token path. - data/authorisation with token + unknown trait: verify NotFoundError (404) is raised regardless of whether a token is present — the resource lookup precedes the token check. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Reviewed-By: Frederick M. Muriithi <fredmanglis@gmail.com>
2026-09-02test(gn-auth): system/roles role shape and authenticated data authorisationClaude Sonnet 4.6
Add two contract tests: - system/roles with token: verify response is a non-empty list of role objects each containing a 'role_name' field. - data/authorisation with token for public trait: verify authenticated path returns 200 (the token path through require_oauth.acquire). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Reviewed-By: Frederick M. Muriithi <fredmanglis@gmail.com>
2026-09-02test(gn-auth): system/roles public-view content and authenticated 200Claude Sonnet 4.6
Add two contract tests for GET /auth/resource/system/roles: - Without a token the response must be a list containing the 'public-view' role (verifies the no-Authorization fallback branch). - With a valid Bearer token the endpoint must return 200. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-09-02test(gn-auth): unknown-trait 404 and system/roles no-token 200Claude Sonnet 4.6
Add two contract tests for gn-auth's authorisation endpoints: - POST /auth/data/authorisation with a non-existent trait must return 404 (gn-auth raises NotFoundError which maps to error_code=404). - GET /auth/resource/system/roles without an Authorization header must return 200 with the public-view role rather than 401. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Reviewed-By: Frederick M. Muriithi <fredmanglis@gmail.com>
2026-09-02test(gn_auth): add data/authorisation contract tests — no-token public ↵Claude Sonnet 4.6
fallback GN2 calls POST /auth/data/authorisation per-request to check a user's privileges on a trait's resource. Without a Bearer token the endpoint does not 401; instead it returns public-access privileges for publicly visible resources. Two tests verify this contract: test_data_authorisation_no_token_public_trait_returns_200 Confirms the endpoint returns 200 for a known public trait without a token. test_data_authorisation_no_token_public_trait_grants_view_privilege Confirms the response includes 'group:resource:view-resource' — the privilege GN2 checks to determine read access. Co-Authored-By: Frederick Muriuki Muriithi <fmuriit1@uthsc.edu>
2026-09-02test(gn2): add unauthenticated redirect tests for diffs endpointsClaude Sonnet 4.6
Extends Part 1 of the gn2 auth-flow suite with four more @login_required checks covering the remaining metadata-edit endpoints: test_unauthenticated_list_diffs_redirects GET /datasets/diffs → 301/302 without session test_unauthenticated_show_diff_redirects GET /datasets/diffs/<name> → 301/302 without session test_unauthenticated_approve_diff_redirects POST /datasets/<resource_id>/diffs/<name>/approve → 301/302 test_unauthenticated_reject_diff_redirects POST /datasets/<resource_id>/diffs/<name>/reject → 301/302 Co-Authored-By: Frederick Muriuki Muriithi <fmuriit1@uthsc.edu>
2026-09-02test(gn2): add auth-flow tests — unauthenticated redirect checks (Part 1)Claude Sonnet 4.6
Two tests covering @login_required enforcement on the metadata-edit blueprint (prefix: /datasets/). No credentials required — these fire as part of the gn2 auth_flow suite. test_unauthenticated_display_phenotype_redirects GET /datasets/<dataset_id>/traits/<name> → 301/302 without session test_unauthenticated_update_phenotype_redirects POST /datasets/<dataset_id>/traits/<name> → 301/302 without session Co-Authored-By: Frederick Muriuki Muriithi <fmuriit1@uthsc.edu>
2026-08-31test(smoke): migrate auth/system/roles -> auth/resource/system/rolesClaude
Update all references in the smoke tests (URLs and comments) to use the non-deprecated endpoint path.
2026-08-31test(case-attr): remove stale BUG docstring from edit testClaude
The __population_privileges__ bug described in the docstring and assertion message of test_resource_owner_can_edit_returns_201 is fixed. Remove the stale description and simplify the assertion message. Also updates the Level 4 section comment (dropped the bug parenthetical). Reviewed-By: Frederick M. Muriithi <fredmanglis@gmail.com>
2026-08-31test(case-attr): pre-provision resource-owner token per sessionClaude
Replace the per-invocation provisioned_token("resource-owner", ...) call in test_resource_owner_can_edit_returns_201 with a new session-scoped resource_owner_token fixture. One user is created and torn down per test session instead of per parametrized test invocation. Also fix the provisioned_token teardown URL: /auth/user/delete was moved to /auth/system/administration/users/delete. Reviewed-By: Frederick M. Muriithi <fredmanglis@gmail.com>
2026-08-31test(gn3/case-attr): level 5 — data-curator approve/rejectClaude
Add fixtures and tests for approve/reject access control using a systemwide-data-curator token. conftest.py: - data_curator_oauth2_credentials: reads role "systemwide-data-curator" from GN_TEST_USERS_FILE; skips if absent. - data_curator_token: requests scope "profile group resource role user". tests/test_gn3_case_attr_access.py: - test_data_curator_can_approve_returns_200_or_201: parametrized over flat (/case-attribute/…) and v1 endpoints; asserts 200 or 201 (either proves the auth check passed). - test_data_curator_can_reject_returns_200_or_201: same for reject paths. Reviewed-By: Frederick M. Muriithi <fredmanglis@gmail.com>
2026-08-31Bugfix: Update to new URI.Frederick Muriuki Muriithi
2026-08-31Fix under-provisioned scope for tokens.Frederick Muriuki Muriithi
2026-08-28test(gn3/case-attr): level 4 bug test — resource-owner edit returns 201Frederick Muriuki Muriithi
Adds provisioning fixtures and a parametrized test that assigns resource-owner role to a freshly created test user on the BXD population resource, then expects 201 from both the flat and v1 edit endpoints. The test is RED with current code because __population_privileges__ calls GET /auth/resource/<id>/roles without a Bearer token, so resource_privs is always empty and can_edit's resource_spec branch is never satisfied. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-08-28test(gn3/case-attr): level 2 access-control for approve and reject endpointsFrederick Muriuki Muriithi
Two parametrized tests covering both the flat /case-attribute/ blueprint and the v1 hierarchy for approve and reject diff operations: - test_no_privilege_approve_returns_401: basic token must get 401 - test_no_privilege_reject_returns_401: basic token must get 401 Expected RED on the flat endpoints (using old required_access helper with wrong privilege check); v1 endpoints already use can_apply_or_reject_edit. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Reviewed-By: Frederick M. Muriithi <fredmanglis@gmail.com>
2026-08-28test(gn3/case-attr): access-control level 1 & 2 for edit endpointsFrederick Muriuki Muriithi
Case-attribute names are public; tests cover only write endpoints. Two parametrized tests over both the flat /case-attribute/ and the new /api/v1/species/<s>/populations/<p>/case-attributes/ hierarchy: - test_no_token_edit_returns_400: POST /edit with no token must return 400 - test_no_privilege_edit_returns_401: POST /edit with unprivileged token must return 401 Both tests are expected RED until the can_edit privilege check is added to the flat and v1 edit endpoints. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Reviewed-By: Frederick M. Muriithi <fredmanglis@gmail.com>
2026-08-25test(gn3/case-attr): assert 201 and queued status for valid-token editClaude
Two new integration tests on POST /case-attribute/<id>/edit that go past the auth layer and verify actual business-logic behaviour: * test_edit_with_valid_token_returns_201 — status code must be 201 * test_edit_with_valid_token_queues_diff — body must contain diff-status='queued' The edit endpoint queues rather than immediately modifying the DB, so these tests are safe to run against CD without side-effects. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Reviewed-By: Frederick M. Muriithi <fredmanglis@gmail.com>
2026-06-26tests: mark test_search_shows_results_found as transientClaude
The search endpoint occasionally returns a page without 'records found' when GN2 is under load or just restarted (cold query path). The test passes on immediate re-run. Mark transient as a signal for future retry logic (e.g. pytest-rerunfailures) rather than treating failures as definitive.
2026-06-26tests: add valid-token passthrough test for case-attribute editClaude
2026-06-26tests: add token-required tests for approve and reject case-attribute endpointsClaude
2026-06-26tests: add gn3 auth-flow tests for case-attribute token enforcementClaude
2026-06-22Remove misplaced mark.Frederick Muriuki Muriithi
2026-06-22Test for error code 400.Frederick Muriuki Muriithi
RFC 6749 section 5.2 (https://www.rfc-editor.org/rfc/rfc6749.html#section-5.2) states that the response code for `invalid_grant` should be 400, not 401. Update the test, therefore, to check for the correct status code.
2026-06-15tests: add TestMasqueradePrivilege auth-flow testsClaude Sonnet 4.6
Test that POST /auth/user/masquerade/ enforces the system:user:masquerade privilege. Both admin and basic users can obtain a token with masquerade scope (the test client supports it), but gn-auth's can_masquerade decorator checks the user's roles: - Basic user → ForbiddenAccess → 403 - Admin user → can masquerade as basic user → 200 Adds three session-scoped fixtures to the test module: admin_masquerade_token, basic_masquerade_token, and basic_user_id.
2026-06-15tests: add TestUserProfileWithToken and TestUserProfileWithoutTokenClaude Sonnet 4.6
Test that GET /auth/user/ returns 200 with user fields when a valid Bearer token is present, and 401 when no token or a garbage token is supplied.
2026-06-15tests: add TestTokenGrantRejection auth-flow testsClaude Sonnet 4.6
Test that POST /auth/token returns 401 when given a wrong password or an unknown email address.
2026-06-15tests: add TestTokenGrant auth-flow testsClaude Sonnet 4.6
Test that POST /auth/token with valid admin credentials returns 200, includes an access_token, sets token_type to bearer, and grants at least the requested scopes.
2026-06-15conftest: file-based credentials for auth-flow testsClaude Sonnet 4.6
Replace individual GN_TEST_EMAIL/GN_TEST_PASSWORD/GN_OAUTH2_CLIENT_ID/ GN_OAUTH2_CLIENT_SECRET env vars with GN_TEST_USERS_FILE and GN_TEST_CLIENT_FILE, which point to the JSON files produced by the CI test-session setup commands (create-test-users, create-test-oauth2-client). The oauth2_credentials fixture retains the individual env var fallback so manual runs against an existing account still work. basic_oauth2_credentials requires the file-based approach (basic users are only created by the CI setup, not for manual runs). Adds _read_json_file and _user_by_role helpers, and appends basic_oauth2_credentials and basic_access_token fixtures.
2026-06-15conftest: add readiness check before test sessionClaude Sonnet 4.6
Poll each service base URL until it responds with a non-502/503 status before the test session begins. Retries on: - ConnectionError: process not yet bound to its port - 502/503: Nginx upstream-not-ready response (served while the upstream gunicorn process is still starting up behind the reverse proxy) Any other HTTP response is treated as "service is up". Polls every 2 seconds for up to 120 seconds, then raises RuntimeError with a clear message. This prevents spurious failures when smoke tests are queued immediately after a service restart.
2026-05-28Remove the expectation for failure after fixing the bug.Frederick Muriuki Muriithi
2026-05-27pyproject: add build-system stanza for Guix packagingClaude Sonnet 4.6
Without a [build-system] table Guix's pyproject-build-system has no backend to invoke. Declare setuptools so the package builds cleanly.
2026-05-27README: document that env vars work for any deploymentClaude Sonnet 4.6
The three BASE_URL variables are not limited to CD and production — they work for any live deployment. Add an explicit note and a concrete example using a personal/feature instance so this is clear to new contributors.
2026-05-27Initialise with smoke tests for various GeneNetwork services.Frederick Muriuki Muriithi
The code in this commit was written by claude code, and is yet to be reviewed. Expect changes once the code has been reviewed.