Skip to content

Commit 8ef0b13

Browse files
Merge branch 'main' into docs-audit
2 parents 3ce3c4d + 2491a2d commit 8ef0b13

11 files changed

Lines changed: 74 additions & 14 deletions

File tree

.github/workflows/ci-build.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
permissions:
2121
contents: read
2222
steps:
23-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
23+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
2424
with:
2525
persist-credentials: false
2626
- name: Set up Python ${{ env.LATEST_SUPPORTED_PY }}
@@ -37,7 +37,7 @@ jobs:
3737
permissions:
3838
contents: read
3939
steps:
40-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
40+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
4141
with:
4242
persist-credentials: false
4343
- name: Set up Python ${{ env.LATEST_SUPPORTED_PY }}
@@ -71,7 +71,7 @@ jobs:
7171
CI_LARGE_SOCKET_MODE_PAYLOAD_TESTING_DISABLED: "1"
7272
FORCE_COLOR: "1"
7373
steps:
74-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
74+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
7575
with:
7676
persist-credentials: false
7777
- name: Set up Python ${{ matrix.python-version }}
@@ -95,7 +95,7 @@ jobs:
9595
PYTHONPATH=$PWD:$PYTHONPATH pytest tests/slack_sdk/oauth/state_store/test_sqlalchemy.py
9696
- name: Upload test results to Codecov
9797
if: ${{ !cancelled() }}
98-
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
98+
uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1
9999
with:
100100
directory: ./reports/
101101
fail_ci_if_error: true
@@ -105,7 +105,7 @@ jobs:
105105
verbose: true
106106
- name: Upload test coverage to Codecov (only with latest supported version)
107107
if: startsWith(matrix.python-version, env.LATEST_SUPPORTED_PY)
108-
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
108+
uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1
109109
with:
110110
fail_ci_if_error: true
111111
# Run validation generates the coverage file
@@ -136,7 +136,7 @@ jobs:
136136
--health-timeout 5s
137137
--health-retries 5
138138
steps:
139-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
139+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
140140
with:
141141
persist-credentials: false
142142
- name: Set up Python ${{ env.LATEST_SUPPORTED_PY }}
@@ -174,7 +174,7 @@ jobs:
174174
if: ${{ !success() && github.ref == 'refs/heads/main' && github.event_name != 'workflow_dispatch' }}
175175
steps:
176176
- name: Send notifications of failing tests
177-
uses: slackapi/slack-github-action@03ea5433c137af7c0495bc0cad1af10403fc800c # v3.0.2
177+
uses: slackapi/slack-github-action@45a88b9581bfab2566dc881e2cd66d334e621e2c # v3.0.3
178178
with:
179179
errors: true
180180
webhook: ${{ secrets.SLACK_REGRESSION_FAILURES_WEBHOOK_URL }}

.github/workflows/pypi-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
contents: read
1919

2020
steps:
21-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
21+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
2222
with:
2323
ref: ${{ github.event.release.tag_name || github.ref }}
2424
persist-credentials: false

.github/workflows/triage-issues.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
issues: write
1717
pull-requests: write
1818
steps:
19-
- uses: actions/stale@b5d41d4e1d5dceea10e7104786b73624c18a190f # v10.2.0
19+
- uses: actions/stale@eb5cf3af3ac0a1aa4c9c45633dd1ae542a27a899 # v10.3.0
2020
with:
2121
days-before-issue-stale: 30
2222
days-before-issue-close: 10

SECURITY.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## Security
2+
3+
Please report any security issue to [https://www.sfdc.co/SubmitVuln](https://www.sfdc.co/SubmitVuln)
4+
as soon as it is discovered. This library limits its runtime dependencies in
5+
order to reduce the total cost of ownership as much as can be, but all consumers
6+
should remain vigilant and have their security stakeholders review all third-party
7+
products (3PP) like this one and their dependencies.

requirements/databases.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
# PostgreSQL drivers
44
psycopg2-binary>=2.9,<3
5-
asyncpg>=0.27,<1
5+
asyncpg>=0.31.0,<1

requirements/documentation.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
docutils==0.22.4
1+
docutils==0.23
22
pdoc3==0.11.6

requirements/testing.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@ aiohttp<3.11; python_version == "3.8" # used for a WebSocket server mock
44
aiohttp<4; python_version >= "3.9" # used for a WebSocket server mock
55
pytest>=7.0.1,<9
66
pytest-asyncio<2 # for async
7-
pytest-cov>=2,<8
7+
pytest-cov>=4,<7.1.0; python_version < "3.9"
8+
pytest-cov>=7.1.0,<8; python_version >= "3.9"
89
click==8.0.4 # black is affected by https://github.com/pallets/click/issues/2225
910
psutil>=6.0.0,<8
1011
# cryptography 46+ dropped PyPy 3.10 wheels; pin to <46 for PyPy 3.10 only
1112
cryptography<46; implementation_name == "pypy" and python_version == "3.10"
1213
# used only under slack_sdk/*_store
1314
boto3<=2
1415
# For AWS tests
15-
moto>=4.0.13,<6
16+
moto>=4.2.14,<6
1617
# For AsyncSQLAlchemy tests
1718
greenlet<=4
1819
aiosqlite<=1

requirements/tools.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
mypy<=1.19.1;
22
# while flake8 5.x have issues with Python 3.12, flake8 6.x requires Python >= 3.8.1,
33
# so 5.x should be kept in order to stay compatible with Python 3.7/3.8
4-
flake8>=5.0.4,<8
4+
flake8>=7.3.0,<8
55
# Don't change this version without running CI builds;
66
# The latest version may not be available for older Python runtime
77
black==24.3.0;

slack_sdk/signature/__init__.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,18 @@ def __init__(self, signing_secret: str, clock: Clock = Clock()):
2929
self.signing_secret = signing_secret
3030
self.clock = clock
3131

32+
@property
33+
def signing_secret(self) -> str:
34+
return self._signing_secret
35+
36+
@signing_secret.setter
37+
def signing_secret(self, value: str) -> None:
38+
if not isinstance(value, str):
39+
raise ValueError("signing_secret must be a string")
40+
if not value.strip():
41+
raise ValueError("signing_secret must not be empty.")
42+
self._signing_secret = value
43+
3244
def is_valid_request(
3345
self,
3446
body: Union[str, bytes],

tests/signature/test_signature_verifier.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,23 @@ def test_is_valid_none(self):
9797
self.assertFalse(verifier.is_valid(None, self.timestamp, None))
9898
self.assertFalse(verifier.is_valid(self.body, None, None))
9999
self.assertFalse(verifier.is_valid(None, None, None))
100+
101+
def test_invalid_signing_secret(self):
102+
with self.assertRaises(ValueError):
103+
SignatureVerifier("")
104+
with self.assertRaises(ValueError):
105+
SignatureVerifier(" ")
106+
with self.assertRaises(ValueError):
107+
SignatureVerifier(None)
108+
with self.assertRaises(ValueError):
109+
SignatureVerifier(123)
110+
with self.assertRaises(ValueError):
111+
SignatureVerifier(b"secret")
112+
113+
def test_invalid_signing_secret_reassignment(self):
114+
verifier = SignatureVerifier(self.signing_secret)
115+
with self.assertRaises(ValueError):
116+
verifier.signing_secret = ""
117+
with self.assertRaises(ValueError):
118+
verifier.signing_secret = None
119+
self.assertEqual(verifier.signing_secret, self.signing_secret)

0 commit comments

Comments
 (0)