feat: optional object datastore
This is linked to the issue 1162 to support addition object storage in CREDEBL.
- Created new storage service library which supports two providers
- Implemented for minio and refactored for aws S3.
Other improvements -
- Fixed lint issues in existing code - duplicate & unused common constants, unused imports.
Quality Gate passed
Issues
11 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
@coderabbitai review
✅ Actions performed
Review triggered.
Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
Walkthrough
Introduces a new storage abstraction (@credebl/storage) supporting MinIO and S3, replaces AwsService across apps, updates environment variables for storage and branding, removes libs/aws, adjusts several modules and services to use StorageService, changes connection invitation retrieval (first vs many), tweaks agent health endpoint, and refactors provisioning scripts.
Changes
| Cohort / File(s) | Summary |
|---|---|
Environment config.env.demo |
Add MinIO and FILE_STORAGE_PROVIDER vars; rename buckets; remove SHORTENED_URL_DOMAIN; update POWERED_BY, POWERED_BY_URL, PUBLIC_PLATFORM_SUPPORT_EMAIL; enable VERIFIER_KEYCLOAK_MANAGEMENT_CLIENT_SECRET. |
New Storage librarylibs/storage/package.json, libs/storage/src/index.ts, libs/storage/src/storage.module.ts, libs/storage/src/storage.service.ts, libs/storage/src/storage.service.spec.ts, libs/storage/src/storage.interface.ts, libs/storage/src/providers/minio.provider.ts, libs/storage/src/providers/s3.provider.ts, libs/storage/tsconfig*.json |
Add pluggable storage module/service with S3 and MinIO providers, interfaces, tests, and build config; expose via index. |
Remove AWS librarylibs/aws/src/aws.service.ts, libs/aws/src/aws.module.ts, libs/aws/src/index.ts |
Remove AwsService, AwsModule, and re-exports. |
Root config mappingpackage.json, tsconfig.json |
Map @credebl/storage path/alias for TS and Jest. |
API Gateway: switch to StorageServiceapps/api-gateway/src/issuance/issuance.controller.ts, .../issuance/issuance.module.ts, .../organization/organization.module.ts, .../user/user.controller.ts, .../user/user.module.ts, .../webhook/webhook.module.ts |
Replace AwsService DI with StorageService and update upload calls; minor logging addition. |
Issuance appapps/issuance/src/issuance.module.ts, apps/issuance/src/issuance.service.ts, apps/issuance/src/issuance.repository.ts |
Swap AwsService→StorageService; update file get/upload logic; minor log formatting; repo message formatting only. |
Organization appapps/organization/src/organization.module.ts, apps/organization/src/organization.service.ts |
Replace AwsService with StorageService; rename upload method; use ORG_LOGO_BUCKET and CommonConstants.ENCODING; add logo constants; update call sites. |
User app wiring cleanupapps/user/src/fido/fido.module.ts, apps/user/src/user.module.ts, apps/user/src/user.service.ts |
Replace/remove AwsService providers and related DI; remove userDevicesRepository from constructor. |
Utility appapps/utility/src/utilities.module.ts, apps/utility/src/utilities.service.ts |
Import StorageModule; switch store/get/delete to StorageService; storeObject now returns URL string from storage provider. |
Agent serviceapps/agent-service/src/agent-service.service.ts, apps/agent-service/src/repositories/agent-service.repository.ts |
Update health endpoint constant; add type annotation for whereClause; add eslint-disable for transaction. |
Connection service behaviorapps/connection/src/connection.repository.ts, apps/connection/src/connection.service.ts |
Change getInvitationDidByOrgId to return first (ordered) record instead of array; adjust service to use single legacyInvitationDid; minor formatting. |
Agent provisioningapps/agent-provisioning/AFJ/scripts/fargate.sh, apps/agent-provisioning/src/agent-provisioning.service.ts |
Major script overhaul: ALB/TG/security groups, dynamic ports, endpoints via ALB, task/service config changes, token extraction; service file string formatting only. |
Cloud walletapps/cloud-wallet/src/cloud-wallet.service.ts |
Build URL with threadId as query param in template; formatting adjustments. |
Ledger schemaapps/ledger/src/schema/enum/schema.enum.ts, apps/ledger/src/schema/interfaces/schema-payload.interface.ts, apps/ledger/src/schema/repositories/schema.repository.ts |
Formatting in enums/interfaces; remove unused import in repository. |
Common constantslibs/common/src/common.constant.ts |
Remove PERMISSION_ROLE_MGMT; add ENCODING='base64'. |
Validations (style)libs/validations/* |
Whitespace/formatting fixes; add missing class brace in keyword.ts; no logic changes. |
Sequence Diagram(s)
sequenceDiagram
autonumber
actor Client
participant Module as Feature Module
participant Service as StorageService
participant Provider as Provider (S3/MinIO)
note over Service,Provider: Provider selected via FILE_STORAGE_PROVIDER
Client->>Module: Upload request (file/body)
Module->>Service: uploadCsvFile / uploadFileToBucket
Service->>Provider: uploadFile/storeObject
Provider-->>Service: URL or ack
Service-->>Module: URL/void
Module-->>Client: Response
sequenceDiagram
autonumber
participant ConnSvc as ConnectionService
participant Repo as ConnectionRepository
Note over ConnSvc,Repo: Reuse connection flow
ConnSvc->>Repo: getInvitationDidByOrgId(orgId)
Repo-->>ConnSvc: first agent_invitations (ordered by createDateTime)
alt IsReuseConnection
ConnSvc->>ConnSvc: legacyInvitationDid = data.invitationDid
ConnSvc-->>ConnSvc: Use legacyInvitationDid
else New invitation
ConnSvc->>ConnSvc: Proceed to create new invitation
end
sequenceDiagram
autonumber
participant APIGW as API Gateway
participant Agent as Agent Service
Note over APIGW,Agent: Health check endpoint change
APIGW->>Agent: GET /agent/get-endpoint (URL_AGENT_GET_ENDPOINT)
Agent-->>APIGW: Health data
Estimated code review effort
🎯 4 (Complex) | ⏱️ ~75 minutes
Suggested labels
feature
Suggested reviewers
- RinkalBhojani
- GHkrishna
Poem
In burrows of bytes I stash and store,
MinIO moonlight, S3 at the door.
Buckets renamed, the streams now sing,
A carrot of keys on timestamped string. 🥕
Agents report, connections renew—
Thump-thump! New storage, sleek and true.
Pre-merge checks and finishing touches
✅ Passed checks (3 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title Check | ✅ Passed | The title succinctly and accurately captures the primary enhancement introduced by this PR, namely support for an optional object datastore feature. It is clear, concise, and directly related to the overall addition of a new storage service library with MinIO and AWS S3 providers. |
| Docstring Coverage | ✅ Passed | No functions found in the changes. Docstring coverage check skipped. |
✨ Finishing touches
- [ ] 📝 Generate Docstrings
🧪 Generate unit tests
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
- [ ] Commit unit tests in branch
feat/optional-object-datastore
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
🧪 Early access (Sonnet 4.5): enabled
We are currently testing the Sonnet 4.5 model, which is expected to improve code review quality. However, this model may lead to increased noise levels in the review comments. Please disable the early access features if the noise level causes any inconvenience.
Note:
- Public repositories are always opted into early access features.
- You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file.
Comment @coderabbitai help to get the list of available commands and usage tips.
[!CAUTION] No docstrings were generated.
@ankita-p17 you think the CodeRabbit reviews are useful?
Quality Gate passed
Issues
8 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
@ankita-p17 Do we have any further updates on this?
@ankita-p17 - Any update or issue for this feature?
Quality Gate passed
Issues
5 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
Closing this PR as it has some unsigned commits from upstream which are resolved later. Created new PR for this implementation - https://github.com/credebl/platform/pull/1484