nsprism is the home of a family of small, sharp, zero-dependency frameworks for the JVM. Each package does one enterprise job — starting with security — and does it without dragging a dependency tree behind it.
// pick the concern, keep the API
NS.use(NSOp.LOG, LOGIN_SCHEMA, event); // masked log line
NS.use(NSOp.GENERATE, ORDER_CREATE, order); // fill id fields
NS.use(NSOp.CRYPTO, CUSTOMER_W, record); // encrypt fields
String id = NS.use(NSOp.ID); // one ULID
// same call, more engines
NS.use(NSOp.VALIDATE, CREATE, body);
NS.use(NSOp.FLAG, NEW_CHECKOUT, userId);
NS.use(NSOp.TOKEN, ACCESS, bearer);
NSEvery nsprism artifact ships from io.github.nsprism on Maven Central.
Add a module to the classpath and its providers are discovered automatically — no wiring, no XML, no magic annotations.
Every nsprism package follows the same contract, so learning one teaches you all of them.
Core artifacts ship with no third-party runtime dependencies — even JSON is parsed internally. Your dependency tree stays auditable.
Implementations register via java.util.ServiceLoader.
Adding a jar adds a capability; removing it removes the capability. Nothing else to configure.
Policy lives in versioned JSON resources, validated and compiled at class-initialisation — so a bad rule fails at startup, not at 3 AM in production.
Anything you forgot to classify is suppressed, never leaked. Safety is the default posture, and relaxing it is always an explicit, visible choice.
Eight schema-driven engines behind a single NS facade, all shipped
in one release. Masking logging, field-level
crypto, unique ids, input validation,
output sanitising, feature flags, signed tokens
and a common toolbox — all reached the same way:
NS.use(op, schema, data). Add an engine jar and the capability appears;
your call sites never change.
NS.use(op, schema, data) — the op plus the schema's declared type routes to the right engine, discovered by ServiceLoader.
Unclassified log fields are suppressed, unlisted token claims rejected, unknown config refused — what you didn't declare can't leak or sneak in.
Rules compile at startup — a bad schema fails fast — and can be hot-swapped at runtime without a restart.
// every engine, one call shape
NS.use(NSOp.LOG, LOGIN, event); // masked log line
NS.use(NSOp.GENERATE, ORDER, record); // fill empty id fields
NS.use(NSOp.CRYPTO, CUSTOMER_W, row); // field-level encrypt
NS.use(NSOp.VERIFY, attempt, storedHash); // constant-time
// same shape
NS.use(NSOp.VALIDATE, CREATE, body);
NS.use(NSOp.SANITIZE, EXPORT, row);
NS.use(NSOp.FLAG, NEW_CHECKOUT, userId);
NS.use(NSOp.TOKEN, ACCESS, bearer);
NS.use(NSOp.COMMON, TRUNCATE, text);
// the log engine's view of that event:
// "userId":"#3f9c…" "email":"j•••e@acme.com"
// "sessionToken":"[REDACTED]" password → suppressed
Add one Maven coordinate. The classpath does the rest.