Skip to content

Commit d7a9ec1

Browse files
authored
feat(appsec): automated business logic events for payments (#15727)
## Description This PR adds instrumentation of the Stripe SDKs for AppSec, by sending addresses to the WAF for the following function calls: - payment intent creation - checkout session creation of type `payment_intent` - construct event for the three following types of events: - payment_intent.succeeded - payment_intent.payment_failed - payment_intent.canceled ## Testing This PR includes unittests for the instrumented functions using `vcrpy` cassettes with recorded Stripe API responses, and webhook samples generated by the stripe cli. The tests ensure compatibility with the Stripe SDK version 11 and up across all python versions. ## Risks None ## Additional Notes <!-- Any other information that would be helpful for reviewers -->
1 parent c5b5e17 commit d7a9ec1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+3360
-7
lines changed

.riot/requirements/1196ac3.txt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.13
3+
# by the following command:
4+
#
5+
# pip-compile --allow-unsafe --no-annotate .riot/requirements/1196ac3.in
6+
#
7+
attrs==25.4.0
8+
certifi==2025.11.12
9+
charset-normalizer==3.4.4
10+
coverage[toml]==7.13.0
11+
hypothesis==6.45.0
12+
idna==3.11
13+
iniconfig==2.3.0
14+
mock==5.2.0
15+
opentracing==2.4.0
16+
packaging==25.0
17+
pluggy==1.6.0
18+
pygments==2.19.2
19+
pytest==9.0.2
20+
pytest-cov==7.0.0
21+
pytest-mock==3.15.1
22+
pyyaml==6.0.3
23+
requests==2.32.5
24+
sortedcontainers==2.4.0
25+
stripe==13.2.0
26+
typing-extensions==4.15.0
27+
urllib3==2.6.2
28+
vcrpy==8.1.0
29+
wrapt==2.0.1

.riot/requirements/12b3167.txt

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.10
3+
# by the following command:
4+
#
5+
# pip-compile --allow-unsafe --no-annotate .riot/requirements/12b3167.in
6+
#
7+
attrs==25.4.0
8+
certifi==2025.11.12
9+
charset-normalizer==3.4.4
10+
coverage[toml]==7.13.0
11+
exceptiongroup==1.3.1
12+
hypothesis==6.45.0
13+
idna==3.11
14+
iniconfig==2.3.0
15+
mock==5.2.0
16+
opentracing==2.4.0
17+
packaging==25.0
18+
pluggy==1.6.0
19+
pygments==2.19.2
20+
pytest==9.0.2
21+
pytest-cov==7.0.0
22+
pytest-mock==3.15.1
23+
pyyaml==6.0.3
24+
requests==2.32.5
25+
sortedcontainers==2.4.0
26+
stripe==13.2.0
27+
tomli==2.3.0
28+
typing-extensions==4.15.0
29+
urllib3==2.6.2
30+
vcrpy==8.1.0
31+
wrapt==2.0.1

.riot/requirements/14cfe2e.txt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.13
3+
# by the following command:
4+
#
5+
# pip-compile --allow-unsafe --no-annotate .riot/requirements/14cfe2e.in
6+
#
7+
attrs==25.4.0
8+
certifi==2025.11.12
9+
charset-normalizer==3.4.4
10+
coverage[toml]==7.13.0
11+
hypothesis==6.45.0
12+
idna==3.11
13+
iniconfig==2.3.0
14+
mock==5.2.0
15+
opentracing==2.4.0
16+
packaging==25.0
17+
pluggy==1.6.0
18+
pygments==2.19.2
19+
pytest==9.0.2
20+
pytest-cov==7.0.0
21+
pytest-mock==3.15.1
22+
pyyaml==6.0.3
23+
requests==2.32.5
24+
sortedcontainers==2.4.0
25+
stripe==12.5.1
26+
typing-extensions==4.15.0
27+
urllib3==2.6.2
28+
vcrpy==8.1.0
29+
wrapt==2.0.1

.riot/requirements/1544047.txt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.14
3+
# by the following command:
4+
#
5+
# pip-compile --allow-unsafe --no-annotate .riot/requirements/1544047.in
6+
#
7+
attrs==25.4.0
8+
certifi==2025.11.12
9+
charset-normalizer==3.4.4
10+
coverage[toml]==7.13.0
11+
hypothesis==6.45.0
12+
idna==3.11
13+
iniconfig==2.3.0
14+
mock==5.2.0
15+
opentracing==2.4.0
16+
packaging==25.0
17+
pluggy==1.6.0
18+
pygments==2.19.2
19+
pytest==9.0.2
20+
pytest-cov==7.0.0
21+
pytest-mock==3.15.1
22+
pyyaml==6.0.3
23+
requests==2.32.5
24+
sortedcontainers==2.4.0
25+
stripe==12.5.1
26+
typing-extensions==4.15.0
27+
urllib3==2.6.2
28+
vcrpy==8.1.0
29+
wrapt==2.0.1

.riot/requirements/18913cd.txt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.12
3+
# by the following command:
4+
#
5+
# pip-compile --allow-unsafe --no-annotate .riot/requirements/18913cd.in
6+
#
7+
attrs==25.4.0
8+
certifi==2025.11.12
9+
charset-normalizer==3.4.4
10+
coverage[toml]==7.13.0
11+
hypothesis==6.45.0
12+
idna==3.11
13+
iniconfig==2.3.0
14+
mock==5.2.0
15+
opentracing==2.4.0
16+
packaging==25.0
17+
pluggy==1.6.0
18+
pygments==2.19.2
19+
pytest==9.0.2
20+
pytest-cov==7.0.0
21+
pytest-mock==3.15.1
22+
pyyaml==6.0.3
23+
requests==2.32.5
24+
sortedcontainers==2.4.0
25+
stripe==11.6.0
26+
typing-extensions==4.15.0
27+
urllib3==2.6.2
28+
vcrpy==8.1.0
29+
wrapt==2.0.1

.riot/requirements/190c811.txt

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.9
3+
# by the following command:
4+
#
5+
# pip-compile --allow-unsafe --no-annotate .riot/requirements/190c811.in
6+
#
7+
attrs==25.4.0
8+
certifi==2025.11.12
9+
charset-normalizer==3.4.4
10+
coverage[toml]==7.10.7
11+
exceptiongroup==1.3.1
12+
hypothesis==6.45.0
13+
idna==3.11
14+
iniconfig==2.1.0
15+
mock==5.2.0
16+
multidict==6.7.0
17+
opentracing==2.4.0
18+
packaging==25.0
19+
pluggy==1.6.0
20+
propcache==0.4.1
21+
pygments==2.19.2
22+
pytest==8.4.2
23+
pytest-cov==7.0.0
24+
pytest-mock==3.15.1
25+
pyyaml==6.0.3
26+
requests==2.32.5
27+
sortedcontainers==2.4.0
28+
stripe==12.5.1
29+
tomli==2.3.0
30+
typing-extensions==4.15.0
31+
urllib3==1.26.20
32+
vcrpy==7.0.0
33+
wrapt==2.0.1
34+
yarl==1.22.0

.riot/requirements/19aa387.txt

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.10
3+
# by the following command:
4+
#
5+
# pip-compile --allow-unsafe --no-annotate .riot/requirements/19aa387.in
6+
#
7+
attrs==25.4.0
8+
certifi==2025.11.12
9+
charset-normalizer==3.4.4
10+
coverage[toml]==7.13.0
11+
exceptiongroup==1.3.1
12+
hypothesis==6.45.0
13+
idna==3.11
14+
iniconfig==2.3.0
15+
mock==5.2.0
16+
opentracing==2.4.0
17+
packaging==25.0
18+
pluggy==1.6.0
19+
pygments==2.19.2
20+
pytest==9.0.2
21+
pytest-cov==7.0.0
22+
pytest-mock==3.15.1
23+
pyyaml==6.0.3
24+
requests==2.32.5
25+
sortedcontainers==2.4.0
26+
stripe==12.5.1
27+
tomli==2.3.0
28+
typing-extensions==4.15.0
29+
urllib3==2.6.2
30+
vcrpy==8.1.0
31+
wrapt==2.0.1

.riot/requirements/1b13f04.txt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.11
3+
# by the following command:
4+
#
5+
# pip-compile --allow-unsafe --no-annotate .riot/requirements/1b13f04.in
6+
#
7+
attrs==25.4.0
8+
certifi==2025.11.12
9+
charset-normalizer==3.4.4
10+
coverage[toml]==7.13.0
11+
hypothesis==6.45.0
12+
idna==3.11
13+
iniconfig==2.3.0
14+
mock==5.2.0
15+
opentracing==2.4.0
16+
packaging==25.0
17+
pluggy==1.6.0
18+
pygments==2.19.2
19+
pytest==9.0.2
20+
pytest-cov==7.0.0
21+
pytest-mock==3.15.1
22+
pyyaml==6.0.3
23+
requests==2.32.5
24+
sortedcontainers==2.4.0
25+
stripe==14.1.0
26+
typing-extensions==4.15.0
27+
urllib3==2.6.2
28+
vcrpy==8.1.0
29+
wrapt==2.0.1

.riot/requirements/1c39e96.txt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.11
3+
# by the following command:
4+
#
5+
# pip-compile --allow-unsafe --no-annotate .riot/requirements/1c39e96.in
6+
#
7+
attrs==25.4.0
8+
certifi==2025.11.12
9+
charset-normalizer==3.4.4
10+
coverage[toml]==7.13.0
11+
hypothesis==6.45.0
12+
idna==3.11
13+
iniconfig==2.3.0
14+
mock==5.2.0
15+
opentracing==2.4.0
16+
packaging==25.0
17+
pluggy==1.6.0
18+
pygments==2.19.2
19+
pytest==9.0.2
20+
pytest-cov==7.0.0
21+
pytest-mock==3.15.1
22+
pyyaml==6.0.3
23+
requests==2.32.5
24+
sortedcontainers==2.4.0
25+
stripe==11.6.0
26+
typing-extensions==4.15.0
27+
urllib3==2.6.2
28+
vcrpy==8.1.0
29+
wrapt==2.0.1

.riot/requirements/1c67f9c.txt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.13
3+
# by the following command:
4+
#
5+
# pip-compile --allow-unsafe --no-annotate .riot/requirements/1c67f9c.in
6+
#
7+
attrs==25.4.0
8+
certifi==2025.11.12
9+
charset-normalizer==3.4.4
10+
coverage[toml]==7.13.0
11+
hypothesis==6.45.0
12+
idna==3.11
13+
iniconfig==2.3.0
14+
mock==5.2.0
15+
opentracing==2.4.0
16+
packaging==25.0
17+
pluggy==1.6.0
18+
pygments==2.19.2
19+
pytest==9.0.2
20+
pytest-cov==7.0.0
21+
pytest-mock==3.15.1
22+
pyyaml==6.0.3
23+
requests==2.32.5
24+
sortedcontainers==2.4.0
25+
stripe==11.6.0
26+
typing-extensions==4.15.0
27+
urllib3==2.6.2
28+
vcrpy==8.1.0
29+
wrapt==2.0.1

0 commit comments

Comments
 (0)