Skip to content

Merge Thrift Services, Switch OpenJPA to Hibernate, Create Main Class to Launch Airavata#556

Closed
yasithdev wants to merge 25 commits intomasterfrom
merge-svcs
Closed

Merge Thrift Services, Switch OpenJPA to Hibernate, Create Main Class to Launch Airavata#556
yasithdev wants to merge 25 commits intomasterfrom
merge-svcs

Conversation

@yasithdev
Copy link
Copy Markdown
Contributor

@yasithdev yasithdev commented Aug 19, 2025

This PR merges all Airavata Thrift services into airavata-api, and adds a main launcher (org.apache.airavata.Main) that boots the API, recurring tasks, monitoring components, and state machines. Switched from OpenJPA+DBCP2 to Hibernate+HikariCP to simplify the dependencies, configuration, and maintenance of airavata services.

Key changes:

  • Consolidate all Thrift services (API, Profile, Sharing, Research, Agent, File, etc.) under airavata-api
  • Create a single launcher entrypoint (org.apache.airavata.Main) to start API, background schedulers, monitoring, and state machines
  • Switch from OpenJPA to Hibernate
  • Cleanup configurations in YAML/properties files
  • Update Python SDK for compatibility with the consolidated server
  • Update README and comments.
  • Update Credential Store Encryption from AES/CBC/PKCS5Padding to AES/GCM/NoPadding
  • Add Makefile with two entrypoints
    • make serve - builds airavata-api distribution and starts ./bin/airavata.sh
    • make serve-dev - compiles airavata-api and starts it using mvn exec:java

@yasithdev yasithdev changed the title Merge all thrift services + create a single launcher for all services Merge Thrift Services, Switch OpenJPA to Hibernate, Create Main Class to Launch Airavata Aug 25, 2025
@yasithdev
Copy link
Copy Markdown
Contributor Author

Closing — the core goals of this PR have been fully implemented in master through the server consolidation work:

Feature Superseding PR(s)
Consolidate all Thrift services under airavata-api #593, #594, #601
Single launcher entrypoint #593 (AiravataServer), #600 (Spring Boot @ConditionalOnServer)
OpenJPA → Hibernate #593 (initial), #600 (Spring-managed EMF), #601 (single EMF)
Unified configuration (YAML/properties) #600, #602 (application.yml consolidation)
Python SDK for multiplexed Thrift #593 (TMultiplexedProtocol on single port)
README/docs #593, #602 (architecture diagrams, deployment scripts)

Two items from this branch are not yet in master and will be extracted as separate PRs:

  1. Credential Store encryption upgrade (AES/CBC/PKCS5Padding → AES/GCM/NoPadding) — security improvement
  2. Root Makefile with make serve / make serve-dev — developer convenience

@yasithdev yasithdev closed this Mar 30, 2026
yasithdev added a commit that referenced this pull request Mar 30, 2026
Replace AES/CBC/PKCS5Padding with AES/GCM/NoPadding for credential
store encryption. The old code used a static zero IV which is insecure.
GCM provides authenticated encryption with random IVs prepended to
the ciphertext.

Extracted from #556.
yasithdev added a commit that referenced this pull request Mar 30, 2026
Extracted from #556. Provides convenience targets:
- make build: full Maven build (skip tests)
- make serve: build + run fat JAR
- make compile: fast compile only
- make serve-dev: compile + spring-boot:run (hot reload)
- make test: run test suite
yasithdev added a commit that referenced this pull request Mar 30, 2026
Extracted from #556. Provides convenience targets:
- make build: full Maven build (skip tests)
- make serve: build + run fat JAR
- make compile: fast compile only
- make serve-dev: compile + spring-boot:run (hot reload)
- make test: run test suite
yasithdev added a commit that referenced this pull request Mar 31, 2026
* security: upgrade credential encryption from AES/CBC to AES/GCM

Replace AES/CBC/PKCS5Padding with AES/GCM/NoPadding for credential
store encryption. The old code used a static zero IV which is insecure.
GCM provides authenticated encryption with random IVs prepended to
the ciphertext.

Extracted from #556.

* security: add legacy AES/CBC fallback for transparent migration

On decrypt, try GCM first. If the auth tag fails (AEADBadTagException),
fall back to the old AES/CBC/PKCS5Padding with static zero IV. This
allows existing credentials to be read without re-encryption.

Credentials will migrate to GCM format on next update/rotation —
writes always use AES/GCM.

* test: add unit tests for GCM/CBC encryption and legacy fallback

- testFallbackDecryptsLegacyCBC: CBC-encrypted data decrypted via fallback
- testFallbackDecryptsNewGCM: GCM-encrypted data decrypted via fallback
- testGcmDecryptRejectsLegacyData: GCM decrypt throws on CBC data

* security: remove fallback, add migration script instead

Replace transparent fallback with a one-time migration script
(MigrateCredentialEncryption) that re-encrypts all CREDENTIALS rows
from legacy AES/CBC to AES/GCM. Run before deploying the GCM-only code.

Usage:
  java MigrateCredentialEncryption <jdbcUrl> <dbUser> <dbPass> \
    <keystorePath> <keyAlias> <keystorePass>

The script skips rows already in GCM format.

* style: spotless:apply on MigrateCredentialEncryption

* Potential fix for code scanning alert no. 129: Use of a broken or risky cryptographic algorithm

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* fix: make decryptLegacy public for cross-package access from migration script

---------

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants