Security and operational acceptance
What you will learn
Acceptance combines functional, security and operational evidence. A successful response is not enough: inspect tenant denial, rejected mutation, bounded resources, and whether a deployment can be diagnosed and safely recovered.
- Test denied access without revealing resource state.
- Define bounded health and telemetry behavior.
- Interpret a limited local performance study honestly.
Plain Java 21: save each example as Main.java in a fresh directory, compile with javac --release 21 Main.java, then run java Main. Trusted local fixtures only. No network or third-party dependency is needed.
Check ownership before lookup
public class Main { static boolean allowed(String principal,String owner){return principal!=null && principal.equals(owner);} public static void main(String[] args) throws Exception { System.out.println(allowed("alpha","alpha")); System.out.println(allowed("beta","alpha")); }}Expected output:
truefalseA principal may access only the matching resource owner; real principal verification is separate.
Security review
Trust boundaries are HTTP client → authenticated principal → service → tenant-qualified storage. Validate exact route, method, media type, bounded body and identifiers; derive tenant from verified identity. Deny missing or invalid credentials, prevent cross-tenant access, avoid raw payload and token logging, use parameterized SQL, minimal database roles and encrypted transport in production. The offline tokens are explicitly not a security implementation for deployment. No real secrets, external destination or scan is required.
Operational acceptance
Keep health response small, use separate readiness and liveness for real orchestration, expose no sensitive management endpoints. Use bounded counters for request outcomes; do not tag by tenant or command ID. The local HTTP adapter binds loopback, uses a fixed worker pool and bounded queue, and shuts down its owned executor. Overload semantics and production observability must be separately tested. The Spring staging path exposes only health, with management bound to loopback in the local profile; production probe layout must be designed explicitly.
Performance study and recovery
The companion verifier makes a finite set of sequential loopback reads after warmup and retains measured milliseconds, with no external traffic. It records sample count, median and range, not a production SLO or capacity guarantee. For failure recovery, test an ambiguous client response by repeating the same command key; local restart loses all state. Durable recovery requires a tested database restore, recovery objectives and replay behavior. No latency threshold is manufactured.
Keep outcome dimensions finite
public class Main { static String label(int status){return status==200?"ok":status==409?"conflict":"other";} public static void main(String[] args) throws Exception { System.out.println(label(200)); System.out.println(label(409)); }}Expected output:
okconflictLabels do not contain raw URLs, identifiers or tokens.
Calculate a synthetic successful fraction
public class Main { public static void main(String[] args) throws Exception { System.out.println(98/100.0); }}Expected output:
0.98Fictional 98 good requests out of 100; actual local timings are separately recorded.
Common mistakes
Do not deploy the local demo credentials, expose debug endpoints or interpret a sample of successful reads as security certification or production capacity.
Practice
Implement the owner predicate. Print false for missing principal, true for same tenant and false for another tenant.
Expected output:
falsetruefalseCompare with the manual review criteria.
Further reading: Security · Operations. Independent editorial review remains pending.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Security and operational acceptance — knowledge check
Java enterprise capstone reasoning.
What is the trusted tenant source?
What should a metric label avoid?
What does a local loopback timing study prove?
Why test denied mutations?
What must a durable recovery exercise prove?