razorpay 3.2.3 → 3.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.cursorignore +174 -0
- data/.github/workflows/ci.yml +8 -7
- data/CHANGELOG.md +6 -0
- data/lib/razorpay/constants.rb +1 -1
- data/lib/razorpay/utility.rb +8 -3
- data/test/razorpay/test_utility.rb +2 -2
- metadata +6 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 20c9fe5dd27329aceee373510059552808b2ed481fb59da923f2dca95d857156
|
|
4
|
+
data.tar.gz: d58229258c2df81882fea1bdb99a136e34f458f3170f0df4ab2b5f7123a827a5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fd7ecba7866f08006fc27b7d5a4b5cb4d9ccf7f5fdf39ca833e60988b46b0fded9afdea31bc7679b256a150fac525eeb2ca77985043143073d52471490919f67
|
|
7
|
+
data.tar.gz: 1d5747bf39b762bdbfd010fd212d07a78ab94c5cd712a121f8b6592e5850aa1bd8a0913ad8d26bce50f390631b94376088af78163574578f3b2e62a1e15f983d
|
data/.cursorignore
ADDED
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
# Distribution and Environment
|
|
2
|
+
dist/*
|
|
3
|
+
build/*
|
|
4
|
+
venv/*
|
|
5
|
+
env/*
|
|
6
|
+
*.env
|
|
7
|
+
.env.*
|
|
8
|
+
virtualenv/*
|
|
9
|
+
.python-version
|
|
10
|
+
.ruby-version
|
|
11
|
+
.node-version
|
|
12
|
+
|
|
13
|
+
# Logs and Temporary Files
|
|
14
|
+
*.log
|
|
15
|
+
*.tsv
|
|
16
|
+
*.csv
|
|
17
|
+
*.txt
|
|
18
|
+
tmp/*
|
|
19
|
+
temp/*
|
|
20
|
+
.tmp/*
|
|
21
|
+
*.temp
|
|
22
|
+
*.cache
|
|
23
|
+
.cache/*
|
|
24
|
+
logs/*
|
|
25
|
+
|
|
26
|
+
# Sensitive Data
|
|
27
|
+
*.sqlite
|
|
28
|
+
*.sqlite3
|
|
29
|
+
*.dbsql
|
|
30
|
+
secrets.*
|
|
31
|
+
.npmrc
|
|
32
|
+
.yarnrc
|
|
33
|
+
.aws/*
|
|
34
|
+
.config/*
|
|
35
|
+
|
|
36
|
+
# Credentials and Keys
|
|
37
|
+
*.pem
|
|
38
|
+
*.ppk
|
|
39
|
+
*.key
|
|
40
|
+
*.pub
|
|
41
|
+
*.p12
|
|
42
|
+
*.pfx
|
|
43
|
+
*.htpasswd
|
|
44
|
+
*.keystore
|
|
45
|
+
*.jks
|
|
46
|
+
*.truststore
|
|
47
|
+
*.cer
|
|
48
|
+
id_rsa*
|
|
49
|
+
known_hosts
|
|
50
|
+
authorized_keys
|
|
51
|
+
.ssh/*
|
|
52
|
+
.gnupg/*
|
|
53
|
+
.pgpass
|
|
54
|
+
|
|
55
|
+
# Config Files
|
|
56
|
+
*.conf
|
|
57
|
+
*.toml
|
|
58
|
+
*.ini
|
|
59
|
+
.env.local
|
|
60
|
+
.env.development
|
|
61
|
+
.env.test
|
|
62
|
+
.env.production
|
|
63
|
+
config/*
|
|
64
|
+
|
|
65
|
+
# Database Files
|
|
66
|
+
*.sql
|
|
67
|
+
*.db
|
|
68
|
+
*.dmp
|
|
69
|
+
*.dump
|
|
70
|
+
*.backup
|
|
71
|
+
*.restore
|
|
72
|
+
*.mdb
|
|
73
|
+
*.accdb
|
|
74
|
+
*.realm*
|
|
75
|
+
|
|
76
|
+
# Backup and Archive Files
|
|
77
|
+
*.bak
|
|
78
|
+
*.backup
|
|
79
|
+
*.swp
|
|
80
|
+
*.swo
|
|
81
|
+
*.swn
|
|
82
|
+
*~
|
|
83
|
+
*.old
|
|
84
|
+
*.orig
|
|
85
|
+
*.archive
|
|
86
|
+
*.gz
|
|
87
|
+
*.zip
|
|
88
|
+
*.tar
|
|
89
|
+
*.rar
|
|
90
|
+
*.7z
|
|
91
|
+
|
|
92
|
+
# Compiled and Binary Files
|
|
93
|
+
*.pyc
|
|
94
|
+
*.pyo
|
|
95
|
+
**/__pycache__/**
|
|
96
|
+
*.class
|
|
97
|
+
*.jar
|
|
98
|
+
*.war
|
|
99
|
+
*.ear
|
|
100
|
+
*.dll
|
|
101
|
+
*.exe
|
|
102
|
+
*.so
|
|
103
|
+
*.dylib
|
|
104
|
+
*.bin
|
|
105
|
+
*.obj
|
|
106
|
+
|
|
107
|
+
# IDE and Editor Files
|
|
108
|
+
.idea/*
|
|
109
|
+
*.iml
|
|
110
|
+
.vscode/*
|
|
111
|
+
.project
|
|
112
|
+
.classpath
|
|
113
|
+
.settings/*
|
|
114
|
+
*.sublime-*
|
|
115
|
+
.atom/*
|
|
116
|
+
.eclipse/*
|
|
117
|
+
*.code-workspace
|
|
118
|
+
.history/*
|
|
119
|
+
|
|
120
|
+
# Build and Dependency Directories
|
|
121
|
+
node_modules/*
|
|
122
|
+
bower_components/*
|
|
123
|
+
vendor/*
|
|
124
|
+
packages/*
|
|
125
|
+
jspm_packages/*
|
|
126
|
+
.gradle/*
|
|
127
|
+
target/*
|
|
128
|
+
out/*
|
|
129
|
+
|
|
130
|
+
# Testing and Coverage Files
|
|
131
|
+
coverage/*
|
|
132
|
+
.coverage
|
|
133
|
+
htmlcov/*
|
|
134
|
+
.pytest_cache/*
|
|
135
|
+
.tox/*
|
|
136
|
+
junit.xml
|
|
137
|
+
test-results/*
|
|
138
|
+
|
|
139
|
+
# Mobile Development
|
|
140
|
+
*.apk
|
|
141
|
+
*.aab
|
|
142
|
+
*.ipa
|
|
143
|
+
*.xcarchive
|
|
144
|
+
*.provisionprofile
|
|
145
|
+
google-services.json
|
|
146
|
+
GoogleService-Info.plist
|
|
147
|
+
|
|
148
|
+
# Certificate and Security Files
|
|
149
|
+
*.crt
|
|
150
|
+
*.csr
|
|
151
|
+
*.ovpn
|
|
152
|
+
*.p7b
|
|
153
|
+
*.p7s
|
|
154
|
+
*.pfx
|
|
155
|
+
*.spc
|
|
156
|
+
*.stl
|
|
157
|
+
*.pem.crt
|
|
158
|
+
ssl/*
|
|
159
|
+
|
|
160
|
+
# Container and Infrastructure
|
|
161
|
+
*.tfstate
|
|
162
|
+
*.tfstate.backup
|
|
163
|
+
.terraform/*
|
|
164
|
+
.vagrant/*
|
|
165
|
+
docker-compose.override.yml
|
|
166
|
+
kubernetes/*
|
|
167
|
+
|
|
168
|
+
# Design and Media Files (often large and binary)
|
|
169
|
+
*.psd
|
|
170
|
+
*.ai
|
|
171
|
+
*.sketch
|
|
172
|
+
*.fig
|
|
173
|
+
*.xd
|
|
174
|
+
assets/raw/*
|
data/.github/workflows/ci.yml
CHANGED
|
@@ -3,6 +3,7 @@ on:
|
|
|
3
3
|
push:
|
|
4
4
|
branches:
|
|
5
5
|
- master
|
|
6
|
+
- fix/upgrade-github-actions-v4
|
|
6
7
|
tags:
|
|
7
8
|
- v[0-9]+.[0-9]+.[0-9]+*
|
|
8
9
|
pull_request:
|
|
@@ -14,7 +15,7 @@ jobs:
|
|
|
14
15
|
runs-on: ubuntu-latest
|
|
15
16
|
|
|
16
17
|
steps:
|
|
17
|
-
- uses: actions/checkout@
|
|
18
|
+
- uses: actions/checkout@v4
|
|
18
19
|
- name: Set up Ruby
|
|
19
20
|
uses: ruby/setup-ruby@v1
|
|
20
21
|
with:
|
|
@@ -24,7 +25,7 @@ jobs:
|
|
|
24
25
|
- name: Build
|
|
25
26
|
run: gem build *.gemspec
|
|
26
27
|
- name: 'Upload Artifact'
|
|
27
|
-
uses: actions/upload-artifact@
|
|
28
|
+
uses: actions/upload-artifact@v4
|
|
28
29
|
with:
|
|
29
30
|
name: gems
|
|
30
31
|
path: '*.gem'
|
|
@@ -37,7 +38,7 @@ jobs:
|
|
|
37
38
|
|
|
38
39
|
steps:
|
|
39
40
|
- name: Checkout
|
|
40
|
-
uses: actions/checkout@
|
|
41
|
+
uses: actions/checkout@v4
|
|
41
42
|
- name: Set up Ruby latest
|
|
42
43
|
uses: ruby/setup-ruby@v1
|
|
43
44
|
with:
|
|
@@ -48,19 +49,19 @@ jobs:
|
|
|
48
49
|
run: bundle exec rake
|
|
49
50
|
- name: Upload coverage to Codecov
|
|
50
51
|
if: ${{ matrix.ruby-version == 3.1 }}
|
|
51
|
-
uses: codecov/codecov-action@
|
|
52
|
+
uses: codecov/codecov-action@v4
|
|
52
53
|
with:
|
|
53
54
|
files: ${{ github.workspace }}/coverage/coverage.xml
|
|
54
55
|
publish:
|
|
55
56
|
name: Publish
|
|
56
|
-
if: startsWith(github.ref, 'refs/tags/v')
|
|
57
|
+
# if: startsWith(github.ref, 'refs/tags/v')
|
|
57
58
|
needs: [build, test]
|
|
58
59
|
runs-on: ubuntu-latest
|
|
59
60
|
steps:
|
|
60
|
-
- uses: actions/checkout@
|
|
61
|
+
- uses: actions/checkout@v4
|
|
61
62
|
- run: sudo apt-get install -y oathtool
|
|
62
63
|
- name: Download all workflow run artifacts
|
|
63
|
-
uses: actions/download-artifact@
|
|
64
|
+
uses: actions/download-artifact@v4
|
|
64
65
|
with:
|
|
65
66
|
name: gems
|
|
66
67
|
path: gems
|
data/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,12 @@ Changelog for Razorpay-Ruby SDK.
|
|
|
4
4
|
|
|
5
5
|
## Unreleased
|
|
6
6
|
|
|
7
|
+
## [3.2.4] - 2026-06-08
|
|
8
|
+
|
|
9
|
+
fix: Security fix for AES-GCM onboarding signature
|
|
10
|
+
* Fixed nonce reuse vulnerability in `generate_onboarding_signature` by using a random nonce per call instead of a static IV derived from the secret key
|
|
11
|
+
* New output format: `hex(iv[12] || ciphertext || tag[16])` — the receiver reads the first 24 hex chars as the IV before decrypting
|
|
12
|
+
|
|
7
13
|
## [3.2.3] - 2024-05-27
|
|
8
14
|
|
|
9
15
|
feat: Added new API endpoints
|
data/lib/razorpay/constants.rb
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
module Razorpay
|
|
3
3
|
BASE_URI = 'https://api.razorpay.com'.freeze
|
|
4
4
|
TEST_URL = 'https://api.razorpay.com/'.freeze
|
|
5
|
-
VERSION = '3.2.
|
|
5
|
+
VERSION = '3.2.4'.freeze
|
|
6
6
|
AUTH_URL = 'https://auth.razorpay.com'.freeze
|
|
7
7
|
API_HOST = 'API'.freeze
|
|
8
8
|
AUTH_HOST = 'AUTH'.freeze
|
data/lib/razorpay/utility.rb
CHANGED
|
@@ -59,9 +59,13 @@ module Razorpay
|
|
|
59
59
|
end
|
|
60
60
|
|
|
61
61
|
def encrypt(data, secret)
|
|
62
|
-
iv = secret[0, 12]
|
|
63
62
|
key = secret[0, 16]
|
|
64
63
|
|
|
64
|
+
# Generate a fresh random 12-byte nonce per call (fixes AES-GCM nonce reuse).
|
|
65
|
+
# A static IV derived from the secret allows keystream recovery and tag forgery
|
|
66
|
+
# (NIST SP 800-38D §8.3 Forbidden Attack) using only two captured ciphertexts.
|
|
67
|
+
iv = OpenSSL::Random.random_bytes(12)
|
|
68
|
+
|
|
65
69
|
cipher = OpenSSL::Cipher.new('aes-128-gcm')
|
|
66
70
|
cipher.encrypt
|
|
67
71
|
cipher.key = key
|
|
@@ -72,9 +76,10 @@ module Razorpay
|
|
|
72
76
|
encrypted = cipher.update(data) + cipher.final
|
|
73
77
|
|
|
74
78
|
tag = cipher.auth_tag
|
|
75
|
-
combined_encrypted_data = encrypted + tag
|
|
76
79
|
|
|
77
|
-
|
|
80
|
+
# Output format: iv (12 bytes) || ciphertext || tag (16 bytes), hex-encoded.
|
|
81
|
+
# Receiver must read the first 24 hex chars as the IV before decrypting.
|
|
82
|
+
(iv + encrypted + tag).unpack1("H*")
|
|
78
83
|
end
|
|
79
84
|
end
|
|
80
85
|
end
|
|
@@ -99,11 +99,11 @@ module Razorpay
|
|
|
99
99
|
def decrypt(data, secret)
|
|
100
100
|
combined_encrypted_data = [data].pack("H*")
|
|
101
101
|
|
|
102
|
-
iv =
|
|
102
|
+
iv = combined_encrypted_data[0, 12]
|
|
103
103
|
key = secret[0, 16]
|
|
104
104
|
tag = combined_encrypted_data[-16..]
|
|
105
105
|
|
|
106
|
-
encrypted_data = combined_encrypted_data[
|
|
106
|
+
encrypted_data = combined_encrypted_data[12...-16]
|
|
107
107
|
|
|
108
108
|
cipher = OpenSSL::Cipher.new('aes-128-gcm')
|
|
109
109
|
cipher.decrypt
|
metadata
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: razorpay
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.2.
|
|
4
|
+
version: 3.2.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Abhay Rana
|
|
8
8
|
- Harman Singh
|
|
9
|
-
autorequire:
|
|
9
|
+
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date:
|
|
12
|
+
date: 2026-06-08 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: httparty
|
|
@@ -117,6 +117,7 @@ executables: []
|
|
|
117
117
|
extensions: []
|
|
118
118
|
extra_rdoc_files: []
|
|
119
119
|
files:
|
|
120
|
+
- ".cursorignore"
|
|
120
121
|
- ".editorconfig"
|
|
121
122
|
- ".github/dependabot.yml"
|
|
122
123
|
- ".github/pull_request_template.md"
|
|
@@ -351,7 +352,7 @@ homepage: https://razorpay.com/
|
|
|
351
352
|
licenses:
|
|
352
353
|
- MIT
|
|
353
354
|
metadata: {}
|
|
354
|
-
post_install_message:
|
|
355
|
+
post_install_message:
|
|
355
356
|
rdoc_options: []
|
|
356
357
|
require_paths:
|
|
357
358
|
- lib
|
|
@@ -367,7 +368,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
367
368
|
version: '0'
|
|
368
369
|
requirements: []
|
|
369
370
|
rubygems_version: 3.3.27
|
|
370
|
-
signing_key:
|
|
371
|
+
signing_key:
|
|
371
372
|
specification_version: 4
|
|
372
373
|
summary: Razorpay's Ruby API
|
|
373
374
|
test_files:
|