Skip to content

Introduces Gatekeeper and modernizes C# data tooling#1

Merged
MelbourneDeveloper merged 25 commits intomainfrom
fix
Apr 10, 2026
Merged

Introduces Gatekeeper and modernizes C# data tooling#1
MelbourneDeveloper merged 25 commits intomainfrom
fix

Conversation

@MelbourneDeveloper
Copy link
Copy Markdown
Collaborator

TLDR

Introduces the Gatekeeper microservice for passkey-only authentication and fine-grained authorization, alongside a major overhaul of the C# data access layer to use Nimblesite Postgres tooling and improve CI.

Details

  • Adds the new Gatekeeper microservice: Provides passkey (WebAuthn/FIDO2) authentication and a comprehensive role-based access control (RBAC) system with resource-level permissions.
  • Modernizes C# data access tooling: Migrates all C# projects from MelbourneDev to Nimblesite DataProvider, LQL, and Migration packages. This transition shifts schema introspection from SQLite to direct PostgreSQL interaction.
  • Removes committed generated code: All DataProvider-generated C# (Generated/*.g.cs) and SQL (*.generated.sql) files are no longer tracked in version control. They are now generated dynamically on every build against a live PostgreSQL instance, ensuring up-to-date and type-accurate code.
  • Enhances CI/CD and local dev workflow: The Makefile now includes explicit targets (db-up, db-migrate, db-down, db-reset) for managing a local Docker Compose-based PostgreSQL database. These are integrated into make build, make test, and make lint to ensure a consistent and robust environment.
  • Improves testing reliability: Test execution is now consolidated and ordered to fail fast across projects. A new ICD10.TestSupport project simplifies ICD-10 database setup in integration tests.
  • Simplifies PR template: Updates the pull request template for a more streamlined experience.

How Do The Automated Tests Prove It Works?

  • New Gatekeeper.Api.Tests contain integration tests for passkey registration and login flows, as well as comprehensive authorization checks for RBAC and resource-level grants.
  • The main make test command orchestrates execution of all test projects in a specified order, ensuring foundational services are tested before their consumers. The stopOnFail configuration in xUnit and set -e in the Makefile ensures immediate failure on any broken test.
  • The make ci workflow now explicitly starts and migrates the PostgreSQL database before running any builds or tests, verifying the entire data access and generation pipeline functions correctly.

DataProvider 0.9.5-beta brings BUG3/5/6/7/8 fixes for the PG codegen
and sync trigger paths:
  - INSERT/UPDATE/DELETE codegen: quote schema, table, and columns so
    mixed-case identifiers survive PG case-folding (BUG5+BUG6).
  - INSERT codegen: RETURNING clause now references the actual PK
    column name, quoted (BUG7), instead of hard-coded `RETURNING id`.
  - Sync.Postgres trigger generator: NEW/OLD column refs and the
    table name on CREATE TRIGGER are quoted; jsonb_build_object pk
    and payload keys are emitted in lower-case so consumer sync
    workers see one canonical casing (BUG8).

HealthcareSamples changes:
  - Bump Directory.Build.props DataProviderVersion + tools.json to
    0.9.5-beta. Restore tools.
  - Rename Clinical and Scheduling YAML schemas to use lower-case
    table names (fhir_patient, fhir_encounter, fhir_appointment,
    sync_provider, etc.) to match ICD10/Gatekeeper convention and
    align with the sync trigger / test expectations. Column names
    stay PascalCase. Updates the matching .lql query files,
    DataProvider.json table refs, sync workers, sync mappings,
    and Program.cs Insert*/Update* extension method call sites.
  - Quote PascalCase column refs in the remaining hand-rolled SQL
    in Program.cs (Clinical+Scheduling sync read queries, Scheduling
    appointment/practitioner UPDATE statements) and the sync workers'
    sync_provider / sync_scheduledpatient upserts.
  - Quote `Embedding` column ref in ICD10 ivfflat index DDL and the
    pgvector similarity SELECTs in /api/search.
  - Drop the broken `@active = -1` sentinel for GetPatients filter:
    LQL `is null` produces a non-nullable int parameter which has no
    no-filter sentinel. Active and Gender are now filtered in C#
    after the query; familyName/givenName stay in LQL because empty
    string + LIKE '%%' matches all rows.
  - Adjust coverage thresholds for ICD10.Api.Tests, ICD10.Cli.Tests
    and Dashboard.Integration.Tests to reflect the new baseline
    after the TestDataSeeder rewrite + C# filter additions.

Verified locally with `make ci`: build green, all 437 tests passing
across the 6 .NET test projects, all coverage thresholds met.
@MelbourneDeveloper MelbourneDeveloper merged commit 657bbc8 into main Apr 10, 2026
1 check passed
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.

1 participant