How openbankproject/obp-api works
This project is the Open Bank Project API – an open‐source banking API that serves as an abstraction layer over several core banking systems. Its purpose is to provide secure, extensible, and versioned web services for banks, empowering account holders and third-party applications to interact with banking data. The API supports multiple authentication protocols (OAuth 1.0a, OAuth2, OpenID Connect, Direct Login), extensive rate limiting, webhooks, sandbox data import, and even integration with asynchronous messaging systems (such as RabbitMQ and possibly Kafka) for bank connector communications.
Main components
• API Service Layer (obp-api): This is where most of the business logic resides. It hosts multiple API versions – organized by directories with version numbers (e.g. v1_2, v1_3_0, v2_0_0, v3_0_0, … up to v5_1_0). Each version implements specific REST endpoints for banking functionality.
• Common and Shared Libraries (obp-commons): Contains common models, DTOs, utility functions, helper classes, and shared enumerations used across the API.
• Connector Modules (inside obp-api and obp-commons): They abstract the integration with various core banking systems. There are multiple “bankconnectors” implementations (e.g. local mappers, REST connectors, stored procedure connectors, dynamic connectors, and even actor system based ones using Akka) that encapsulate the communication layer.
• Authentication & Authorization Component: Implements multiple authentication workflows – including OAuth1.0a, OAuth2, OpenID Connect, and Direct Login. It also contains modules for token management, certificate verification, and super admin user configuration.
• Data Persistence and Database Access: The system uses relational databases (PostgreSQL, MS SQL, H2) for storing banking, customer, and transaction data. There are dedicated data access objects and migration scripts (in the “obp-api/src/main/scripts/migrate” and “obp-api/src/main/scripts/sql” directories) that handle schema creation and updates.
• Caching and Rate Limiting Modules: Incorporates in-memory or Redis-based caching (files under obp-api/src/main/scala/code/api/cache) and implements call limits for API consumers.
• Web Portal and Front-End Assets: The project also hosts a web portal (via Lift Web and Jetty, with files in “src/main/webapp”) for API explorers, user interfaces, and static pages (e.g., FAQ, privacy policy).
• Build and Deployment: Managed with Maven and Docker. The top-level files such as Dockerfile, .dockerignore, and GitHub workflows show the project’s CI/CD and containerization practices.
• Testing: There is an extensive test suite that spans unit tests, integration tests, and even specialized tests for “frozen” APIs and connectors. The test directories (obp-api/src/test/scala) clearly map to various system components.
Relationships and interactions
• The API Service Layer acts as the gateway that receives REST requests; it routes these requests (often versioned) into business logic that in turn uses the shared OBP commons modules.
• Authentication modules are invoked at the entry point to validate credentials (via OAuth, Direct Login, OIDC) and manage session tokens.
• Once authenticated, requests trigger calls to either the bank connector modules or direct database operations (via data access objects). The connector modules handle the integration with external banking systems and sometimes use asynchronous communication (via Akka or RabbitMQ) for decoupled operation.
• Caching and rate limiting modules intercede to ensure that both security and performance guidelines are met.
• The web portal component directly interacts with end users (or even third-party API explorers) to deliver documentation and sandbox interfaces.
• Testing and build pipelines leverage Maven and Docker to compile, run tests, and deploy the API on Jetty or as a standalone web server.
Important architectural patterns and design principles
• Modularization and separation of concerns: the code is clearly segmented into modules that handle API endpoints (of different versions), utility functions, connectors, data access, authentication, caching, and web UI.
• Versioned API design: Multiple API versions coexist allowing for backward compatibility and gradual enhancement.
• Use of microservice/multi-module patterns: While it is a monolithic repository, the structure aligns with separating components as if they were microservices (e.g., authentication, banking core integration, API gateway).
• Asynchronous communication: There is evidence of actor systems (via Akka) and messaging (RabbitMQ) to handle concurrency and decoupled integration.
• Extensive testing and “frozen” API metadata usage to preserve stable interfaces.