Help us shape the future of Go! Take the 2026 Go Developer Survey

openndx-core

module
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2026 License: Apache-2.0

README

OpenNDX

An open-source data exchange platform. Data consumers ask for citizens' data through one GraphQL gateway; the platform checks the consumer's access, gets the citizen's consent where required, fetches the data from the organizations that hold it, and returns one merged answer.

Architecture

flowchart LR
    Consumer[Data consumer app] -->|GraphQL| OE[Orchestration Engine]
    OE -->|access decision| PDP[Policy Decision Point]
    OE -->|consent| CE[Consent Engine]
    OE -->|sub-queries| PR[Data providers]
    Citizen --> CP[Consent Portal]
    CP --> CE
    Operator[Operators and member staff] --> AP[Admin and Member Portals]
    AP --> PB[Portal Backend]
    CLI[ondx CLI] --> PB
    PB -->|policy metadata, allow-lists| PDP
    PB -->|application clients| IDP[ThunderID]
    CP -.->|sign in| IDP
    AP -.->|sign in| IDP
    CLI -.->|sign in| IDP
    Consumer -.->|client credentials| IDP
    CE -.->|verify tokens| IDP
    PB -.->|verify tokens| IDP
    OE -.->|audit events| AU[Argus audit service]
    PB -.->|audit events| AU

Each core service keeps its own PostgreSQL database. Detail for every component is in its README, linked below.

Component Role Port Docs
Orchestration Engine (OE) Federated GraphQL gateway for data requests 4000 cmd/oe
Policy Decision Point (PDP) Field-level policy metadata, application allow-lists, access decisions 8082 cmd/pdp
Consent Engine (CE) Consent lifecycle: request, approve, reject, expire, revoke 8081 cmd/ce
Portal Backend (PB) Management API for members, schemas, applications (to be renamed Management Server) 8083 cmd/pb
ondx CLI Operator command line for the Portal Backend n/a cmd/ondx
Consent Portal Citizen app to approve or revoke consent 5173 portals/apps/consent
Admin Portal Operator app: members and submission review (not in Compose) n/a portals/apps/admin
Member Portal Member staff app: schemas and applications (not in Compose) n/a portals/apps/member
ThunderID Identity provider bundled for local use 8090 thunderid/
Audit service Argus, optional audit log 3001 external
PostgreSQL Databases for the services above 5432 init-db.sql
Mock providers Sample data providers for local use 9090, 9091, 8080 dev/

Ports are the Docker Compose defaults, and each can be changed in .env.

How a data request flows
  1. A consumer gets a token from the identity provider and sends a GraphQL query to the Orchestration Engine.
  2. The Orchestration Engine asks the Policy Decision Point whether the consumer may read each field, and which fields need the data owner's consent.
  3. If consent is needed, the Consent Engine records a pending request. The consumer receives a consent link, the citizen approves it in the Consent Portal, and the consumer repeats the query.
  4. The Orchestration Engine fetches the data from the providers in parallel and returns the merged result.

Providers, schemas, applications and their access are set up beforehand through the Portal Backend, using the portals or ondx. Details: Orchestration Engine.

Quick start

You need Docker with Compose.

git clone https://github.com/openndx/openndx-core.git
cd openndx-core
docker compose up --build

This starts PostgreSQL, ThunderID, the Policy Decision Point, Consent Engine, Orchestration Engine, Portal Backend, the Consent Portal and the audit service. Every setting has a local default, so no .env is needed; to override any, copy .env.example to .env. The local secrets all default to 1234; never reuse them outside local development. The audit service is built from its GitHub source, so the first build needs network access.

The end-to-end walkthrough takes it from there: mock providers, registering members and schemas with ondx, granting an application access, citizen consent, and a query that returns data. The Admin and Member Portals are not in Compose; see their READMEs.

Working on the code

Install Go 1.26+, Node 24+ with pnpm (for the portals), Docker and Make, then:

make help                        # all commands
make setup-all                   # git hooks, Go modules, portal dependencies
make validate-test <service>     # tests
make quality-check <service>     # format, lint, security
make run <service>               # run one service

<service> is orchestration-engine, policy-decision-point, consent-engine, portal-backend, consent-portal, admin-portal or member-portal. Each component README has its own run, test and configuration details. .env.example lists every variable compose.yml reads.

To install the ondx CLI, see its README.

Documentation

Security and license

Report vulnerabilities as described in SECURITY.md, not in public issues. Licensed under the Apache License 2.0. Participation is governed by the Code of Conduct.

Directories

Path Synopsis
cmd
ce command
oe command
ondx command
Command ondx is a CLI for OpenNDX management operations against the Portal Backend.
Command ondx is a CLI for OpenNDX management operations against the Portal Backend.
pb command
pdp command
internal
authn
Package authn validates JWT access tokens and exposes the caller as a single principal.
Package authn validates JWT access tokens and exposes the caller as a single principal.
ce/config
Package config provides simplified configuration management
Package config provides simplified configuration management
cli/pbclient
Package pbclient is a minimal Portal Backend API client for CLI management commands.
Package pbclient is a minimal Portal Backend API client for CLI management commands.
cli/profile
Package profile manages named, reusable sets of ndx CLI flag defaults (identity provider issuer, client ID, scopes, callback port, Portal Backend URL, TLS verification) cached at ~/.openndx/config.json.
Package profile manages named, reusable sets of ndx CLI flag defaults (identity provider issuer, client ID, scopes, callback port, Portal Backend URL, TLS verification) cached at ~/.openndx/config.json.
config
Package config provides simplified configuration management
Package config provides simplified configuration management
database
Package database initializes shared PostgreSQL pools for SQL and GORM callers.
Package database initializes shared PostgreSQL pools for SQL and GORM callers.
oe/federator/operation
Package operation normalizes a validated consumer query into the fields the federator plans against: fragments merged, @skip and @include applied, fields grouped by response key, and each field bound to its schema definition and @sourceInfo.
Package operation normalizes a validated consumer query into the fields the federator plans against: fragments merged, @skip and @include applied, fields grouped by response key, and each field bound to its schema definition and @sourceInfo.
oe/federator/schema
Package schema supplies the consumer schema the federator plans queries against.
Package schema supplies the consumer schema the federator plans queries against.
pb/application
Package application is the Portal Backend's consumer application bounded context: applications, application submissions, their IdP clients and PDP allow-lists, and the application API.
Package application is the Portal Backend's consumer application bounded context: applications, application submissions, their IdP clients and PDP allow-lists, and the application API.
pb/caller
Package caller is the Portal Backend's view of who is calling: the OAuth2 scopes its routes require, the scopes and organization unit internal/authn validated, and the member that organization unit belongs to.
Package caller is the Portal Backend's view of who is calling: the OAuth2 scopes its routes require, the scopes and organization unit internal/authn validated, and the member that organization unit belongs to.
pb/caller/callertest
Package callertest provides authenticated test personas and request helpers for Portal Backend handler tests.
Package callertest provides authenticated test personas and request helpers for Portal Backend handler tests.
pb/database/dbtest
Package dbtest provides database fixtures for Portal Backend tests.
Package dbtest provides database fixtures for Portal Backend tests.
pb/idp/idptest
Package idptest provides a fake idp.IdentityProviderAPI for Portal Backend tests.
Package idptest provides a fake idp.IdentityProviderAPI for Portal Backend tests.
pb/idp/thunderid
Package thunderid implements idp.ApplicationManager against ThunderID's management API: Portal Backend creates each data-consumer application as an M2M client in its member's organization unit and grants it the data-consumer role.
Package thunderid implements idp.ApplicationManager against ThunderID's management API: Portal Backend creates each data-consumer application as an M2M client in its member's organization unit and grants it the data-consumer role.
pb/kernel
Package kernel holds the shared kernel of the Portal Backend: types used by more than one bounded context.
Package kernel holds the shared kernel of the Portal Backend: types used by more than one bounded context.
pb/member
Package member is the Portal Backend's member bounded context: member organizations, their link to the IdP, and the member API.
Package member is the Portal Backend's member bounded context: member organizations, their link to the IdP, and the member API.
pb/policy
Package policy is the Portal Backend's client for the Policy Decision Point (PDP).
Package policy is the Portal Backend's client for the Policy Decision Point (PDP).
pb/schema
Package schema is the Portal Backend's provider schema bounded context: schemas, schema submissions, their PDP policy metadata, and the schema API.
Package schema is the Portal Backend's provider schema bounded context: schemas, schema submissions, their PDP policy metadata, and the schema API.
pdp/config
Package config provides simplified configuration management
Package config provides simplified configuration management

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL