Skip to content

Commit 3132636

Browse files
committed
changelog
1 parent aeeb3d6 commit 3132636

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
99
### Added
1010

1111
- Add integration tests for embedded wallets. [1041](https://github.com/stellar/stellar-disbursement-platform-backend/pull/1041)
12+
- Add endpoint for fetch captcha config. [1052](https://github.com/stellar/stellar-disbursement-platform-backend/pull/1052)
1213

1314
## [6.1.0](https://github.com/stellar/stellar-disbursement-platform-backend/releases/tag/6.1.0) ([diff](https://github.com/stellar/stellar-disbursement-platform-backend/compare/6.0.1...6.1.0))
1415

dev/env-config-testnet.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ window._env_ = {
33
STELLAR_EXPERT_URL: "https://stellar.expert/explorer/testnet",
44
HORIZON_URL: "https://horizon-testnet.stellar.org",
55
RPC_ENABLED: true,
6-
RECAPTCHA_SITE_KEY: "6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI",
6+
RECAPTCHA_SITE_KEY: "6LcgOWcsAAAAAJkeyQHEW4-yA-Eu79kYHDYXeznF",
77
SINGLE_TENANT_MODE: false
88
};

internal/serve/validators/recaptcha_v3.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ type reCAPTCHAV3VerifyResponse struct {
3636

3737
// IsTokenValid validates a reCAPTCHA v3 token and checks if the score meets the minimum threshold.
3838
func (v *GoogleReCAPTCHAV3Validator) IsTokenValid(ctx context.Context, token string) (bool, error) {
39+
fmt.Printf("[DEBUG] reCAPTCHA V3 IsTokenValid: secretKey=%s...%s, token=%s...\n",
40+
v.SiteSecretKey[:6], v.SiteSecretKey[len(v.SiteSecretKey)-4:], token[:min(20, len(token))])
41+
3942
payload := fmt.Sprintf("secret=%s&response=%s", v.SiteSecretKey, token)
4043

4144
req, err := http.NewRequestWithContext(ctx, http.MethodPost, v.VerifyTokenURL, strings.NewReader(payload))
@@ -56,6 +59,8 @@ func (v *GoogleReCAPTCHAV3Validator) IsTokenValid(ctx context.Context, token str
5659
return false, fmt.Errorf("reading body response: %w", err)
5760
}
5861

62+
fmt.Printf("[DEBUG] reCAPTCHA V3 Google response: %s\n", string(respBodyBytes))
63+
5964
var respBody reCAPTCHAV3VerifyResponse
6065
if err := json.Unmarshal(respBodyBytes, &respBody); err != nil {
6166
return false, fmt.Errorf("unmarshalling body response: %w", err)
@@ -77,6 +82,7 @@ func (v *GoogleReCAPTCHAV3Validator) IsTokenValid(ctx context.Context, token str
7782
return false, fmt.Errorf("reCAPTCHA v3 score %.2f is below minimum threshold %.2f", respBody.Score, v.MinScore)
7883
}
7984

85+
fmt.Printf("[DEBUG] reCAPTCHA V3 validation passed: score=%.2f, minScore=%.2f\n", respBody.Score, v.MinScore)
8086
return true, nil
8187
}
8288

0 commit comments

Comments
 (0)