Skip to content

Developer guide

Data Prism is a privacy layer, not a data source: everything it protects comes from code an integrator writes and a reviewer signs off, plugged in through a small set of Java SPIs. This guide is that code's own documentation — what each extension point is for, and the order to learn them in. docs/extending.md stays the full reference for every detail below; this page is the map, not the manual.

If your source is a flat or shallow JSON REST API, you may not need to write any of this at all — see docs/protect-your-own-api.md for the YAML-only path first.

The extension points

The diagram below shows the reviewed-adapter path where a DataSourceAdapter and an IdentityResolver plug in: an application's own @AutoConfiguration registers a DataSourceAdapter bean, but an IdentityResolver can instead come from a dataprism.identity.resolver: pass-through setting with no code at all. (A YAML-configured JSON source is a separate path this diagram does not cover: it gets its DataSourceAdapter from ConfiguredJsonSourcesInitializer with no application code either, per docs/protect-your-own-api.md.) Either way, DataPrismAutoConfiguration refuses to start when either kind of bean is missing (outside fixture STDIO mode, where that check is skipped), and everything a DataSourceAdapter returns still passes through the privacy engine before anything downstream sees it.

How a reviewed DataSourceAdapter and an IdentityResolver plug in: an application's own @AutoConfiguration registers a DataSourceAdapter bean, an IdentityResolver can instead come from a pass-through configuration setting with no code, DataPrismAutoConfiguration's preflight and contract validation refuse to start when either bean is missing outside fixture STDIO mode, and the orchestrator's fan-out sends every fetched record on to the privacy engine's classification and scrubbing, with no path around it.

Where to start

  1. Write a data-source adapter — from an empty module to a pseudonymised MCP response, using DataSourceAdapter and the classification annotations.
  2. Write a custom identity resolver — how one subject is recognised across sources, how pass-through differs, and how to register a resolver of your own.

Both walk through a real, compiled, tested module in this repository (data-prism-quickstart-extension); every code block on those pages is pulled directly from it, not hand-copied.