Skip to content

support boxsdk > v4#188

Open
saquibsaifee wants to merge 2 commits intoIBM:masterfrom
saquibsaifee:validate-detect-secret-compatibility-with-boxsdk-v10
Open

support boxsdk > v4#188
saquibsaifee wants to merge 2 commits intoIBM:masterfrom
saquibsaifee:validate-detect-secret-compatibility-with-boxsdk-v10

Conversation

@saquibsaifee
Copy link
Copy Markdown
Member

@saquibsaifee saquibsaifee commented Mar 27, 2026

Closes #160 #173

Motivation

  • Add compatibility for a newer/generated Box SDK while preserving support for the legacy boxsdk API.
  • Remove the strict <4.0.0 upper bound on the boxsdk[jwt] dependency to allow newer releases.
  • Bump package/version references used by pre-commit configs to the new internal release.

Testing

  • Ran the plugin unit tests pytest tests/plugins/box_test.py
source .venv/bin/activate && PYTHONPATH=`pwd` pytest tests/plugins/box_test.py -v

============================= test session starts =============================
collected 21 items                                                            

tests/plugins/box_test.py::TestBoxDetector::test_analyze_line["clientSecret": "12345678abcdefgh12345678ABCDEFGH"-True] PASSED [  4%]
tests/plugins/box_test.py::TestBoxDetector::test_analyze_line[client_secret = 12345678abcdefgh12345678ABCDEFGH-True] PASSED [  9%]
tests/plugins/box_test.py::TestBoxDetector::test_analyze_line[CLIENT-SECRET=12345678abcdefgh12345678ABCDEFGH-True] PASSED [ 14%]
tests/plugins/box_test.py::TestBoxDetector::test_analyze_line["clientsecret":="12345678abcdefgh12345678ABCDEFGH"-True] PASSED [ 19%]
tests/plugins/box_test.py::TestBoxDetector::test_analyze_line["clientSecret": "12345678abcdefgh12345678ABCDEFG2many"-True] PASSED [ 23%]
tests/plugins/box_test.py::TestBoxDetector::test_analyze_line["clientSecret": "12345678abcdnotenough"-False] PASSED [ 28%]
tests/plugins/box_test.py::TestBoxDetector::test_get_box_user PASSED    [ 33%]
tests/plugins/box_test.py::TestBoxDetector::test_get_box_user_auth_format PASSED [ 38%]
tests/plugins/box_test.py::TestBoxDetector::test_get_box_user_invalid_creds PASSED [ 42%]
tests/plugins/box_test.py::TestBoxDetector::test_verify PASSED          [ 47%]
tests/plugins/box_test.py::TestBoxDetector::test_verify_invalid PASSED  [ 52%]
tests/plugins/box_test.py::TestBoxDetector::test_verify_unverified_missing_clientid PASSED [ 57%]
tests/plugins/box_test.py::TestBoxDetector::test_verify_unverified_missing_publickeyid PASSED [ 61%]
tests/plugins/box_test.py::TestBoxDetector::test_verify_unverified_missing_passphrase PASSED [ 66%]
tests/plugins/box_test.py::TestBoxDetector::test_verify_unverified_missing_privatekey PASSED [ 71%]
tests/plugins/box_test.py::TestBoxDetector::test_verify_unverified_missing_enterpriseid PASSED [ 76%]
tests/plugins/box_test.py::TestBoxDetector::test_find_other_factor["clientID": "abcd1234abcd1234abcd1234abcd1234"-(?:client)-(?:id)-([a-z0-9]{32})-expected_result0] PASSED [ 80%]
tests/plugins/box_test.py::TestBoxDetector::test_find_other_factor["publicKeyID": "abcd1234"-(?:public(?:-|_|)key)-(?:id)-([a-z0-9]{8})-expected_result1] PASSED [ 85%]
tests/plugins/box_test.py::TestBoxDetector::test_find_other_factor["privateKey": "-----BEGIN ENCRYPTED PRIVATE KEY----- key -----END ENCRYPTED PRIVATE KEY-----\n"-(?:private)-(?:key)-(-----BEGIN ENCRYPTED PRIVATE KEY-----(?:.|\\n)+-----END ENCRYPTED PRIVATE KEY-----(?:\\n|))-expected_result2] PASSED [ 90%]
tests/plugins/box_test.py::TestBoxDetector::test_find_other_factor["passphrase": "abcd1234abcd1234abcd1234abcd1234"-(?:pass)-(?:phrase)-([a-z0-9]{32})-expected_result3] PASSED [ 95%]
tests/plugins/box_test.py::TestBoxDetector::test_find_other_factor["enterpriseID": "1234"-(?:enterprise)-(?:id)-([0-9]+)-expected_result4] PASSED [100%]

Signed-off-by: Saquib Saifee <saquibsaifee2@gmail.com>
Signed-off-by: Saquib Saifee <saquibsaifee2@gmail.com>
@saquibsaifee saquibsaifee force-pushed the validate-detect-secret-compatibility-with-boxsdk-v10 branch from e22bd43 to 705e32f Compare March 28, 2026 00:01
@saquibsaifee saquibsaifee changed the title support boxsdk v10 support boxsdk > v4 Mar 28, 2026
@saquibsaifee
Copy link
Copy Markdown
Member Author

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.

[BUG] detect-secrets can be incompatible with Python 3.12 due to deprecated boxsdk and six

1 participant