Skip to content

[issue:2581] add captcha provider and validator URL props to eSignet - #2586

Open
SwapnilWorks-Devops wants to merge 1 commit into
mosip:develop-gofrom
SwapnilWorks-Devops:issue-2581-esignet-captcha-props-develop-go
Open

SwapnilWorks-Devops wants to merge 1 commit into
mosip:develop-gofrom
SwapnilWorks-Devops:issue-2581-esignet-captcha-props-develop-go

Conversation

@SwapnilWorks-Devops

@SwapnilWorks-Devops SwapnilWorks-Devops commented Sep 10, 2026

Copy link
Copy Markdown

Fixes #2581

Problem

eSignet 2.0.x reads the captcha widget provider from MOSIP_ESIGNET_CAPTCHA_SITE_PROVIDER (esignet-service/data/flows/flow-esignet.yaml) and validates captcha tokens against MOSIP_ESIGNET_CAPTCHA_VALIDATOR_URL (esignet-service/internal/config/app.go).

deploy/esignet/install.sh only passed MOSIP_ESIGNET_CAPTCHA_SITE_KEY. The flow file is expanded with os.ExpandEnv, so the provider came through as an empty string. With no validator URL, the service accepts captcha tokens unverified (see esignet-service/.env.example). Both props had to be added to the deployment by hand, and the issue thread confirms that adding them makes captcha work.

Changes

deploy/esignet/install.sh

  • when the esignet-captcha secret exists, also pass:
    • MOSIP_ESIGNET_CAPTCHA_SITE_PROVIDER=google-recaptcha (deploy/captcha/install.sh collects reCAPTCHA v2 keys)
    • MOSIP_ESIGNET_CAPTCHA_VALIDATOR_URL=http://captcha.captcha/v1/captcha/validatecaptcha (the captcha release in the captcha namespace)
  • installs without the secret are unchanged, so validation is never pointed at a captcha service that isn't deployed

deploy/esignet/values.yaml

  • list the two props in the commented examples

Verification

  • bash -n install.sh passes
  • running the captcha block of install.sh verbatim, with kubectl stubbed, produces a values file that parses as YAML both with and without the esignet-captcha secret
  • helm template of the published mosip/esignet 2.0.0-develop chart (the version install.sh pins):
    • without the secret, the env is unchanged: only MOSIP_ESIGNET_CAPTCHA_SITE_KEY with value: ""
    • with the secret, each variable renders exactly once, with no collision against chart defaults:
- name: MOSIP_ESIGNET_CAPTCHA_SITE_KEY
  valueFrom:
    secretKeyRef:
      key: esignet-captcha-site-key
      name: esignet-captcha
- name: MOSIP_ESIGNET_CAPTCHA_SITE_PROVIDER
  value: "google-recaptcha"
- name: MOSIP_ESIGNET_CAPTCHA_VALIDATOR_URL
  value: "http://captcha.captcha/v1/captcha/validatecaptcha"

Note

The same change is raised against both branches that carry the eSignet 2.0.x deployment scripts:

  • release-2.0.x
  • develop-go

develop is not included. It holds the Java eSignet, whose install.sh sets no captcha env and which does not read MOSIP_ESIGNET_CAPTCHA_SITE_PROVIDER.

AUTHORIZE_ENDPOINT from the original issue body is left out. As noted in the issue thread, eSignet serves /oauth2/authorize itself, and the prop belongs to mock-relying-party-ui.

eSignet 2.0.x reads the captcha widget provider from
MOSIP_ESIGNET_CAPTCHA_SITE_PROVIDER (flow-esignet.yaml) and validates
captcha tokens against MOSIP_ESIGNET_CAPTCHA_VALIDATOR_URL. install.sh
only passed MOSIP_ESIGNET_CAPTCHA_SITE_KEY, so the provider expanded to
an empty string and tokens were accepted unverified until both props
were added to the deployment by hand.

- install.sh: when the esignet-captcha secret exists, also pass
  MOSIP_ESIGNET_CAPTCHA_SITE_PROVIDER=google-recaptcha (the captcha
  installer collects reCAPTCHA v2 keys) and
  MOSIP_ESIGNET_CAPTCHA_VALIDATOR_URL pointing at the captcha service
  (http://captcha.captcha/v1/captcha/validatecaptcha). Installs without
  the secret are unchanged, so validation is never pointed at a captcha
  service that isn't deployed.
- deploy values.yaml: list the two props in the commented examples.

Signed-off-by: Swapnil <swapnil.mohanty@technoforte.co.in>
@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 013fd4ef-28e2-46a8-8ef1-a4124a7ef5d5

📥 Commits

Reviewing files that changed from the base of the PR and between edc48d9 and bf5c2c9.

📒 Files selected for processing (2)
  • deploy/esignet/install.sh
  • deploy/esignet/values.yaml

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

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@edc48d9). 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    #2586   +/-   ##
=============================================
  Coverage              ?   70.18%           
=============================================
  Files                 ?      129           
  Lines                 ?     8950           
  Branches              ?      111           
=============================================
  Hits                  ?     6282           
  Misses                ?     2207           
  Partials              ?      461           
Flag Coverage Δ
go 69.06% <ø> (?)
npm 92.20% <ø> (?)

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.

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