Skip to content

Fixed the postman collection and app config - #2338

Merged
anushasunkada merged 4 commits into
mosip:develop-gofrom
anushasunkada:local
Aug 7, 2026
Merged

Fixed the postman collection and app config#2338
anushasunkada merged 4 commits into
mosip:develop-gofrom
anushasunkada:local

Conversation

@anushasunkada

@anushasunkada anushasunkada commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Configuration

    • Updated local development defaults to use localhost:8080.
    • Aligned service, issuer, and cache settings for the standard local setup.
    • Added configurable HSM client installation support and updated PKCS#11 proxy settings.
  • Testing Tools

    • Refreshed Postman environment values, including endpoint, identity, and client defaults.
    • Improved client patch requests by automatically generating encryption keys and sending the public key.
    • Configured user information responses to use encrypted JWE format.
    • Added a clear setup error when required browser cryptography support is unavailable.

Signed-off-by: anushasunkada <anushasunkada@gmail.com>
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The PR updates local eSignet endpoints to port 8080, renames the cache type environment variable, refreshes Postman client encryption setup, and adds optional HSM client installation with PKCS#11 proxy configuration.

Changes

eSignet runtime and client setup

Layer / File(s) Summary
Local service and cache configuration
esignet-service/.env.example, esignet-service/data/deployment.yaml, esignet-service/internal/config/app.go
Local defaults use localhost:8080. Deployment uses MOSIP_ESIGNET_CACHE_TYPE. Application configuration stores the selected cache type in RuntimeDBType.
Postman environment and JWE client setup
postman-collection/Go-eSignet (local).postman_environment.json, postman-collection/Go-eSignet.postman_collection.json
Postman uses updated local service, identity, and client values. The Patch client prerequest generates RSA-OAEP-256 JWKs. The patch sends encPublicKey and sets userinfo_response_type to JWE.
HSM client container startup
esignet-service/Dockerfile, esignet-service/docker-entrypoint.sh
The runtime image adds HSM installation tools and configuration. The entrypoint optionally downloads, extracts, and installs the HSM client. Signing-key generation and SIGNING_KEY_PATH handling are removed.
PKCS#11 proxy configuration
helm/esignet/values.yaml
Helm values select the PKCS#11 proxy library and pkcs11-proxy token label.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant DockerImage
  participant Entrypoint
  participant HSMArchive
  participant HSMInstaller
  DockerImage->>Entrypoint: Start container with HSM settings
  Entrypoint->>HSMArchive: Download archive when URL is configured
  Entrypoint->>HSMInstaller: Extract archive and run install.sh as root
  HSMInstaller-->>Entrypoint: Complete HSM client installation
  Entrypoint->>Entrypoint: Execute container command
Loading

Possibly related PRs

Suggested reviewers: zesu22

Poem

Localhost points to eight-oh-eight-zero,
RSA keys guard the JWE flow.
HSM tools install when settings show,
PKCS#11 paths now align,
And eSignet starts with keys in line.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes changes to the Postman collection and app configuration, but it does not mention the significant HSM Docker configuration changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov-commenter

codecov-commenter commented Aug 7, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (develop-go@d4baf6d). Learn more about missing BASE report.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@              Coverage Diff              @@
##             develop-go    #2338   +/-   ##
=============================================
  Coverage              ?   66.36%           
=============================================
  Files                 ?      123           
  Lines                 ?     7988           
  Branches              ?      110           
=============================================
  Hits                  ?     5301           
  Misses                ?     2272           
  Partials              ?      415           
Flag Coverage Δ
go 64.86% <100.00%> (?)
npm 92.39% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@esignet-service/data/deployment.yaml`:
- Around line 2-16: Align deployment.yaml’s top-level port and server.port with
the 8088 default used by app.go’s defaultPort and cfg.Server.Port flow,
preserving consistent token-binding hostport validation. Replace every
${VAR:-fallback} expression with Go-compatible environment expansion and rely on
the Go configuration defaults for unset variables, including issuer, data_dir,
provider, flow/theme/layout IDs, runtime_db_type, and public_url.

In `@postman-collection/Go-eSignet` (local).postman_environment.json:
- Line 14: Update the endpoint environment values used as DPoP htu inputs for
token, PAR, and UserInfo requests to contain each request’s full endpoint URL,
including its path, rather than only the service origin. Apply the same
correction to all three referenced environment entries and preserve the existing
host and port.

In `@postman-collection/Go-eSignet.postman_collection.json`:
- Line 267: Add a UserInfo response script for the request using the
`client_enc_private_key` variable: import the stored RSA-OAEP private JWK,
decrypt the `jwt_encrypted` compact JWE response, and validate the resulting
plaintext before treating the request as successful. Replace raw JWE logging
with decryption/validation handling while preserving the existing UserInfo
status check.
- Around line 206-208: Update the crypto availability guard in the pre-request
script to safely detect an absent Postman crypto global before accessing its
properties, while preserving the existing manual-key setup error for unavailable
key generation.
- Around line 229-230: Add client_enc_public_key and client_enc_private_key
variable declarations to every exported Postman environment, matching the names
used by the collection scripts; set the client_enc_private_key variable type to
secret while keeping the public key appropriately non-secret.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d0744b56-6753-48c8-a556-3dc04567041e

📥 Commits

Reviewing files that changed from the base of the PR and between d4baf6d and 084c4cd.

📒 Files selected for processing (5)
  • esignet-service/.env.example
  • esignet-service/data/deployment.yaml
  • esignet-service/internal/config/app.go
  • postman-collection/Go-eSignet (local).postman_environment.json
  • postman-collection/Go-eSignet.postman_collection.json

Comment thread esignet-service/data/deployment.yaml
Comment thread postman-collection/Go-eSignet (local).postman_environment.json
Comment thread postman-collection/Go-eSignet.postman_collection.json
Comment thread postman-collection/Go-eSignet.postman_collection.json
Comment thread postman-collection/Go-eSignet.postman_collection.json
Signed-off-by: anushasunkada <anushasunkada@gmail.com>
Signed-off-by: anushasunkada <anushasunkada@gmail.com>
Signed-off-by: anushasunkada <anushasunkada@gmail.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@esignet-service/docker-entrypoint.sh`:
- Around line 7-10: Update the HSM client download flow around
hsm_client_zip_url_env to require an HTTPS URL and validate client.zip against a
trusted, independently configured pinned signature or checksum before any
extraction or installer execution. Abort immediately on URL or verification
failure, and keep the verification material separate from the mutable download
URL.
- Line 24: Update the mv command in the archive extraction flow to protect the
archive-derived dirname value: quote the source and destination arguments and
include -- before them to prevent word splitting, pathname expansion, or option
parsing.

In `@esignet-service/Dockerfile`:
- Around line 61-63: Remove the sudoers rule and user-writable privileged
installer access from esignet-service/Dockerfile lines 61-63; ensure the HSM
installation is performed only by a trusted root-only init container or
image-build stage, with the installed library directory root-owned and
read-only. Update esignet-service/docker-entrypoint.sh line 34 to stop running
the installer at application startup and instead consume the preinstalled client
mounted read-only.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: ac9e619c-92bd-477c-82ba-84dee9b2555d

📥 Commits

Reviewing files that changed from the base of the PR and between 084c4cd and 066761b.

📒 Files selected for processing (3)
  • esignet-service/Dockerfile
  • esignet-service/docker-entrypoint.sh
  • helm/esignet/values.yaml

Comment thread esignet-service/docker-entrypoint.sh
Comment thread esignet-service/docker-entrypoint.sh
Comment thread esignet-service/Dockerfile
@anushasunkada
anushasunkada merged commit 31479c6 into mosip:develop-go Aug 7, 2026
23 of 25 checks passed
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