Capability-based access control banking simulator in Java — sealed class hierarchy, package-private capability forgery prevention, PECS-correct AccessResult<T> monad, and a 12-section security penetration test suite validating the full scope-role matrix via reflection.
| .gitattributes | |
| .gitignore | |
| README.md | |
| pom.xml | |
| src |
A fintech-themed role-based access control (RBAC) system built in Java 21 with a JavaFX GUI. The project explores capability-based security, sealed type hierarchies, generic result types, and file-backed persistence — all centred around a multi-role banking domain.
Monolith simulates a neobank platform where four distinct roles (Customer, Support Staff, Manager, Admin) interact with two resource types (Accounts and Documents) across five access scopes (Public, Internal, Confidential, Private, System). Every access decision flows through a single policy engine. No role can bypass the access gate — it is structural, not optional.
The name _Monolith_ is a play on monolithic architecture — a deliberate design choice to keep all security logic in one place before it scales.
src/main/java/uk/ac/gre/monolith/ ├── core/ │ ├── models/ # User, Account, Resource, Role, AccessScope, SecureResource │ ├── factories/ # UserFactory, AccountFactory, ResourceFactory (token-gated) │ ├── AccessPolicy # Sole policy engine — all access decisions delegate here │ ├── AccessResult # Sealed generic result type (Allowed / Denied) with map/flatMap │ ├── Capability # Generic token type (Read / Write sealed hierarchy) │ ├── ResourceRegistry # Type-safe runtime resource store │ └── SystemWideLogger # Structured Logback wrapper ├── services/ │ ├── AuthService # SHA-256 login, registration, startup user index │ ├── PersistenceService # Async queue, JSON serialisation to data/ │ ├── ResourceLoaderService # Startup resource hydration from data/ │ ├── SeedService # Idempotent demo data seeder │ └── ServiceManager # Singleton lifecycle manager ├── controllers/ # MVC controllers (Landing, Login, Register, Dashboard, ResourceDetail) ├── views/ # JavaFX scenes (matching controllers above) ├── benchmarks/ # JMH throughput and allocation benchmarks ├── Launcher # JavaFX entry point └── Main # Application bootstrapper
| Role | PUBLIC | INTERNAL | CONFIDENTIAL | PRIVATE | SYSTEM | |---------------|--------|----------|--------------|---------------|--------| | Customer | R | — | — | R/W (own) | — | | Support Staff | R | R | — | R/W (own) | — | | Manager | R | R | R | R/W (own) | — | | Admin | R/W | R/W | R/W | R/W | R/W |
Write access for non-admin roles is always restricted to owned resources. Accounts are hardcoded to PRIVATE scope.
mvn compile
mvn javafx:run
mvn spotless:apply