Skip to content

Commit fc2594c

Browse files
committed
Merge remote-tracking branch 'Simon/develop' into develop-Simon
# Conflicts: # .gitignore
2 parents ef29df7 + 02989dc commit fc2594c

File tree

8 files changed

+5903
-28
lines changed

8 files changed

+5903
-28
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
.project
1616
.cache
1717
target
18-
obp-api/src/main/resources/
18+
obp-api/src/main/resources/*
19+
!obp-api/src/main/resources/docs/
1920
obp-api/src/test/resources/**
2021
!obp-api/src/test/resources/frozen_type_meta_data
2122
*.iml

obp-api/pom.xml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -638,28 +638,22 @@
638638
</execution>
639639
</executions>
640640
</plugin>
641+
641642
<plugin>
642643
<groupId>org.eclipse.jetty</groupId>
643644
<artifactId>jetty-maven-plugin</artifactId>
644645
<version>${jetty.version}</version>
645646
<configuration>
646647
<contextPath>/</contextPath>
647648
<scanIntervalSeconds>5</scanIntervalSeconds>
648-
<httpConnector>
649-
<port>8080</port>
650-
</httpConnector>
651-
<systemProperties>
652-
<systemProperty>
653-
<name>org.eclipse.jetty.server.HttpConfiguration.requestHeaderSize</name>
654-
<value>32768</value>
655-
</systemProperty>
656-
<systemProperty>
657-
<name>org.eclipse.jetty.server.HttpConfiguration.responseHeaderSize</name>
658-
<value>32768</value>
659-
</systemProperty>
660-
</systemProperties>
649+
<port>8080</port>
650+
651+
<!-- Jetty 9.4 plugin settings for max header size -->
652+
<requestHeaderSize>32768</requestHeaderSize>
653+
<responseHeaderSize>32768</responseHeaderSize>
661654
</configuration>
662655
</plugin>
656+
663657
<plugin>
664658
<groupId>org.apache.maven.plugins</groupId>
665659
<artifactId>maven-idea-plugin</artifactId>
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
OBP Documentation PDF Generation - Font Technical Note
2+
=======================================================
3+
4+
FONT ISSUE: Plus Jakarta Sans Variable Font Incompatibility with XeLaTeX
5+
6+
The Open Bank Project brand guidelines specify Plus Jakarta Sans as the official font.
7+
However, this font cannot be used in the current PDF generation pipeline due to a
8+
technical incompatibility between variable font formats and XeLaTeX/xdvipdfmx.
9+
10+
TECHNICAL ROOT CAUSE:
11+
12+
The Plus Jakarta Sans fonts available from Google Fonts are provided as variable fonts
13+
(.ttf files with weight axis [wght]). When XeLaTeX attempts to resolve font variants
14+
(specifically Bold and BoldItalic), it fails with:
15+
16+
Error: "xdvipdfmx:fatal: Invalid font: -1 (0)"
17+
18+
This occurs because:
19+
1. Variable fonts store multiple weights in a single file using OpenType variation tables
20+
2. XeLaTeX's font resolver (fontspec package) attempts to find discrete font files for
21+
Bold (/B), Italic (/I), and BoldItalic (/BI) variants
22+
3. The variable font doesn't expose these as separate font instances
23+
4. xdvipdfmx (the backend that converts XeTeX's XDV to PDF) cannot map the font ID (-1)
24+
25+
ATTEMPTED SOLUTIONS (All Failed):
26+
27+
1. Using variable fonts with explicit paths and FakeBold features - syntax errors
28+
2. Installing static font variants - these don't exist in Google Fonts repository
29+
3. Font name resolution via fc-list - system finds font but XeLaTeX cannot load variants
30+
4. Explicit fontspec configuration with BoldFont/ItalicFont parameters - path resolution failures
31+
32+
CURRENT SOLUTION:
33+
34+
DejaVu Sans is used as a reliable alternative because:
35+
- It's a standard PostScript/TrueType font with discrete weight files
36+
- Pre-installed on most Linux systems
37+
- Full XeLaTeX compatibility
38+
- All OBP brand colors (#1BA563, #0A281E, #5F8E82) are correctly implemented
39+
40+
FUTURE RESOLUTION OPTIONS:
41+
42+
- Upgrade to TeX Live 2023+ with improved variable font support
43+
- Switch to LuaLaTeX engine (better variable font handling)
44+
- Convert variable fonts to static instances using fonttools
45+
- Use HTML/CSS to PDF tools (wkhtmltopdf, weasyprint) that handle variable fonts natively
46+
47+
For questions, contact: TESOBE GmbH Development Team
Lines changed: 217 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,217 @@
1+
# Open Bank Project — Brief Documentation
2+
3+
_System Architecture, Workflows, Security, and API Reference_
4+
5+
---
6+
7+
## 1) System Architecture Description
8+
9+
**High‑level components**
10+
11+
- **OBP‑API** (Scala): core REST API supporting multiple versions (v1–v5), pluggable data connectors, views/entitlements, payments, metadata, KYC, etc.
12+
- **API Explorer / API Explorer II**: interactive Swagger/OpenAPI front‑ends for testing and discovery.
13+
- **API Manager** (Django): manage consumers, roles, metrics, and selected resources.
14+
- **Connectors**: northbound to OBP APIs; southbound to data sources (core banking, caches). Kafka/RabbitMQ and Akka remote supported for decoupling and scale.
15+
- **Consent & OAuth helpers**: example apps (e.g., OBP‑Hola) to demonstrate OAuth2/OIDC, consents, mTLS/JWS profiles.
16+
- **Persistence**: PostgreSQL (production), H2 (dev); optional caches.
17+
- **Runtime options**: Jetty (war), Docker, Kubernetes.
18+
19+
**Reference deployment views**
20+
21+
- _Monolith + DB_: OBP‑API on Jetty/Tomcat with PostgreSQL.
22+
- _Containerised_: OBP‑API image + Postgres; optional API Explorer/Manager containers.
23+
- _Kubernetes_: OBP‑API Deployment + Service, Postgres Stateful workload, optional Ingress & secrets, externalized config.
24+
- _Decoupled storage_: OBP‑API (stateless) + Akka Remote storage node with DB access; optional Kafka/RabbitMQ between API and core adapters.
25+
26+
**Key integration points**
27+
28+
- **AuthN/AuthZ**: OAuth 1.0a (legacy), OAuth 2.0, OIDC, DirectLogin; role‑based entitlements; fine‑grained _Views_ for account/transaction level access; Consents for OB/PSD2 style access.
29+
- **Standards**: UK OB, Berlin Group, Bahrain OBF mapping via endpoints/consents; JWS signatures, mTLS where required.
30+
31+
---
32+
33+
## 2) Core Workflows (step‑by‑step)
34+
35+
### A. Developer onboarding & first call
36+
37+
1. Register user in sandbox / local.
38+
2. Create application → obtain consumer key.
39+
3. Choose auth method (DirectLogin for dev, OAuth2/OIDC for production patterns).
40+
4. Call `/obp/vX.X.X/root` to confirm version & status; explore endpoints in API Explorer.
41+
42+
### B. Entitlements (roles) & access
43+
44+
1. Admin (or super user during bootstrap) grants roles via `add entitlement` endpoints.
45+
2. Typical roles: `CanCreateEntitlementAtAnyBank`, `CanCreateSandbox`, bank‑scoped operational roles, etc.
46+
3. Apps consume bank/system resources according to entitlements.
47+
48+
### C. Views (fine‑grained account access)
49+
50+
1. Account owner uses default `owner` view.
51+
2. Create custom views (e.g., `accountants`, `auditors`, `tagging-application`).
52+
3. Grant/revoke a user’s access to a view; client calls read endpoints with a specific view.
53+
54+
### D. OAuth2/OIDC + Consent (OB/PSD2 style)
55+
56+
1. TPP/Client registers (with certs if mTLS is used).
57+
2. User authN via authorisation server; client requests consent (scopes/accounts/permissions).
58+
3. Consent resource & access token are returned (optionally JWS‑signed, certificate‑bound).
59+
4. Client calls accounts/balances/transactions/payments with proof (mTLS/JWS), consent id, and token.
60+
61+
### E. Transaction Requests (PIS)
62+
63+
1. Create payment request with account + amount + creditor.
64+
2. Strong customer authentication (SCA) if required.
65+
3. Execute/submit and poll status.
66+
67+
---
68+
69+
## 3) Diagrams (text sketches)
70+
71+
**High-Level System Architecture**
72+
73+
See the detailed architecture diagram in [introductory_system_documentation.md](introductory_system_documentation.md#21-high-level-architecture) (Section 2.1).
74+
75+
**Views & Entitlements**
76+
77+
```
78+
User ──(has roles/entitlements)──► Bank/System actions
79+
80+
└─(granted view)──► Account/Transaction subset (e.g., accountants)
81+
```
82+
83+
---
84+
85+
## 4) Component Logic
86+
87+
- **Views**: declarative access lists (what fields/transactions are visible, what actions permitted) bound to an account. Grants are user↔view.
88+
- **Entitlements**: role assignments at _system_ or _bank_ scope; govern management operations (create banks, grant roles, etc.).
89+
- **Connectors**: adapter pattern; map OBP domain to underlying core data sources. Kafka/RabbitMQ optional for async decoupling; Akka Remote to separate API and DB hosts.
90+
- **Security**: OAuth2/OIDC (with JWKS), optional mTLS + certificate‑bound tokens; JWS for request/response signing as required by OB/FAPI profiles.
91+
92+
---
93+
94+
## 5) Installation, Configuration & Updates
95+
96+
### Option A — Quick local & development (IntelliJ / `mvn`)
97+
98+
- Clone `OBP-API` → open in IntelliJ (Scala/Java toolchain).
99+
- Create `default.props` (dev) and choose connector (`mapped` for demo) and DB (H2 or Postgres).
100+
- `mvn package` → produce `.war`; run with Jetty or use IntelliJ runner.
101+
102+
### Option B — Docker (recommended for evaluation)
103+
104+
- Pull `openbankproject/obp-api` image.
105+
- Provide config via env vars: prefix `OBP_`, replace `.` with `_`, uppercase (e.g., `openid_connect.enabled=true``OBP_OPENID_CONNECT_ENABLED=true`).
106+
- Wire Postgres; expose 8080.
107+
108+
### Option C — Kubernetes
109+
110+
- Apply manifest (`Deployment`, `Service`, `ConfigMap`/`Secret` for props, `StatefulSet` for Postgres, optional `Ingress`).
111+
- Externalise DB creds, JWT/keystore, and OAuth endpoints; configure probes.
112+
113+
### Databases
114+
115+
- **Dev**: H2 (enable web console if needed).
116+
- **Prod**: PostgreSQL recommended; set SSL if required; grant schema/table privileges.\
117+
Any JDBC-compliant DB is supported (e.g. MS SQL, Oracle DB, etc.)
118+
119+
### Updating
120+
121+
- Track OBP‑API tags/releases; OBP supports multiple API versions simultaneously. For minor updates, roll forward container with readiness checks; for major schema changes, follow release notes and backup DB.
122+
123+
---
124+
125+
## 6) Access Control & Security Mechanisms
126+
127+
- **Authentication**: OAuth 1.0a (legacy), OAuth 2.0, OIDC, DirectLogin (automation/dev only).
128+
- **Authorisation**: Role‑based **Entitlements** (system/bank scope) + account‑level **Views**.
129+
- **Consents**: OB/PSD2 style consent objects with permissions/scopes, linked to tokens.
130+
- **Crypto**: JWS request/response signing where profiles demand; JWKS for key discovery.
131+
- **mTLS / PoP**: Certificate‑bound tokens for higher assurance profiles (FAPI/UK OB), TLS client auth at gateway.
132+
- **Secrets**: JKS keystores for SSL and encrypted props values.
133+
134+
---
135+
136+
## 7) Monitoring, Logging & Troubleshooting
137+
138+
**Logging**
139+
140+
- Copy `logback.xml.example` to `logback.xml`; adjust levels (TRACE/DEBUG/INFO) per environment.
141+
- In Docker/K8s, logs go to stdout/stderr → aggregate with your stack (e.g., Loki/Promtail, EFK).
142+
143+
**Health & metrics**
144+
145+
- K8s liveness/readiness probes on OBP‑API root/version or lightweight GET; external synthetic checks via API Explorer smoke tests.
146+
147+
**Troubleshooting checklist**
148+
149+
- **Auth failures**: verify JWKS URL reachability, clock skew, audience/scope, mTLS cert chain.
150+
- **Permissions**: confirm entitlements vs. views; bootstrap `super_admin_user_ids` only for initial admin then remove.
151+
- **DB issues**: check Postgres grants; enable SSL and import server cert into JVM truststore if needed.
152+
- **Connector errors**: raise logging for connector package; verify message bus (Kafka/RabbitMQ) SSL settings if enabled.
153+
154+
---
155+
156+
## 8) Service Documentation (operators’ quick sheet)
157+
158+
**Day‑1**
159+
160+
- Provision Postgres; create db/user; load props via Secret/ConfigMap; start OBP‑API.
161+
- Create first admin: set `super_admin_user_ids`, login, grant `CanCreateEntitlementAtAnyBank`, then remove bootstrap prop.
162+
163+
**Day‑2**
164+
165+
- Rotate keys (JKS) and tokens; manage roles & views via API Manager; enable audit trails.
166+
- Backups: nightly Postgres dump + config snapshot; test restore monthly.
167+
- Upgrades: blue/green or rolling on K8s; verify `/root` endpoints across versions.
168+
169+
**Incident runbook (snippets)**
170+
171+
- Increase log level via `logback.xml` reload or environment toggle; capture thread dumps.
172+
- Check API error payloads for `error_code` and `bank_id` context; correlate with gateway logs.
173+
- For SSL issues to DB or brokers, use `SSLPoke` and `openssl s_client` to diagnose.
174+
175+
---
176+
177+
## 9) Quick Commands & Config Snippets
178+
179+
```bash
180+
docker run -p 8080:8080 \
181+
-e OBP_DB_DRIVER=org.postgresql.Driver \
182+
-e OBP_DB_URL='jdbc:postgresql://db:5432/obpdb?user=obp&password=******&ssl=true' \
183+
-e OBP_OPENID_CONNECT_ENABLED=true \
184+
openbankproject/obp-api:latest
185+
```
186+
187+
```bash
188+
kubectl apply -f obpapi_k8s.yaml # Deployment, Service, Postgres PVC
189+
```
190+
191+
```properties
192+
JAVA_OPTIONS="-Drun.mode=production -Xmx768m -Dobp.resource.dir=$JETTY_HOME/resources -Dprops.resource.dir=$JETTY_HOME/resources"
193+
```
194+
195+
```sql
196+
GRANT USAGE, CREATE ON SCHEMA public TO obp_user;
197+
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO oobp_userbp;
198+
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO obobp_userp;
199+
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON TABLES TO obp_user;
200+
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON SEQUENCES TO obp_user;
201+
```
202+
203+
---
204+
205+
## 10) Pointers to Further Docs (by topic)
206+
207+
- API Explorer & endpoints (roles, views, consents)
208+
- OBP‑API README (install, DB, Jetty, logging, production options)
209+
- API Manager (roles/metrics)
210+
- OBP‑Hola (OAuth2/mTLS/JWS consent flows)
211+
- Docker images & tags
212+
- K8s quickstart manifests
213+
- ReadTheDocs guide (auth methods, connectors, concepts)
214+
215+
---
216+
217+
© TESOBE GmbH 2025 AGPL V3

0 commit comments

Comments
 (0)