Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/scan_dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Scan Maven Dependencies

on:
push:
paths:
- '**/pom.xml'
- '.github/workflows/scan_dependencies.yml'
pull_request:
paths:
- '**/pom.xml'
workflow_dispatch:

jobs:
scan-pom-vulnerabilities:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up JDK 25
uses: actions/setup-java@v3
with:
java-version: '25'
distribution: 'temurin'
cache: 'maven'

- name: Pre-download Maven dependencies
run: mvn dependency:go-offline -B
continue-on-error: true # Even if go-offline fails partially, the cache is populated enough for Trivy

- name: Run Trivy vulnerability scanner on filesystem
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs' # Scan local filesystem instead of docker image
scan-ref: '.' # Scan the entire repository for pom.xml files
format: 'table' # Output results in table format
exit-code: '0' # Do not fail the workflow, just log vulnerabilities
ignore-unfixed: true # Ignore vulnerabilities without a fix
vuln-type: 'library' # Scan third-party libraries only
severity: 'CRITICAL,HIGH' # Focus on critical and high severity vulnerabilities
2 changes: 0 additions & 2 deletions development/docker/docker-compose.override.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.8"

services:
obp-api:
volumes:
Expand Down
28 changes: 20 additions & 8 deletions development/docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.8"

services:
redis:
container_name: obp-api-redis
Expand All @@ -23,30 +21,44 @@ services:
# Set Lift props location to find your props files
- props.resource.dir=/app/props/
- JAVA_OPTS=-Drun.mode=production -Dprops.resource.dir=/app/props/
- OBP_BIND_ADDRESS=0.0.0.0
- OBP_DEV_PORT=8080
# Override Redis settings via environment variables (OBP-API system)
# cache.redis.url -> OBP_CACHE_REDIS_URL
# cache.redis.port -> OBP_CACHE_REDIS_PORT
- OBP_CACHE_REDIS_URL=redis
- OBP_CACHE_REDIS_PORT=6379
# Override database URL via environment variable (OBP-API system)
# db.url -> OBP_DB_URL
- OBP_DB_URL=${OBP_DB_URL:-jdbc:postgresql://host.docker.internal:5432/obp_mapped?user=obp&password=f}
- OBP_DB_URL=${OBP_DB_URL:-jdbc:postgresql://postgres:5432/obp_mapped?user=obp&password=f}
volumes:
# Mount the props directory so the container uses your local props files
- ../../obp-api/src/main/resources/props:/app/props
extra_hosts:
# Connect to local Postgres on the host
# In your config file:
# db.url=jdbc:postgresql://host.docker.internal:5432/YOUR_DB?user=YOUR_DB_USER&password=YOUR_DB_PASSWORD
- "host.docker.internal:host-gateway"
depends_on:
- redis
- postgres
networks:
- obp-network

postgres:
container_name: obp-api-db
image: postgres:15-alpine
environment:
POSTGRES_DB: obp_mapped
POSTGRES_USER: obp
POSTGRES_PASSWORD: f
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- obp-network

volumes:
redis_data:
name: obp-api-redis-data
postgres_data:
name: obp-api-db-data

networks:
obp-network:
Expand Down
4 changes: 2 additions & 2 deletions development/docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash
set -e

export MAVEN_OPTS="-Xss128m \
export JAVA_OPTS="-Xss128m \
--add-opens=java.base/java.util.jar=ALL-UNNAMED \
--add-opens=java.base/java.lang=ALL-UNNAMED \
--add-opens=java.base/java.lang.reflect=ALL-UNNAMED"

exec java $MAVEN_OPTS -jar /app/obp-api.jar
exec java $JAVA_OPTS -jar /app/obp-api/target/obp-api.jar
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import code.api.ResourceDocs1_4_0.SwaggerDefinitionsJSON.{NotSupportedYet, notSu
//import code.api.STET.v1_4.OBP_STET_1_4
import code.api.UKOpenBanking.v2_0_0.OBP_UKOpenBanking_200
import code.api.UKOpenBanking.v3_1_0.OBP_UKOpenBanking_310
import code.api.UKOpenBanking.v4_0_1.OBP_UKOpenBanking_401
import code.api.berlin.group.v1_3.{OBP_BERLIN_GROUP_1_3, OBP_BERLIN_GROUP_1_3_Alias}
import code.api.v1_4_0.JSONFactory1_4_0
import com.openbankproject.commons.model.JsonFieldReName
Expand Down Expand Up @@ -336,6 +337,7 @@ object SwaggerJSONFactory extends MdcLoggable {
// Commented out: STET / Polish / AUOpenBanking Lift endpoints removed
if (apiVersion == OBP_UKOpenBanking_200.apiVersion
|| OBP_UKOpenBanking_310.apiVersion == OBP_UKOpenBanking_200.apiVersion
|| apiVersion == OBP_UKOpenBanking_401.apiVersion
) s"custom, proprietary license: personal use is allowed and free, modifications or re-publishing is not allowed"
else if (apiVersion == OBP_BERLIN_GROUP_1_3.apiVersion
|| apiVersion == OBP_BERLIN_GROUP_1_3_Alias.apiVersion
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package code.api.UKOpenBanking.v4_0_1

import cats.data.{Kleisli, OptionT}
import cats.effect._
import code.api.util.APIUtil.ResourceDoc
import code.api.util.http4s.ResourceDocMiddleware
import code.util.Helper.MdcLoggable
import com.openbankproject.commons.util.ApiVersion
import org.http4s._

import scala.collection.mutable.ArrayBuffer

/**
* UK Open Banking Read/Write v4.0.1 — http4s aggregator (mirror of Http4sUKOBv310).
*
* Collects resource docs and routes from every per-sub-API endpoint object,
* wraps the combined routes once with ResourceDocMiddleware (which builds the
* CallContext via anonymousAccess for these non-/obp paths), and exposes
* `wrappedRoutes` for wiring into Http4sApp.baseServices.
*
* Coverage: all 6 v4.0.1 sub-APIs (account-info / payment-initiation /
* confirmation-funds / event-notifications / events / vrp), ~89 endpoints.
* Spec-faithful scaffold — routes return synthesized OpenAPI example JSON; deepen
* to real OBP connector logic per endpoint later.
*/
object Http4sUKOBv401 extends MdcLoggable {

type HttpF[A] = OptionT[IO, A]

val implementedInApiVersion: ApiVersion = ApiVersion.ukOpenBankingV401

val resourceDocs: ArrayBuffer[ResourceDoc] =
Http4sUKOBv401AccountInfo.resourceDocs ++
Http4sUKOBv401PaymentInitiation.resourceDocs ++
Http4sUKOBv401ConfirmationFunds.resourceDocs ++
Http4sUKOBv401EventNotifications.resourceDocs ++
Http4sUKOBv401Events.resourceDocs ++
Http4sUKOBv401Vrp.resourceDocs

val allRoutes: HttpRoutes[IO] = Kleisli[HttpF, Request[IO], Response[IO]] { req =>
Http4sUKOBv401AccountInfo.routes(req)
.orElse(Http4sUKOBv401PaymentInitiation.routes(req))
.orElse(Http4sUKOBv401ConfirmationFunds.routes(req))
.orElse(Http4sUKOBv401EventNotifications.routes(req))
.orElse(Http4sUKOBv401Events.routes(req))
.orElse(Http4sUKOBv401Vrp.routes(req))
}

val wrappedRoutes: HttpRoutes[IO] = ResourceDocMiddleware.apply(resourceDocs)(allRoutes)
}
Loading
Loading