Skip to content

Comments

Replace 1024-bit RSA test key with 2048-bit key to eliminate InsecureKeyLengthWarning#1565

Merged
nijel merged 2 commits intomasterfrom
copilot/update-rsa-key-for-testing
Feb 10, 2026
Merged

Replace 1024-bit RSA test key with 2048-bit key to eliminate InsecureKeyLengthWarning#1565
nijel merged 2 commits intomasterfrom
copilot/update-rsa-key-for-testing

Conversation

Copy link
Contributor

Copilot AI commented Feb 10, 2026

PyJWT raises InsecureKeyLengthWarning when using RSA keys below 2048 bits (NIST SP 800-131A minimum). The GoogleOneTapTest class was using a 1024-bit RSA key pair for JWT encoding/decoding tests.

Changes

  • Generated new 2048-bit RSA key pair using OpenSSL
  • Updated GoogleOneTapTest.private_key (PKCS#1 format)
  • Updated GoogleOneTapTest.public_key (standard PEM format)

The new keys maintain the same format and structure as the original keys, ensuring test compatibility while meeting current security standards.

Original prompt

Update social_core/tests/backends/test_google.py to use modern RSA key for testing to avoid warnings:

social_core/tests/backends/test_google.py::GoogleOneTapTest::test_get_decoded_info_error
social_core/tests/backends/test_google.py::GoogleOneTapTest::test_get_decoded_info_success
  /home/runner/work/social-core/social-core/.tox/py310/lib/python3.10/site-packages/jwt/api_jwt.py:153: InsecureKeyLengthWarning: The RSA key is 1024 bits long, which is below the minimum recommended size of 2048 bits. See NIST SP 800-131A.

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: nijel <212189+nijel@users.noreply.github.com>
Copilot AI changed the title [WIP] Update test_google.py to use modern RSA key Replace 1024-bit RSA test key with 2048-bit key to eliminate InsecureKeyLengthWarning Feb 10, 2026
Copilot AI requested a review from nijel February 10, 2026 07:43
@nijel nijel marked this pull request as ready for review February 10, 2026 07:45
@nijel nijel enabled auto-merge (squash) February 10, 2026 07:45
@codecov
Copy link

codecov bot commented Feb 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.15%. Comparing base (f9f9524) to head (27cbac2).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1565   +/-   ##
=======================================
  Coverage   79.15%   79.15%           
=======================================
  Files         354      354           
  Lines       11666    11666           
  Branches      537      537           
=======================================
  Hits         9234     9234           
  Misses       2246     2246           
  Partials      186      186           
Flag Coverage Δ
unittests 79.15% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nijel nijel merged commit 21af6ea into master Feb 10, 2026
27 checks passed
@nijel nijel deleted the copilot/update-rsa-key-for-testing branch February 10, 2026 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants