Skip to content

Saleor Core: the high performance, composable, headless commerce API.

JWT token signed with RS256 for 3.1 (#8745)

Maciej Korycinski94e03a68e873
diff --git a/.isort.cfg b/.isort.cfg
index 7ade008a8d..6f5dbb7464 100644
--- a/.isort.cfg
+++ b/.isort.cfg
@@ -1,2 +1,2 @@
[settings]
-known_third_party = Adyen,PIL,authorizenet,babel,boto3,botocore,braintree,celery,dateutil,dj_database_url,dj_email_url,django,django_cache_url,django_countries,django_filters,django_measurement,django_prices,django_prices_openexchangerates,django_prices_vatlayer,draftjs_sanitizer,faker,freezegun,google,google_measurement_protocol,graphene,graphene_django,graphene_federation,graphql,graphql_relay,html2text,html_to_draftjs,i18naddress,jaeger_client,jwt,kombu,lxml,markdown,measurement,micawber,mptt,oauthlib,openpyxl,opentracing,petl,phonenumber_field,phonenumbers,pkg_resources,prices,promise,pybars,pytest,pythonjsonlogger,pytimeparse,pytz,razorpay,requests,sendgrid,sentry_sdk,storages,stripe,urllib3,uvicorn,versatileimagefield,weasyprint
+known_third_party = Adyen,PIL,authorizenet,babel,boto3,botocore,braintree,celery,cryptography,dateutil,dj_database_url,dj_email_url,django,django_cache_url,django_countries,django_filters,django_measurement,django_prices,django_prices_openexchangerates,django_prices_vatlayer,draftjs_sanitizer,faker,freezegun,google,google_measurement_protocol,graphene,graphene_django,graphene_federation,graphql,graphql_relay,html2text,html_to_draftjs,i18naddress,jaeger_client,jwt,kombu,lxml,markdown,measurement,micawber,mptt,oauthlib,openpyxl,opentracing,petl,phonenumber_field,phonenumbers,pkg_resources,prices,promise,pybars,pytest,pythonjsonlogger,pytimeparse,pytz,razorpay,requests,sendgrid,sentry_sdk,storages,stripe,urllib3,uvicorn,versatileimagefield,weasyprint
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e23d71a046..3c1630e5e7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -316,6 +316,7 @@ All notable, unreleased changes to this project will be documented in this file.
and `CheckoutPricesData` instead of `PricesData`
- Do no allow using `id` for updating checkout and order metadata - #8906 by @IKarbowiak
- Use `token` instead
+- Sign JWT tokens with RS256 instead of HS256 - #7990 by @korycins
### Other
diff --git a/poetry.lock b/poetry.lock
index 360879902a..28168cdf73 100644
--- a/poetry.lock
+++ b/poetry.lock
@@ -389,6 +389,25 @@ tomli = {version = "*", optional = true, markers = "extra == \"toml\""}
[package.extras]
toml = ["tomli"]
+[[package]]
+name = "cryptography"
+version = "36.0.1"
+description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers."
+category = "main"
+optional = false
+python-versions = ">=3.6"
+
+[package.dependencies]
+cffi = ">=1.12"
+
+[package.extras]
+docs = ["sphinx (>=1.6.5,!=1.8.0,!=3.1.0,!=3.1.1)", "sphinx-rtd-theme"]
+docstest = ["pyenchant (>=1.6.11)", "twine (>=1.12.0)", "sphinxcontrib-spelling (>=4.0.1)"]
+pep8test = ["black", "flake8", "flake8-import-order", "pep8-naming"]
+sdist = ["setuptools_rust (>=0.11.4)"]
+ssh = ["bcrypt (>=3.1.5)"]
+test = ["pytest (>=6.2.0)", "pytest-cov", "pytest-subtests", "pytest-xdist", "pretend", "iso8601", "pytz", "hypothesis (>=1.11.4,!=3.79.2)"]
+
[[package]]
name = "cssselect2"
version = "0.4.1"
@@ -2735,8 +2754,8 @@ python-versions = "*"
[metadata]
lock-version = "1.1"
-python-versions = "~3.9"
-content-hash = "e70c7695fd3f3906fd600e1a7c41bd0f11cb9ed0b6e3d57f4386e9240ea2c15d"
+ python-versions = "~3.9"
+content-hash = "de8d1ace4577a79066f08dd560f7c49082c18cccbd39356a7361ee0f7410b4c6"
[metadata.files]
adyen = [
@@ -2814,9 +2833,6 @@ brotli = [
{file = "Brotli-1.0.9-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7ee83d3e3a024a9618e5be64648d6d11c37047ac48adff25f12fa4226cf23d1c"},
{file = "Brotli-1.0.9-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:19598ecddd8a212aedb1ffa15763dd52a388518c4550e615aed88dc3753c0f0c"},
{file = "Brotli-1.0.9-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:44bb8ff420c1d19d91d79d8c3574b8954288bdff0273bf788954064d260d7ab0"},
- {file = "Brotli-1.0.9-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:e23281b9a08ec338469268f98f194658abfb13658ee98e2b7f85ee9dd06caa91"},
- {file = "Brotli-1.0.9-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:3496fc835370da351d37cada4cf744039616a6db7d13c430035e901443a34daa"},
- {file = "Brotli-1.0.9-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:b83bb06a0192cccf1eb8d0a28672a1b79c74c3a8a5f2619625aeb6f28b3a82bb"},
{file = "Brotli-1.0.9-cp310-cp310-win32.whl", hash = "sha256:26d168aac4aaec9a4394221240e8a5436b5634adc3cd1cdf637f6645cecbf181"},
{file = "Brotli-1.0.9-cp310-cp310-win_amd64.whl", hash = "sha256:622a231b08899c864eb87e85f81c75e7b9ce05b001e59bbfbf43d4a71f5f32b2"},
{file = "Brotli-1.0.9-cp35-cp35m-macosx_10_6_intel.whl", hash = "sha256:c83aa123d56f2e060644427a882a36b3c12db93727ad7a7b9efd7d7f3e9cc2c4"},
@@ -2828,18 +2844,12 @@ brotli = [
{file = "Brotli-1.0.9-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:40d15c79f42e0a2c72892bf407979febd9cf91f36f495ffb333d1d04cebb34e4"},
{file = "Brotli-1.0.9-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:93130612b837103e15ac3f9cbacb4613f9e348b58b3aad53721d92e57f96d46a"},
{file = "Brotli-1.0.9-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:87fdccbb6bb589095f413b1e05734ba492c962b4a45a13ff3408fa44ffe6479b"},
- {file = "Brotli-1.0.9-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:6d847b14f7ea89f6ad3c9e3901d1bc4835f6b390a9c71df999b0162d9bb1e20f"},
- {file = "Brotli-1.0.9-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:495ba7e49c2db22b046a53b469bbecea802efce200dffb69b93dd47397edc9b6"},
- {file = "Brotli-1.0.9-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:4688c1e42968ba52e57d8670ad2306fe92e0169c6f3af0089be75bbac0c64a3b"},
{file = "Brotli-1.0.9-cp36-cp36m-win32.whl", hash = "sha256:61a7ee1f13ab913897dac7da44a73c6d44d48a4adff42a5701e3239791c96e14"},
{file = "Brotli-1.0.9-cp36-cp36m-win_amd64.whl", hash = "sha256:1c48472a6ba3b113452355b9af0a60da5c2ae60477f8feda8346f8fd48e3e87c"},
{file = "Brotli-1.0.9-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:3b78a24b5fd13c03ee2b7b86290ed20efdc95da75a3557cc06811764d5ad1126"},
{file = "Brotli-1.0.9-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:9d12cf2851759b8de8ca5fde36a59c08210a97ffca0eb94c532ce7b17c6a3d1d"},
{file = "Brotli-1.0.9-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:6c772d6c0a79ac0f414a9f8947cc407e119b8598de7621f39cacadae3cf57d12"},
{file = "Brotli-1.0.9-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:29d1d350178e5225397e28ea1b7aca3648fcbab546d20e7475805437bfb0a130"},
- {file = "Brotli-1.0.9-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:7bbff90b63328013e1e8cb50650ae0b9bac54ffb4be6104378490193cd60f85a"},
- {file = "Brotli-1.0.9-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:ec1947eabbaf8e0531e8e899fc1d9876c179fc518989461f5d24e2223395a9e3"},
- {file = "Brotli-1.0.9-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:12effe280b8ebfd389022aa65114e30407540ccb89b177d3fbc9a4f177c4bd5d"},
{file = "Brotli-1.0.9-cp37-cp37m-win32.whl", hash = "sha256:f909bbbc433048b499cb9db9e713b5d8d949e8c109a2a548502fb9aa8630f0b1"},
{file = "Brotli-1.0.9-cp37-cp37m-win_amd64.whl", hash = "sha256:97f715cf371b16ac88b8c19da00029804e20e25f30d80203417255d239f228b5"},
{file = "Brotli-1.0.9-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:e16eb9541f3dd1a3e92b89005e37b1257b157b7256df0e36bd7b33b50be73bcb"},
@@ -2847,9 +2857,6 @@ brotli = [
{file = "Brotli-1.0.9-cp38-cp38-manylinux1_i686.whl", hash = "sha256:b663f1e02de5d0573610756398e44c130add0eb9a3fc912a09665332942a2efb"},
{file = "Brotli-1.0.9-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:5b6ef7d9f9c38292df3690fe3e302b5b530999fa90014853dcd0d6902fb59f26"},
{file = "Brotli-1.0.9-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8a674ac10e0a87b683f4fa2b6fa41090edfd686a6524bd8dedbd6138b309175c"},
- {file = "Brotli-1.0.9-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:e2d9e1cbc1b25e22000328702b014227737756f4b5bf5c485ac1d8091ada078b"},
- {file = "Brotli-1.0.9-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:b336c5e9cf03c7be40c47b5fd694c43c9f1358a80ba384a21969e0b4e66a9b17"},
- {file = "Brotli-1.0.9-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:85f7912459c67eaab2fb854ed2bc1cc25772b300545fe7ed2dc03954da638649"},
{file = "Brotli-1.0.9-cp38-cp38-win32.whl", hash = "sha256:35a3edbe18e876e596553c4007a087f8bcfd538f19bc116917b3c7522fca0429"},
{file = "Brotli-1.0.9-cp38-cp38-win_amd64.whl", hash = "sha256:269a5743a393c65db46a7bb982644c67ecba4b8d91b392403ad8a861ba6f495f"},
{file = "Brotli-1.0.9-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:2aad0e0baa04517741c9bb5b07586c642302e5fb3e75319cb62087bd0995ab19"},
@@ -2857,9 +2864,6 @@ brotli = [
{file = "Brotli-1.0.9-cp39-cp39-manylinux1_i686.whl", hash = "sha256:16d528a45c2e1909c2798f27f7bf0a3feec1dc9e50948e738b961618e38b6a7b"},
{file = "Brotli-1.0.9-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:56d027eace784738457437df7331965473f2c0da2c70e1a1f6fdbae5402e0389"},
{file = "Brotli-1.0.9-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9bf919756d25e4114ace16a8ce91eb340eb57a08e2c6950c3cebcbe3dff2a5e7"},
- {file = "Brotli-1.0.9-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:e4c4e92c14a57c9bd4cb4be678c25369bf7a092d55fd0866f759e425b9660806"},
- {file = "Brotli-1.0.9-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:e48f4234f2469ed012a98f4b7874e7f7e173c167bed4934912a29e03167cf6b1"},
- {file = "Brotli-1.0.9-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:9ed4c92a0665002ff8ea852353aeb60d9141eb04109e88928026d3c8a9e5433c"},
{file = "Brotli-1.0.9-cp39-cp39-win32.whl", hash = "sha256:cfc391f4429ee0a9370aa93d812a52e1fee0f37a81861f4fdd1f4fb28e8547c3"},
{file = "Brotli-1.0.9-cp39-cp39-win_amd64.whl", hash = "sha256:854c33dad5ba0fbd6ab69185fec8dab89e13cda6b7d191ba111987df74f38761"},
{file = "Brotli-1.0.9-pp37-pypy37_pp73-macosx_10_9_x86_64.whl", hash = "sha256:9749a124280a0ada4187a6cfd1ffd35c350fb3af79c706589d98e088c5044267"},
@@ -3038,6 +3042,28 @@ coverage = [
{file = "coverage-6.3.1-pp36.pp37.pp38-none-any.whl", hash = "sha256:463e52616ea687fd323888e86bf25e864a3cc6335a043fad6bbb037dbf49bbe2"},
{file = "coverage-6.3.1.tar.gz", hash = "sha256:6c3f6158b02ac403868eea390930ae64e9a9a2a5bbfafefbb920d29258d9f2f8"},
]
+cryptography = [
+ {file = "cryptography-36.0.1-cp36-abi3-macosx_10_10_universal2.whl", hash = "sha256:73bc2d3f2444bcfeac67dd130ff2ea598ea5f20b40e36d19821b4df8c9c5037b"},
+ {file = "cryptography-36.0.1-cp36-abi3-macosx_10_10_x86_64.whl", hash = "sha256:2d87cdcb378d3cfed944dac30596da1968f88fb96d7fc34fdae30a99054b2e31"},
+ {file = "cryptography-36.0.1-cp36-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:74d6c7e80609c0f4c2434b97b80c7f8fdfaa072ca4baab7e239a15d6d70ed73a"},
+ {file = "cryptography-36.0.1-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:6c0c021f35b421ebf5976abf2daacc47e235f8b6082d3396a2fe3ccd537ab173"},
+ {file = "cryptography-36.0.1-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5d59a9d55027a8b88fd9fd2826c4392bd487d74bf628bb9d39beecc62a644c12"},
+ {file = "cryptography-36.0.1-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0a817b961b46894c5ca8a66b599c745b9a3d9f822725221f0e0fe49dc043a3a3"},
+ {file = "cryptography-36.0.1-cp36-abi3-manylinux_2_24_x86_64.whl", hash = "sha256:94ae132f0e40fe48f310bba63f477f14a43116f05ddb69d6fa31e93f05848ae2"},
+ {file = "cryptography-36.0.1-cp36-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:7be0eec337359c155df191d6ae00a5e8bbb63933883f4f5dffc439dac5348c3f"},
+ {file = "cryptography-36.0.1-cp36-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:e0344c14c9cb89e76eb6a060e67980c9e35b3f36691e15e1b7a9e58a0a6c6dc3"},
+ {file = "cryptography-36.0.1-cp36-abi3-win32.whl", hash = "sha256:4caa4b893d8fad33cf1964d3e51842cd78ba87401ab1d2e44556826df849a8ca"},
+ {file = "cryptography-36.0.1-cp36-abi3-win_amd64.whl", hash = "sha256:391432971a66cfaf94b21c24ab465a4cc3e8bf4a939c1ca5c3e3a6e0abebdbcf"},
+ {file = "cryptography-36.0.1-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:bb5829d027ff82aa872d76158919045a7c1e91fbf241aec32cb07956e9ebd3c9"},
+ {file = "cryptography-36.0.1-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ebc15b1c22e55c4d5566e3ca4db8689470a0ca2babef8e3a9ee057a8b82ce4b1"},
+ {file = "cryptography-36.0.1-pp37-pypy37_pp73-manylinux_2_24_x86_64.whl", hash = "sha256:596f3cd67e1b950bc372c33f1a28a0692080625592ea6392987dba7f09f17a94"},
+ {file = "cryptography-36.0.1-pp38-pypy38_pp73-macosx_10_10_x86_64.whl", hash = "sha256:30ee1eb3ebe1644d1c3f183d115a8c04e4e603ed6ce8e394ed39eea4a98469ac"},
+ {file = "cryptography-36.0.1-pp38-pypy38_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:ec63da4e7e4a5f924b90af42eddf20b698a70e58d86a72d943857c4c6045b3ee"},
+ {file = "cryptography-36.0.1-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ca238ceb7ba0bdf6ce88c1b74a87bffcee5afbfa1e41e173b1ceb095b39add46"},
+ {file = "cryptography-36.0.1-pp38-pypy38_pp73-manylinux_2_24_x86_64.whl", hash = "sha256:ca28641954f767f9822c24e927ad894d45d5a1e501767599647259cbf030b903"},
+ {file = "cryptography-36.0.1-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:39bdf8e70eee6b1c7b289ec6e5d84d49a6bfa11f8b8646b5b3dfe41219153316"},
+ {file = "cryptography-36.0.1.tar.gz", hash = "sha256:53e5c1dc3d7a953de055d77bef2ff607ceef7a2aac0353b5d630ab67f7423638"},
+]
cssselect2 = [
{file = "cssselect2-0.4.1-py3-none-any.whl", hash = "sha256:2f4a9f20965367bae459e3bb42561f7927e0cfe5b7ea1692757cf67ef5d7dace"},
{file = "cssselect2-0.4.1.tar.gz", hash = "sha256:93fbb9af860e95dd40bf18c3b2b6ed99189a07c0f29ba76f9c5be71344664ec8"},
@@ -3346,7 +3372,6 @@ grpcio-status = [
{file = "grpcio_status-1.43.0-py3-none-any.whl", hash = "sha256:9036b24f5769adafdc3e91d9434c20e9ede0b30f50cc6bff105c0f414bb9e0e0"},
]
gunicorn = [
- {file = "gunicorn-20.1.0-py3-none-any.whl", hash = "sha256:9dcc4547dbb1cb284accfb15ab5667a0e5d1881cc443e0677b4882a4067a807e"},
{file = "gunicorn-20.1.0.tar.gz", hash = "sha256:e0a968b5ba15f8a328fdfd7ab1fcb5af4470c28aaf7e55df02a99bc13138e6e8"},
]
h11 = [
@@ -3557,28 +3582,12 @@ markdown = [
{file = "Markdown-3.3.6.tar.gz", hash = "sha256:76df8ae32294ec39dcf89340382882dfa12975f87f45c3ed1ecdb1e8cefc7006"},
]
markupsafe = [
- {file = "MarkupSafe-2.0.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:d8446c54dc28c01e5a2dbac5a25f071f6653e6e40f3a8818e8b45d790fe6ef53"},
- {file = "MarkupSafe-2.0.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:36bc903cbb393720fad60fc28c10de6acf10dc6cc883f3e24ee4012371399a38"},
- {file = "MarkupSafe-2.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2d7d807855b419fc2ed3e631034685db6079889a1f01d5d9dac950f764da3dad"},
- {file = "MarkupSafe-2.0.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:add36cb2dbb8b736611303cd3bfcee00afd96471b09cda130da3581cbdc56a6d"},
- {file = "MarkupSafe-2.0.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:168cd0a3642de83558a5153c8bd34f175a9a6e7f6dc6384b9655d2697312a646"},
- {file = "MarkupSafe-2.0.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:4dc8f9fb58f7364b63fd9f85013b780ef83c11857ae79f2feda41e270468dd9b"},
- {file = "MarkupSafe-2.0.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:20dca64a3ef2d6e4d5d615a3fd418ad3bde77a47ec8a23d984a12b5b4c74491a"},
- {file = "MarkupSafe-2.0.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:cdfba22ea2f0029c9261a4bd07e830a8da012291fbe44dc794e488b6c9bb353a"},
- {file = "MarkupSafe-2.0.1-cp310-cp310-win32.whl", hash = "sha256:99df47edb6bda1249d3e80fdabb1dab8c08ef3975f69aed437cb69d0a5de1e28"},
- {file = "MarkupSafe-2.0.1-cp310-cp310-win_amd64.whl", hash = "sha256:e0f138900af21926a02425cf736db95be9f4af72ba1bb21453432a07f6082134"},
{file = "MarkupSafe-2.0.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:f9081981fe268bd86831e5c75f7de206ef275defcb82bc70740ae6dc507aee51"},
{file = "MarkupSafe-2.0.1-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:0955295dd5eec6cb6cc2fe1698f4c6d84af2e92de33fbcac4111913cd100a6ff"},
{file = "MarkupSafe-2.0.1-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:0446679737af14f45767963a1a9ef7620189912317d095f2d9ffa183a4d25d2b"},
{file = "MarkupSafe-2.0.1-cp36-cp36m-manylinux2010_i686.whl", hash = "sha256:f826e31d18b516f653fe296d967d700fddad5901ae07c622bb3705955e1faa94"},
{file = "MarkupSafe-2.0.1-cp36-cp36m-manylinux2010_x86_64.whl", hash = "sha256:fa130dd50c57d53368c9d59395cb5526eda596d3ffe36666cd81a44d56e48872"},
{file = "MarkupSafe-2.0.1-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:905fec760bd2fa1388bb5b489ee8ee5f7291d692638ea5f67982d968366bef9f"},
- {file = "MarkupSafe-2.0.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bf5d821ffabf0ef3533c39c518f3357b171a1651c1ff6827325e4489b0e46c3c"},
- {file = "MarkupSafe-2.0.1-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:0d4b31cc67ab36e3392bbf3862cfbadac3db12bdd8b02a2731f509ed5b829724"},
- {file = "MarkupSafe-2.0.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:baa1a4e8f868845af802979fcdbf0bb11f94f1cb7ced4c4b8a351bb60d108145"},
- {file = "MarkupSafe-2.0.1-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:deb993cacb280823246a026e3b2d81c493c53de6acfd5e6bfe31ab3402bb37dd"},
- {file = "MarkupSafe-2.0.1-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:63f3268ba69ace99cab4e3e3b5840b03340efed0948ab8f78d2fd87ee5442a4f"},
- {file = "MarkupSafe-2.0.1-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:8d206346619592c6200148b01a2142798c989edcb9c896f9ac9722a99d4e77e6"},
{file = "MarkupSafe-2.0.1-cp36-cp36m-win32.whl", hash = "sha256:6c4ca60fa24e85fe25b912b01e62cb969d69a23a5d5867682dd3e80b5b02581d"},
{file = "MarkupSafe-2.0.1-cp36-cp36m-win_amd64.whl", hash = "sha256:b2f4bf27480f5e5e8ce285a8c8fd176c0b03e93dcc6646477d4630e83440c6a9"},
{file = "MarkupSafe-2.0.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:0717a7390a68be14b8c793ba258e075c6f4ca819f15edfc2a3a027c823718567"},
@@ -3587,27 +3596,14 @@ markupsafe = [
{file = "MarkupSafe-2.0.1-cp37-cp37m-manylinux2010_i686.whl", hash = "sha256:d7f9850398e85aba693bb640262d3611788b1f29a79f0c93c565694658f4071f"},
{file = "MarkupSafe-2.0.1-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:6a7fae0dd14cf60ad5ff42baa2e95727c3d81ded453457771d02b7d2b3f9c0c2"},
{file = "MarkupSafe-2.0.1-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:b7f2d075102dc8c794cbde1947378051c4e5180d52d276987b8d28a3bd58c17d"},
- {file = "MarkupSafe-2.0.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e9936f0b261d4df76ad22f8fee3ae83b60d7c3e871292cd42f40b81b70afae85"},
- {file = "MarkupSafe-2.0.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:2a7d351cbd8cfeb19ca00de495e224dea7e7d919659c2841bbb7f420ad03e2d6"},
- {file = "MarkupSafe-2.0.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:60bf42e36abfaf9aff1f50f52644b336d4f0a3fd6d8a60ca0d054ac9f713a864"},
- {file = "MarkupSafe-2.0.1-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:d6c7ebd4e944c85e2c3421e612a7057a2f48d478d79e61800d81468a8d842207"},
- {file = "MarkupSafe-2.0.1-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:f0567c4dc99f264f49fe27da5f735f414c4e7e7dd850cfd8e69f0862d7c74ea9"},
- {file = "MarkupSafe-2.0.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:89c687013cb1cd489a0f0ac24febe8c7a666e6e221b783e53ac50ebf68e45d86"},
{file = "MarkupSafe-2.0.1-cp37-cp37m-win32.whl", hash = "sha256:a30e67a65b53ea0a5e62fe23682cfe22712e01f453b95233b25502f7c61cb415"},
{file = "MarkupSafe-2.0.1-cp37-cp37m-win_amd64.whl", hash = "sha256:611d1ad9a4288cf3e3c16014564df047fe08410e628f89805e475368bd304914"},
- {file = "MarkupSafe-2.0.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:5bb28c636d87e840583ee3adeb78172efc47c8b26127267f54a9c0ec251d41a9"},
{file = "MarkupSafe-2.0.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:be98f628055368795d818ebf93da628541e10b75b41c559fdf36d104c5787066"},
{file = "MarkupSafe-2.0.1-cp38-cp38-manylinux1_i686.whl", hash = "sha256:1d609f577dc6e1aa17d746f8bd3c31aa4d258f4070d61b2aa5c4166c1539de35"},
{file = "MarkupSafe-2.0.1-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:7d91275b0245b1da4d4cfa07e0faedd5b0812efc15b702576d103293e252af1b"},
{file = "MarkupSafe-2.0.1-cp38-cp38-manylinux2010_i686.whl", hash = "sha256:01a9b8ea66f1658938f65b93a85ebe8bc016e6769611be228d797c9d998dd298"},
{file = "MarkupSafe-2.0.1-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:47ab1e7b91c098ab893b828deafa1203de86d0bc6ab587b160f78fe6c4011f75"},
{file = "MarkupSafe-2.0.1-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:97383d78eb34da7e1fa37dd273c20ad4320929af65d156e35a5e2d89566d9dfb"},
- {file = "MarkupSafe-2.0.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6fcf051089389abe060c9cd7caa212c707e58153afa2c649f00346ce6d260f1b"},
- {file = "MarkupSafe-2.0.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:5855f8438a7d1d458206a2466bf82b0f104a3724bf96a1c781ab731e4201731a"},
- {file = "MarkupSafe-2.0.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:3dd007d54ee88b46be476e293f48c85048603f5f516008bee124ddd891398ed6"},
- {file = "MarkupSafe-2.0.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:aca6377c0cb8a8253e493c6b451565ac77e98c2951c45f913e0b52facdcff83f"},
- {file = "MarkupSafe-2.0.1-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:04635854b943835a6ea959e948d19dcd311762c5c0c6e1f0e16ee57022669194"},
- {file = "MarkupSafe-2.0.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:6300b8454aa6930a24b9618fbb54b5a68135092bc666f7b06901f897fa5c2fee"},
{file = "MarkupSafe-2.0.1-cp38-cp38-win32.whl", hash = "sha256:023cb26ec21ece8dc3907c0e8320058b2e0cb3c55cf9564da612bc325bed5e64"},
{file = "MarkupSafe-2.0.1-cp38-cp38-win_amd64.whl", hash = "sha256:984d76483eb32f1bcb536dc27e4ad56bba4baa70be32fa87152832cdd9db0833"},
{file = "MarkupSafe-2.0.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:2ef54abee730b502252bcdf31b10dacb0a416229b72c18b19e24a4509f273d26"},
@@ -3617,12 +3613,6 @@ markupsafe = [
{file = "MarkupSafe-2.0.1-cp39-cp39-manylinux2010_i686.whl", hash = "sha256:4efca8f86c54b22348a5467704e3fec767b2db12fc39c6d963168ab1d3fc9135"},
{file = "MarkupSafe-2.0.1-cp39-cp39-manylinux2010_x86_64.whl", hash = "sha256:ab3ef638ace319fa26553db0624c4699e31a28bb2a835c5faca8f8acf6a5a902"},
{file = "MarkupSafe-2.0.1-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:f8ba0e8349a38d3001fae7eadded3f6606f0da5d748ee53cc1dab1d6527b9509"},
- {file = "MarkupSafe-2.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c47adbc92fc1bb2b3274c4b3a43ae0e4573d9fbff4f54cd484555edbf030baf1"},
- {file = "MarkupSafe-2.0.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:37205cac2a79194e3750b0af2a5720d95f786a55ce7df90c3af697bfa100eaac"},
- {file = "MarkupSafe-2.0.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:1f2ade76b9903f39aa442b4aadd2177decb66525062db244b35d71d0ee8599b6"},
- {file = "MarkupSafe-2.0.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:4296f2b1ce8c86a6aea78613c34bb1a672ea0e3de9c6ba08a960efe0b0a09047"},
- {file = "MarkupSafe-2.0.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:9f02365d4e99430a12647f09b6cc8bab61a6564363f313126f775eb4f6ef798e"},
- {file = "MarkupSafe-2.0.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5b6d930f030f8ed98e3e6c98ffa0652bdb82601e7a016ec2ab5d7ff23baa78d1"},
{file = "MarkupSafe-2.0.1-cp39-cp39-win32.whl", hash = "sha256:10f82115e21dc0dfec9ab5c0223652f7197feb168c940f3ef61563fc2d6beb74"},
{file = "MarkupSafe-2.0.1-cp39-cp39-win_amd64.whl", hash = "sha256:693ce3f9e70a6cf7d2fb9e6c9d8b204b6b39897a2c4a1aa65728d5ac97dcc1d8"},
{file = "MarkupSafe-2.0.1.tar.gz", hash = "sha256:594c67807fb16238b30c44bdf74f36c02cdf22d1c8cda91ef8a0ed8dabf5620a"},
diff --git a/pyproject.toml b/pyproject.toml
index b79062058f..b040515ecc 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -66,6 +66,7 @@ documentation = "https://docs.saleor.io/"
sendgrid = "^6.7.1"
micawber = "^0.5.2"
django-celery-beat = "^2.2.1"
+ cryptography = "^36.0.0"
[tool.poetry.dependencies.celery]
version = ">=4.4.5,<6.0.0"
diff --git a/requirements.txt b/requirements.txt
index 40546854dc..de03c01007 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -13,16 +13,17 @@ brotli==1.0.9; platform_python_implementation == "CPython" and python_version >=
brotlicffi==1.0.9.2; platform_python_implementation != "CPython" and python_version >= "3.7"
cachetools==5.0.0; python_version >= "3.7" and python_version < "4.0" and (python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version >= "3.7")
celery==5.1.2; python_version >= "3.6"
-certifi==2021.10.8; python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version >= "3.7"
+certifi==2021.10.8; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.6.0"
cffi==1.15.0; platform_python_implementation != "CPython" and python_version >= "3.7"
-charset-normalizer==2.0.11; python_full_version >= "3.6.0" and python_version >= "3.7"
+charset-normalizer==2.0.11; python_full_version >= "3.6.0" and python_version >= "3"
click-didyoumean==0.3.0; python_full_version >= "3.6.2" and python_full_version < "4.0.0" and python_version >= "3.6"
click-plugins==1.1.1; python_version >= "3.6"
click-repl==0.2.0; python_version >= "3.6"
click==7.1.2; python_full_version >= "3.6.2" and python_version >= "3.6" and python_full_version < "4.0.0" and (python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6")
colorama==0.4.4; python_version >= "2.7" and python_full_version < "3.0.0" and sys_platform == "win32" or sys_platform == "win32" and python_full_version >= "3.5.0"
+cryptography==36.0.1; python_version >= "3.6"
cssselect2==0.4.1; python_version >= "3.6"
-deprecated==1.2.13; python_version >= "3.6" and python_full_version < "3.0.0" or python_version >= "3.6" and python_full_version >= "3.4.0"
+deprecated==1.2.13; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6"
dj-database-url==0.5.0
dj-email-url==1.0.4
django-appconf==1.0.5; python_version >= "3.6"
@@ -72,7 +73,7 @@ html-to-draftjs==1.0.1
html2text==2020.1.16; python_version >= "3.5"
html5lib==1.1; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
httptools==0.1.2; sys_platform != "win32" and sys_platform != "cygwin" and platform_python_implementation != "PyPy"
-idna==3.3; python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version >= "3.7"
+idna==3.3; python_version >= "3.5" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version >= "3.5"
importlib-metadata==4.10.1; python_version < "3.10" and python_version >= "3.7"
jaeger-client==4.8.0; python_version >= "3.7"
jmespath==0.10.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.3.0" and python_version >= "3.6"
@@ -142,7 +143,7 @@ tornado==6.1; python_version >= "3.7"
typing-extensions==4.0.1; python_version >= "3.6"
typing-inspect==0.7.1; python_version >= "3.6"
unidecode==1.3.2; python_version >= "3.5"
-urllib3==1.26.8; python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version < "4" and python_version >= "3.7"
+urllib3==1.26.8; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version < "4" and python_version >= "3.6"
uvicorn==0.13.4
uvloop==0.16.0; sys_platform != "win32" and sys_platform != "cygwin" and platform_python_implementation != "PyPy" and python_version >= "3.7"
vine==5.0.0; python_version >= "3.7"
@@ -151,6 +152,6 @@ wcwidth==0.2.5; python_full_version >= "3.6.2" and python_version >= "3.6"
weasyprint==54.0; python_version >= "3.6"
webencodings==0.5.1; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
websockets==8.1; python_full_version >= "3.6.1"
-wrapt==1.13.3; python_version >= "3.6" and python_full_version < "3.0.0" or python_version >= "3.6" and python_full_version >= "3.5.0"
+wrapt==1.13.3; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
zipp==3.7.0; python_version < "3.10" and python_version >= "3.7"
zopfli==0.1.9; python_version >= "3.7"
diff --git a/requirements_dev.txt b/requirements_dev.txt
index 422ab3eb2f..76461e9bab 100644
--- a/requirements_dev.txt
+++ b/requirements_dev.txt
@@ -1,10 +1,10 @@
adyen==4.0.0
amqp==5.0.9; python_version >= "3.7"
aniso8601==7.0.0
-asgiref==3.5.0; python_version >= "3.7" and python_version < "4.0"
+asgiref==3.5.0; python_version >= "3.7"
astroid==2.9.3; python_full_version >= "3.6.2"
-atomicwrites==1.4.0; python_version >= "3.7" and python_full_version < "3.0.0" and sys_platform == "win32" or sys_platform == "win32" and python_version >= "3.7" and python_full_version >= "3.4.0"
-attrs==21.4.0; python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.7"
+atomicwrites==1.4.0; python_version >= "3.6" and python_full_version < "3.0.0" and sys_platform == "win32" or sys_platform == "win32" and python_version >= "3.6" and python_full_version >= "3.4.0"
+attrs==21.4.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
authorizenet==1.1.4
babel==2.9.1; (python_version >= "2.7" and python_full_version < "3.0.0") or (python_full_version >= "3.4.0")
beautifulsoup4==4.7.1
@@ -18,19 +18,20 @@ brotli==1.0.9; platform_python_implementation == "CPython" and python_version >=
brotlicffi==1.0.9.2; platform_python_implementation != "CPython" and python_version >= "3.7"
cachetools==5.0.0; python_version >= "3.7" and python_version < "4.0" and (python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version >= "3.7")
celery==5.1.2; python_version >= "3.6"
-certifi==2021.10.8; python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version >= "3.7" and python_version < "3.10"
+certifi==2021.10.8; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.6.0"
cffi==1.15.0; platform_python_implementation != "CPython" and python_version >= "3.7"
cfgv==3.3.1; python_full_version >= "3.6.1"
-charset-normalizer==2.0.11; python_full_version >= "3.6.0" and python_version >= "3.7" and python_version < "3.10"
+charset-normalizer==2.0.11; python_full_version >= "3.6.0" and python_version >= "3"
click-didyoumean==0.3.0; python_full_version >= "3.6.2" and python_full_version < "4.0.0" and python_version >= "3.6"
click-plugins==1.1.1; python_version >= "3.6"
click-repl==0.2.0; python_version >= "3.6"
click==7.1.2; python_full_version >= "3.6.2" and python_version >= "3.6" and (python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0") and (python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6") and python_full_version < "4.0.0"
codecov==2.1.12; (python_version >= "2.7" and python_full_version < "3.0.0") or (python_full_version >= "3.4.0")
-colorama==0.4.4; sys_platform == "win32" and python_full_version >= "3.6.2" and (python_version >= "3.6" and python_full_version < "3.0.0" and sys_platform == "win32" or sys_platform == "win32" and python_version >= "3.6" and python_full_version >= "3.5.0") and (python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0") and (python_version >= "2.7" and python_full_version < "3.0.0" and platform_system == "Windows" or python_full_version >= "3.5.0" and platform_system == "Windows") and (python_version >= "3.7" and python_full_version < "3.0.0" and sys_platform == "win32" or sys_platform == "win32" and python_version >= "3.7" and python_full_version >= "3.5.0")
+colorama==0.4.4; sys_platform == "win32" and python_full_version >= "3.6.2" and (python_version >= "3.6" and python_full_version < "3.0.0" and sys_platform == "win32" or sys_platform == "win32" and python_version >= "3.6" and python_full_version >= "3.5.0") and (python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0") and (python_version >= "2.7" and python_full_version < "3.0.0" and platform_system == "Windows" or python_full_version >= "3.5.0" and platform_system == "Windows")
coverage==6.3; python_version >= "3.7"
+cryptography==36.0.1; python_version >= "3.6"
cssselect2==0.4.1; python_version >= "3.6"
-deprecated==1.2.13; python_version >= "3.6" and python_full_version < "3.0.0" or python_version >= "3.6" and python_full_version >= "3.4.0"
+deprecated==1.2.13; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6"
distlib==0.3.4; python_full_version >= "3.6.1"
dj-database-url==0.5.0
dj-email-url==1.0.4
@@ -93,9 +94,9 @@ html2text==2020.1.16; python_version >= "3.5"
html5lib==1.1; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
httptools==0.1.2; sys_platform != "win32" and sys_platform != "cygwin" and platform_python_implementation != "PyPy"
identify==2.4.6; python_version >= "3.7" and python_full_version >= "3.6.1"
-idna==3.3; python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version >= "3.7" and python_version < "3.10"
+idna==3.3; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version >= "3.6"
importlib-metadata==4.10.1; python_version < "3.10" and python_version >= "3.7"
-iniconfig==1.1.1; python_version >= "3.7"
+iniconfig==1.1.1; python_version >= "3.6"
isort==5.10.1; python_full_version >= "3.6.1" and python_version < "4.0"
jaeger-client==4.8.0; python_version >= "3.7"
jinja2==3.0.3; python_version >= "3.6"
@@ -119,13 +120,13 @@ nodeenv==1.6.0; python_full_version >= "3.6.1"
oauthlib==3.2.0; python_version >= "3.6"
openpyxl==3.0.9; python_version >= "3.6"
opentracing==2.4.0
-packaging==21.3; python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.7"
+packaging==21.3; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
pathspec==0.9.0; python_full_version >= "3.6.2"
petl==1.7.4; (python_version >= "2.7" and python_full_version < "3.0.0") or (python_full_version >= "3.4.0")
phonenumberslite==8.12.42
pillow==9.0.0; python_version >= "3.7"
platformdirs==2.4.1; python_version >= "3.7" and python_full_version >= "3.6.2"
-pluggy==1.0.0; python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.7"
+pluggy==1.0.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
pre-commit==2.17.0; python_full_version >= "3.6.1"
prices==1.1.0
promise==2.3; python_version >= "3.6" and python_version < "4.0"
@@ -133,7 +134,7 @@ prompt-toolkit==3.0.26; python_full_version >= "3.6.2" and python_version >= "3.
proto-plus==1.19.9; python_version >= "3.6"
protobuf==3.19.4
psycopg2-binary==2.9.3; python_version >= "3.6"
-py==1.11.0; python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.7"
+py==1.11.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
pyasn1-modules==0.2.8; python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version >= "3.7"
pyasn1==0.4.8; python_version >= "3.7" and python_full_version < "3.0.0" and python_version < "4" and (python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version >= "3.7") or python_full_version >= "3.6.0" and python_version >= "3.7" and python_version < "4" and (python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version >= "3.7")
pybars3==0.9.7
@@ -148,7 +149,7 @@ pylint-django==2.5.0
pylint-plugin-utils==0.7; python_full_version >= "3.6.2"
pylint==2.12.2; python_full_version >= "3.6.2"
pymeta3==0.5.1
-pyparsing==3.0.7; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
+pyparsing==3.0.7; python_version >= "3.6"
pyphen==0.12.0; python_version >= "3.7"
pytest-celery==0.0.0
pytest-cov==3.0.0; python_version >= "3.6"
@@ -168,7 +169,7 @@ python-magic-bin==0.4.14; sys_platform == "win32"
python-magic==0.4.24; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0"
python-slugify==4.0.1; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version < "3.10"
pytimeparse==1.1.8
-pytz==2021.3; python_version >= "3.6" and python_full_version < "3.0.0" and python_version < "4.0" or python_full_version >= "3.4.0" and python_version >= "3.6" and python_version < "4.0"
+pytz==2021.3; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6"
pywatchman==1.4.1
pyxb==1.2.5
pyyaml==6.0; python_version >= "3.6" and python_full_version >= "3.6.1"
@@ -185,7 +186,7 @@ six==1.16.0; python_full_version >= "3.6.1" and python_version < "3.10" and pyth
smmap==5.0.0; python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version < "3.10" and python_version >= "3.7"
snowballstemmer==2.2.0; python_version >= "3.6"
soupsieve==2.3.1; python_version >= "3.6"
-sqlparse==0.4.2; python_version >= "3.6" and python_version < "4.0"
+sqlparse==0.4.2; python_version >= "3.6"
starkbank-ecdsa==2.0.3; python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0"
stripe==2.65.0; (python_version >= "2.7" and python_full_version < "3.0.0") or (python_full_version >= "3.4.0")
sympy==1.9; python_version >= "3.6"
@@ -193,7 +194,7 @@ text-unidecode==1.3
threadloop==1.0.2; python_version >= "3.7"
thrift==0.15.0; python_version >= "3.7"
tinycss2==1.1.1; python_version >= "3.6"
-toml==0.10.2; python_full_version >= "3.6.2" and python_version >= "3.6" and (python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0") and (python_version >= "3.5" and python_full_version < "3.0.0" or python_full_version >= "3.3.0" and python_version >= "3.5") and (python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.3.0" and python_version >= "3.7") and (python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.3.0" and python_version >= "3.6")
+toml==0.10.2; python_full_version >= "3.6.2" and python_version >= "3.6" and (python_version >= "2.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0") and (python_version >= "3.5" and python_full_version < "3.0.0" or python_full_version >= "3.3.0" and python_version >= "3.5") and (python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.3.0" and python_version >= "3.6")
tomli==1.2.3; python_version >= "3.7" and python_full_version >= "3.6.2" and (python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.7")
tornado==6.1; python_version >= "3.7"
tox==3.24.5; (python_version >= "2.7" and python_full_version < "3.0.0") or (python_full_version >= "3.5.0")
@@ -206,7 +207,7 @@ types-urllib3==1.26.8
typing-extensions==4.0.1; python_version >= "3.6" and python_full_version >= "3.6.2" and python_version < "3.10"
typing-inspect==0.7.1; python_version >= "3.6"
unidecode==1.3.2; python_version >= "3.6" and python_version < "4.0"
-urllib3==1.26.8; python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version < "3.10" and python_version >= "3.7"
+urllib3==1.26.8; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version < "3.10" and python_version >= "3.6"
uvicorn==0.13.4
uvloop==0.16.0; sys_platform != "win32" and sys_platform != "cygwin" and platform_python_implementation != "PyPy" and python_version >= "3.7"
vcrpy==4.1.1; python_version >= "3.5"
@@ -217,7 +218,7 @@ wcwidth==0.2.5; python_full_version >= "3.6.2" and python_version >= "3.6"
weasyprint==54.0; python_version >= "3.6"
webencodings==0.5.1; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
websockets==8.1; python_full_version >= "3.6.1"
-wrapt==1.13.3; python_full_version >= "3.6.2" and python_version >= "3.5" and (python_version >= "3.6" and python_full_version < "3.0.0" or python_version >= "3.6" and python_full_version >= "3.5.0")
+wrapt==1.13.3; python_full_version >= "3.6.2" and python_version >= "3.5" and (python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6")
yarl==1.7.2; python_version >= "3.6"
zipp==3.7.0; python_version < "3.10" and python_version >= "3.7"
zopfli==0.1.9; python_version >= "3.7"
diff --git a/saleor/core/app.py b/saleor/core/app.py
index 75fb991ac5..d2d4ac359b 100644
--- a/saleor/core/app.py
+++ b/saleor/core/app.py
@@ -1,6 +1,7 @@
from django.apps import AppConfig
from django.conf import settings
from django.db.models import Field
+from django.utils.module_loading import import_string
from .db.filters import PostgresILike
@@ -13,3 +14,20 @@ class CoreAppConfig(AppConfig):
if settings.SENTRY_DSN:
settings.SENTRY_INIT(settings.SENTRY_DSN, settings.SENTRY_OPTS)
+ self.validate_jwt_manager()
+
+ def validate_jwt_manager(self):
+ jwt_manager_path = getattr(settings, "JWT_MANAGER_PATH", None)
+ if not jwt_manager_path:
+ raise ImportError(
+ "Missing setting value for JWT Manager path - JWT_MANAGER_PATH"
+ )
+ try:
+ jwt_manager = import_string(jwt_manager_path)
+ except ImportError as e:
+ raise ImportError(f"Failed to import JWT manager: {e}.")
+
+ validate_method = getattr(jwt_manager, "validate_configuration", NotImplemented)
+ if validate_method is NotImplemented:
+ return
+ validate_method()
diff --git a/saleor/core/jwt.py b/saleor/core/jwt.py
index e4ae933e26..596ee249a1 100644
--- a/saleor/core/jwt.py
+++ b/saleor/core/jwt.py
@@ -8,14 +8,13 @@ from django.contrib.auth.models import Permission
from ..account.models import User
from ..app.models import App, AppExtension
+from .jwt_manager import get_jwt_manager
from .permissions import (
get_permission_names,
get_permissions_from_codenames,
get_permissions_from_names,
)
-JWT_ALGORITHM = "HS256"
-
JWT_ACCESS_TYPE = "access"
JWT_REFRESH_TYPE = "refresh"
JWT_THIRDPARTY_ACCESS_TYPE = "thirdparty"
@@ -60,11 +59,8 @@ def jwt_user_payload(
def jwt_encode(payload: Dict[str, Any]) -> str:
- return jwt.encode(
- payload,
- settings.SECRET_KEY, # type: ignore
- JWT_ALGORITHM,
- )
+ jwt_manager = get_jwt_manager()
+ return jwt_manager.encode(payload)
def jwt_decode_with_exception_handler(
@@ -77,12 +73,8 @@ def jwt_decode_with_exception_handler(
def jwt_decode(token: str, verify_expiration=settings.JWT_EXPIRE) -> Dict[str, Any]:
- return jwt.decode(
- token,
- settings.SECRET_KEY, # type: ignore
- algorithms=[JWT_ALGORITHM],
- options={"verify_exp": verify_expiration},
- )
+ jwt_manager = get_jwt_manager()
+ return jwt_manager.decode(token, verify_expiration)
def create_token(payload: Dict[str, Any], exp_delta: timedelta) -> str:
diff --git a/saleor/core/jwt_manager.py b/saleor/core/jwt_manager.py
new file mode 100644
index 0000000000..46f9c85f61
--- /dev/null
+++ b/saleor/core/jwt_manager.py
@@ -0,0 +1,159 @@
+import json
+import logging
+from os.path import exists, join
+from typing import Union
+
+import jwt
+from cryptography.hazmat.primitives import serialization
+from cryptography.hazmat.primitives.asymmetric import rsa
+from django.conf import settings
+from django.core.exceptions import ImproperlyConfigured
+from django.core.management.color import color_style
+from django.utils.module_loading import import_string
+from jwt.algorithms import RSAAlgorithm
+
+logger = logging.getLogger(__name__)
+
+PUBLIC_KEY = None
+KID = "1"
+
+
+class JWTManagerBase:
+ @classmethod
+ def get_private_key(cls) -> rsa.RSAPrivateKey:
+ return NotImplemented
+
+ @classmethod
+ def get_public_key(cls) -> rsa.RSAPublicKey:
+ return NotImplemented
+
+ @classmethod
+ def encode(cls, payload: dict) -> str:
+ return NotImplemented
+
+ @classmethod
+ def decode(cls, token: str, verify_expiration: bool = True) -> dict:
+ return NotImplemented
+
+ @classmethod
+ def validate_configuration(cls):
+ return NotImplemented
+
+ @classmethod
+ def get_jwks(cls) -> dict:
+ return NotImplemented
+
+
+class JWTManager(JWTManagerBase):
+ KEY_FILE_FOR_DEBUG = ".jwt_key.pem"
+
+ @classmethod
+ def get_private_key(cls) -> rsa.RSAPrivateKey:
+ pem = settings.RSA_PRIVATE_KEY
+ if not pem and settings.DEBUG:
+ return cls._load_debug_private_key()
+ return cls._get_private_key(pem) # type: ignore
+
+ @classmethod
+ def _get_private_key(cls, pem: Union[str, bytes]):
+ if isinstance(pem, str):
+ pem = pem.encode("utf-8")
+
+ password = settings.RSA_PRIVATE_PASSWORD
+ if isinstance(password, str):
+ password = password.encode("utf-8") # type: ignore
+ return serialization.load_pem_private_key(
+ pem, password=password # type: ignore
+ )
+
+ @classmethod
+ def _load_debug_private_key(cls):
+ key_path = join(settings.PROJECT_ROOT, cls.KEY_FILE_FOR_DEBUG)
+ if exists(key_path):
+ return cls._load_local_private_key(key_path)
+
+ return cls._create_local_private_key(key_path)
+
+ @classmethod
+ def _load_local_private_key(cls, path) -> "rsa.RSAPrivateKey":
+ with open(path, "rb") as key_file:
+ return serialization.load_pem_private_key(
+ key_file.read(), password=None
+ ) # type: ignore
+
+ @classmethod
+ def _create_local_private_key(cls, path) -> "rsa.RSAPrivateKey":
+ private_key = rsa.generate_private_key(
+ public_exponent=65537,
+ key_size=2048,
+ )
+ with open(path, "wb") as p_key_file:
+ p_key_file.write(
+ private_key.private_bytes(
+ encoding=serialization.Encoding.PEM,
+ format=serialization.PrivateFormat.TraditionalOpenSSL,
+ encryption_algorithm=serialization.NoEncryption(),
+ )
+ )
+ return private_key
+
+ @classmethod
+ def get_public_key(cls, *_args, **_kwargs):
+ private_key = cls.get_private_key()
+ global PUBLIC_KEY
+ if PUBLIC_KEY is None:
+ PUBLIC_KEY = private_key.public_key()
+ return PUBLIC_KEY
+
+ @classmethod
+ def get_jwks(cls) -> dict:
+ jwk_dict = json.loads(RSAAlgorithm.to_jwk(cls.get_public_key()))
+ jwk_dict.update({"use": "sig", "kid": KID})
+ return {"keys": [jwk_dict]}
+
+ @classmethod
+ def encode(cls, payload):
+ return jwt.encode(
+ payload, cls.get_private_key(), algorithm="RS256", headers={"kid": KID}
+ )
+
+ @classmethod
+ def decode(cls, token, verify_expiration: bool = True):
+ headers = jwt.get_unverified_header(token)
+ if headers.get("alg") == "RS256":
+ return jwt.decode(
+ token,
+ cls.get_public_key(),
+ algorithms=["RS256"],
+ options={"verify_exp": verify_expiration},
+ )
+ return jwt.decode(
+ token,
+ settings.SECRET_KEY, # type: ignore
+ algorithms=["HS256"],
+ options={"verify_exp": verify_expiration},
+ )
+
+ @classmethod
+ def validate_configuration(cls):
+ if not settings.RSA_PRIVATE_KEY:
+ if not settings.DEBUG:
+ raise ImproperlyConfigured(
+ "Variable RSA_PRIVATE_KEY is not provided. "
+ "It is required for running in not DEBUG mode."
+ )
+ else:
+ msg = (
+ "RSA_PRIVATE_KEY is missing. Using temporary key for local "
+ "development with DEBUG mode."
+ )
+ logger.warning(color_style().WARNING(msg))
+
+ try:
+ cls.get_private_key()
+ except Exception as e:
+ raise ImproperlyConfigured(f"Unable to load provided PEM private key. {e}")
+
+
+def get_jwt_manager() -> JWTManagerBase:
+ return import_string(settings.JWT_MANAGER_PATH)
diff --git a/saleor/core/tests/test_auth_backend_default_header.py b/saleor/core/tests/test_auth_backend_default_header.py
index 2a8249e1d4..f4058e5597 100644
--- a/saleor/core/tests/test_auth_backend_default_header.py
+++ b/saleor/core/tests/test_auth_backend_default_header.py
@@ -7,7 +7,6 @@ from jwt import ExpiredSignatureError, InvalidSignatureError, InvalidTokenError
from ..auth_backend import JSONWebTokenBackend
from ..jwt import (
JWT_ACCESS_TYPE,
- JWT_ALGORITHM,
create_access_token,
create_access_token_for_app,
create_refresh_token,
@@ -96,7 +95,7 @@ def test_incorrect_token(prefix, rf, staff_user, settings):
token = jwt.encode(
payload,
"Wrong secret",
- JWT_ALGORITHM,
+ "HS256",
)
request = rf.request(HTTP_AUTHORIZATION=f"{prefix} {token}")
backend = JSONWebTokenBackend()
diff --git a/saleor/core/tests/test_auth_backend_saleor_header.py b/saleor/core/tests/test_auth_backend_saleor_header.py
index 093e8fca69..f42a9ce291 100644
--- a/saleor/core/tests/test_auth_backend_saleor_header.py
+++ b/saleor/core/tests/test_auth_backend_saleor_header.py
@@ -7,7 +7,6 @@ from jwt import ExpiredSignatureError, InvalidSignatureError, InvalidTokenError
from ..auth_backend import JSONWebTokenBackend
from ..jwt import (
JWT_ACCESS_TYPE,
- JWT_ALGORITHM,
create_access_token,
create_access_token_for_app,
create_refresh_token,
@@ -93,7 +92,7 @@ def test_incorrect_token(rf, staff_user, settings):
token = jwt.encode(
payload,
"Wrong secret",
- JWT_ALGORITHM,
+ "HS256",
)
request = rf.request(HTTP_AUTHORIZATION_BEARER=f"{token}")
backend = JSONWebTokenBackend()
diff --git a/saleor/core/tests/test_jwt.py b/saleor/core/tests/test_jwt.py
index 277bbfe47e..562ab44154 100644
--- a/saleor/core/tests/test_jwt.py
+++ b/saleor/core/tests/test_jwt.py
@@ -1,6 +1,8 @@
import graphene
+import jwt
+from cryptography.hazmat.primitives import serialization
-from ..jwt import create_access_token_for_app_extension, jwt_decode
+from ..jwt import create_access_token_for_app_extension, jwt_decode, jwt_encode
def test_create_access_token_for_app_extension_staff_user_with_more_permissions(
@@ -63,3 +65,42 @@ def test_create_access_token_for_app_extension_with_more_permissions(
decoded_token["app_extension"]
)
assert int(decode_extension_id) == extension.id
+
+
+def test_jwt_decode_accepts_token_signed_with_hs256(settings):
+ # given
+ payload = {"1": "A", "2": "B"}
+ token = jwt.encode(payload, settings.SECRET_KEY, algorithm="HS256")
+
+ # when
+ decoded_token = jwt_decode(token)
+
+ # then
+ assert payload == decoded_token
+
+
+def test_jwt_decode_accepts_token_signed_with_rs256(settings):
+ # given
+ private_key = serialization.load_pem_private_key(
+ settings.RSA_PRIVATE_KEY.encode("utf-8"), password=settings.RSA_PRIVATE_PASSWORD
+ )
+ payload = {"1": "A", "2": "B"}
+ token = jwt.encode(payload, private_key, algorithm="RS256")
+
+ # when
+ decoded_token = jwt_decode(token)
+
+ # then
+ assert payload == decoded_token
+
+
+def test_jwt_encode_creates_token_signed_with_rs256(settings):
+ # given
+ payload = {"1": "A", "2": "B"}
+
+ # when
+ token = jwt_encode(payload)
+
+ # then
+ headers = jwt.get_unverified_header(token)
+ assert headers.get("alg") == "RS256"
diff --git a/saleor/core/tests/test_jwt_manager.py b/saleor/core/tests/test_jwt_manager.py
new file mode 100644
index 0000000000..637a4cf982
--- /dev/null
+++ b/saleor/core/tests/test_jwt_manager.py
@@ -0,0 +1,89 @@
+import jwt
+import pytest
+from cryptography.hazmat.primitives import serialization
+from django.core.exceptions import ImproperlyConfigured
+from django.test import override_settings
+
+from ..jwt_manager import JWTManager, get_jwt_manager
+
+
+def test_get_jwt_manager(settings):
+ # given
+ assert settings.JWT_MANAGER_PATH == "saleor.core.jwt_manager.JWTManager"
+
+ # when
+ jwt_manager = get_jwt_manager()
+
+ # then
+ assert jwt_manager == JWTManager
+
+
+@override_settings(RSA_PRIVATE_KEY=None)
+def test_jwt_manager_validate_missing_rsa_private_key(settings):
+ # given
+ jwt_manager = get_jwt_manager()
+
+ # when & then
+ with pytest.raises(ImproperlyConfigured):
+ jwt_manager.validate_configuration()
+
+
+@override_settings(RSA_PRIVATE_KEY="WRONG-FORMAT")
+def test_jwt_manager_validate_incorect_format_of_rsa_private_key(settings):
+ # given
+ jwt_manager = get_jwt_manager()
+
+ # when & then
+ with pytest.raises(ImproperlyConfigured):
+ jwt_manager.validate_configuration()
+
+
+def test_jwt_manager_encode(settings):
+ # given
+ payload = {"A": "1", "B": "2"}
+ jwt_manager = get_jwt_manager()
+ private_key = serialization.load_pem_private_key(
+ settings.RSA_PRIVATE_KEY.encode("utf-8"), password=settings.RSA_PRIVATE_PASSWORD
+ )
+
+ # when
+ token = jwt_manager.encode(payload)
+
+ # then
+ headers = jwt.get_unverified_header(token)
+ decoded_token = jwt.decode(
+ token,
+ private_key.public_key(),
+ algorithms=["RS256"],
+ )
+ assert headers.get("alg") == "RS256"
+ assert decoded_token == payload
+
+
+def test_jwt_manager_decode_token_signed_with_rs256(settings):
+ # given
+ payload = {"A": "1", "B": "2"}
+ private_key = serialization.load_pem_private_key(
+ settings.RSA_PRIVATE_KEY.encode("utf-8"), password=settings.RSA_PRIVATE_PASSWORD
+ )
+ token = jwt.encode(payload, private_key, algorithm="RS256")
+ jwt_manager = get_jwt_manager()
+
+ # when
+ decoded_token = jwt_manager.decode(token)
+
+ # then
+ assert decoded_token == payload
+
+
+def test_jwt_manager_decode_token_signed_with_hs256(settings):
+ # given
+ payload = {"A": "1", "B": "2"}
+ token = jwt.encode(payload, settings.SECRET_KEY, algorithm="HS256")
+ jwt_manager = get_jwt_manager()
+
+ # when
+ decoded_token = jwt_manager.decode(token)
+
+ # then
+ assert decoded_token == payload
diff --git a/saleor/core/tests/test_view.py b/saleor/core/tests/test_view.py
new file mode 100644
index 0000000000..7d8f873c3c
--- /dev/null
+++ b/saleor/core/tests/test_view.py
@@ -0,0 +1,18 @@
+import jwt
+from jwt import PyJWK
+
+from ..jwt_manager import get_jwt_manager
+
+
+def test_jwks_can_be_used_to_decode_saleor_token(client):
+ # given
+ jwt_manager = get_jwt_manager()
+ payload = {"A": "1", "B": "2", "C": "3"}
+ token = jwt_manager.encode(payload)
+
+ # when
+ response = client.get("/.well-known/jwks.json")
+ key = response.json().get("keys")[0]
+
+ # then
+ jwt.decode(token, PyJWK.from_dict(key, algorithm="RS256").key, algorithms=["RS256"])
diff --git a/saleor/core/views.py b/saleor/core/views.py
index 36d9c22b79..2cb38fa176 100644
--- a/saleor/core/views.py
+++ b/saleor/core/views.py
@@ -1,7 +1,10 @@
import os
+from django.http import JsonResponse
from django.template.response import TemplateResponse
+from .jwt_manager import get_jwt_manager
+
def home(request):
storefront_url = os.environ.get("STOREFRONT_URL", "")
@@ -11,3 +14,7 @@ def home(request):
"home/index.html",
{"storefront_url": storefront_url, "dashboard_url": dashboard_url},
)
+
+
+def jwks(request):
+ return JsonResponse(get_jwt_manager().get_jwks())
diff --git a/saleor/settings.py b/saleor/settings.py
index c715a9d118..b49978e827 100644
--- a/saleor/settings.py
+++ b/saleor/settings.py
@@ -177,6 +177,12 @@ if not SECRET_KEY and DEBUG:
warnings.warn("SECRET_KEY not configured, using a random temporary key.")
SECRET_KEY = get_random_secret_key()
+RSA_PRIVATE_KEY = os.environ.get("RSA_PRIVATE_KEY", None)
+RSA_PRIVATE_PASSWORD = os.environ.get("RSA_PRIVATE_PASSWORD", None)
+JWT_MANAGER_PATH = os.environ.get(
+ "JWT_MANAGER_PATH", "saleor.core.jwt_manager.JWTManager"
+)
+
MIDDLEWARE = [
"django.middleware.security.SecurityMiddleware",
"django.middleware.common.CommonMiddleware",
diff --git a/saleor/tests/settings.py b/saleor/tests/settings.py
index 17d5d2d8b0..3a5167c1dc 100644
--- a/saleor/tests/settings.py
+++ b/saleor/tests/settings.py
@@ -54,4 +54,32 @@ JWT_EXPIRE = True
DEFAULT_CHANNEL_SLUG = "main"
+RSA_PRIVATE_KEY = """-----BEGIN RSA PRIVATE KEY-----
+MIIEpQIBAAKCAQEAmjTsKENcArpmBM0E74xHAYj3bYJuPMsnBjvPC1sGJKYTvmzn
+5r74ogouzYSqVJGMZcVCMi6IOyJZXsDWz9YB5bJvOu8rKgzkh2wBgDvYAwnOlaBo
+MKAQn2dxdeP4D4cTGqFPTh17bTwP9aNyXUs8+RE3U6U28AUywBTHLAiq/NlaUETt
+HFddB6FTxrMCA/8x9tarSW4+uYP15HgvKRdf5VtG7/RpMRpI2xvYwjVRqhJkcqhW
+Z/zLWURu0IxH0PuzqeKRP1q95vQvFLk8EIQfQbDHLRctpdkLcOKsbftYgVaLJv9z
+EivAZMZyJNx+bHhBhVOA9aLmnZizgZuCPfsnhQIDAQABAoIBAQCHYqNbjhgABSqA
+WIdW0O+eN2QT7wldsnZmkKfsLlQsZOq8qtzGxy9/BDWnFix85vQ+fXrql9PfJv8T
+o3Z1LkyoH4psUYKx/nO9OWPv85powHlxAE25My6k5KrGeAlXiJ2LKch4qoWsl6jj
+XkaQBfhYK3dJpqme/NFbtmJPFKUaK1SdrtKDceuJGYrKw4xtzSN2ioiZEcb4jWNg
+p0pt4/nE/oQwXdKyvL07I4OHEeugu4JXd8OIrnvDOFRrfliHXoe+89Up8n42Q8O1
++qrnorCUIheFRdzcHqTh4O0QUXz0nxSQ0O4Nq08LCdNLDfe7y14/NGNko5sQbNGE
+5/AOJXuBAoGBAMrAS48NK1xU4wslM/B3DmeC+wvheCNZgUC0YhvaDe2Drd/KkqSK
++9NGQwkCOveHxROV5B4jgDijaimleLV8e9RAroJqYeCNmFP2Bja7EVzzOJjdItH0
+PWVrcLfvGlUz//KpHsA1tDpKguSdTvaMrbIsUQ9pW0zxo9tm14AAyssVAoGBAMK0
+zq47tzcCijpo5EZACr315m3jTSSFbVITlyJMIlrpd3kSj8S8QshxyuQv5XtpToVy
+rbF9Rsw0ZbX1BhTYXHXy2MJXeDyRdHFIXn/PmW5Ilad3wE957HEwUZ0kig0pPvTA
+YNLm48wWZeiKAxpKZh0mr5ZWq760/SfTv9lQiUaxAoGANxrUbmjR5CJeIuVVnIF/
+NLrwqGX7VQA6lO9xysgVCPzFARH5kScFEoMCLSyiAiywb4ZJnbdgXgRsEi2bBRh0
+P1flFiT7vSA+ynMPdUiai3y/YSyZDh8noKz20cb2jTm40qcMaIkwFrexo5jtoSzS
++J362gl0exEhy7vDzlJoy5ECgYEAgqlrealBTn053fC+IBaiHtCCDoRXJIcV0dqr
+tax58aBzOKCoMlJUTsdubKtnyOXmd895mH6FoEwZZX5E0oBPrCeIJwMkASFrjwoN
+wJ/ESyoSpAvM1ojvjxXp7xayPhrL0Nu5Hk8r163APclAQ8hhtnZbpvwKzTQQH0YO
+nPta5EECgYEAtGnUpVb1lfBT6HByscXJHViGxAblACFySPpHEYzf3ioaGnvUgf14
+FdkAmFzQhgLtnEtnb+eBI7DNOJEuPLD52Jwnq2pGnJ/LxlqjjWJ5FsQQVSoDHGfM
+8yodVX6OCKwHYrgleLjVWs5ZmaGfGpqcy1YgquiYGVF4x8qBe5bpwHw=
+-----END RSA PRIVATE KEY-----"""
+
DATABASE_CONNECTION_REPLICA_NAME = DATABASE_CONNECTION_DEFAULT_NAME # noqa: F405
diff --git a/saleor/urls.py b/saleor/urls.py
index 7cc90f8e9d..03abb7a4db 100644
--- a/saleor/urls.py
+++ b/saleor/urls.py
@@ -4,6 +4,7 @@ from django.conf.urls.static import static
from django.contrib.staticfiles.views import serve
from django.views.decorators.csrf import csrf_exempt
+from .core.views import jwks
from .graphql.api import schema
from .graphql.views import GraphQLView
from .plugins.views import (
@@ -36,6 +37,7 @@ urlpatterns = [
handle_plugin_webhook,
name="plugins",
),
+ url(r".well-known/jwks.json", jwks, name="jwks"),
]
if settings.DEBUG: