diff --git a/bookops_worldcat/__version__.py b/bookops_worldcat/__version__.py index 33f6473..98dd4fd 100644 --- a/bookops_worldcat/__version__.py +++ b/bookops_worldcat/__version__.py @@ -1,4 +1,4 @@ __title__ = "bookops-worldcat" -__version__ = "1.0.0" +__version__ = "1.0.2" __author__ = "Tomasz Kalata" __author_email__ = "klingaroo@gmail.com" diff --git a/bookops_worldcat/authorize.py b/bookops_worldcat/authorize.py index bea9fe0..8ffb24c 100644 --- a/bookops_worldcat/authorize.py +++ b/bookops_worldcat/authorize.py @@ -43,6 +43,7 @@ class WorldcatAccessToken: "expires_in": "1199", "principalID": "", "principalIDNS": "", + "scope": "WorldCatMetadataAPI", "scopes": "WorldCatMetadataAPI", "contextInstitutionId": "00001", "expires_at": "2020-08-23 18:45:29Z" diff --git a/dev-requirements.txt b/dev-requirements.txt index 434581a..a9ce8c4 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -27,9 +27,9 @@ black==24.3.0 ; python_version >= "3.8" and python_version < "4.0" \ --hash=sha256:d7de8d330763c66663661a1ffd432274a2f92f07feeddd89ffd085b5744f85e7 \ --hash=sha256:e19cb1c6365fd6dc38a6eae2dcb691d7d83935c10215aef8e6c38edee3f77abd \ --hash=sha256:e2af80566f43c85f5797365077fb64a393861a3730bd110971ab7a0c94e873e7 -certifi==2024.2.2 ; python_version >= "3.8" and python_version < "4.0" \ - --hash=sha256:0569859f95fc761b18b45ef421b1290a0f65f147e92a1e5eb3e635f9a5e4e66f \ - --hash=sha256:dc383c07b76109f368f6106eee2b593b04a011ea4d55f652c6ca24a754d1cdd1 +certifi==2024.7.4 ; python_version >= "3.8" and python_version < "4.0" \ + --hash=sha256:5a1e7645bc0ec61a09e26c36f6106dd4cf40c6db3a1fb6352b0244e7fb057c7b \ + --hash=sha256:c198e21b1289c2ab85ee4e67bb4b4ef3ead0892059901a8d5b622f24a1101e90 charset-normalizer==3.3.2 ; python_version >= "3.8" and python_version < "4.0" \ --hash=sha256:06435b539f889b1f6f4ac1758871aae42dc3a8c0e24ac9e60c2384973ad73027 \ --hash=sha256:06a81e93cd441c56a9b65d8e1d043daeb97a3d0856d177d5c90ba85acb3db087 \ @@ -201,9 +201,9 @@ importlib-resources==6.1.1 ; python_version >= "3.8" and python_version < "4.0" iniconfig==2.0.0 ; python_version >= "3.8" and python_version < "4.0" \ --hash=sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3 \ --hash=sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374 -jinja2==3.1.3 ; python_version >= "3.8" and python_version < "4.0" \ - --hash=sha256:7d6d50dd97d52cbc355597bd845fabfbac3f551e1f99619e39a35ce8c370b5fa \ - --hash=sha256:ac8bd6544d4bb2c9792bf3a159e80bba8fda7f07e81bc3aed565432d5925ba90 +jinja2==3.1.4 ; python_version >= "3.8" and python_version < "4.0" \ + --hash=sha256:4a3aee7acbbe7303aede8e9648d13b8bf88a429282aa6122a993f0ac800cb369 \ + --hash=sha256:bc5dd2abb727a5319567b7a813e6a2e7318c39f4f487cfe6c89c6f9c7d25197d markdown==3.5.2 ; python_version >= "3.8" and python_version < "4.0" \ --hash=sha256:d43323865d89fc0cb9b20c75fc8ad313af307cc087e84b657d9eec768eddeadd \ --hash=sha256:e1ac7b3dc550ee80e602e71c1d168002f062e49f1b11e26a36264dafd4df2ef8 @@ -509,9 +509,9 @@ regex==2023.12.25 ; python_version >= "3.8" and python_version < "4.0" \ --hash=sha256:f72cbae7f6b01591f90814250e636065850c5926751af02bb48da94dfced7baa \ --hash=sha256:f7bc09bc9c29ebead055bcba136a67378f03d66bf359e87d0f7c759d6d4ffa31 \ --hash=sha256:ff100b203092af77d1a5a7abe085b3506b7eaaf9abf65b73b7d6905b6cb76988 -requests==2.31.0 ; python_version >= "3.8" and python_version < "4.0" \ - --hash=sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f \ - --hash=sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1 +requests==2.32.3 ; python_version >= "3.8" and python_version < "4.0" \ + --hash=sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760 \ + --hash=sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6 six==1.16.0 ; python_version >= "3.8" and python_version < "4.0" \ --hash=sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926 \ --hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254 @@ -524,9 +524,9 @@ types-requests==2.31.0.20240125 ; python_version >= "3.8" and python_version < " typing-extensions==4.9.0 ; python_version >= "3.8" and python_version < "4.0" \ --hash=sha256:23478f88c37f27d76ac8aee6c905017a143b0b1b886c3c9f66bc2fd94f9f5783 \ --hash=sha256:af72aea155e91adfc61c3ae9e0e342dbc0cba726d6cba4b6c72c1f34e47291cd -urllib3==2.2.0 ; python_version >= "3.8" and python_version < "4.0" \ - --hash=sha256:051d961ad0c62a94e50ecf1af379c3aba230c66c710493493560c0c223c49f20 \ - --hash=sha256:ce3711610ddce217e6d113a2732fafad960a03fd0318c91faa79481e35c11224 +urllib3==2.2.2 ; python_version >= "3.8" and python_version < "4.0" \ + --hash=sha256:a448b2f64d686155468037e1ace9f2d2199776e17f0a46610480d311f73e3472 \ + --hash=sha256:dd505485549a7a552833da5e6063639d0d177c04f23bc3864e41e5dc5f612168 verspec==0.1.0 ; python_version >= "3.8" and python_version < "4.0" \ --hash=sha256:741877d5633cc9464c45a469ae2a31e801e6dbbaa85b9675d481cda100f11c31 \ --hash=sha256:c4504ca697b2056cdb4bfa7121461f5a0e81809255b41c03dda4ba823637c01e @@ -561,6 +561,6 @@ watchdog==3.0.0 ; python_version >= "3.8" and python_version < "4.0" \ wheel==0.43.0 ; python_version >= "3.8" and python_version < "3.9" \ --hash=sha256:465ef92c69fa5c5da2d1cf8ac40559a8c940886afcef87dcf14b9470862f1d85 \ --hash=sha256:55c570405f142630c6b9f72fe09d9b67cf1477fcf543ae5b8dcb1f5b7377da81 -zipp==3.17.0 ; python_version >= "3.8" and python_version < "4.0" \ - --hash=sha256:0e923e726174922dce09c53c59ad483ff7bbb8e572e00c7f7c46b88556409f31 \ - --hash=sha256:84e64a1c28cf7e91ed2078bb8cc8c259cb19b76942096c8d7b84947690cabaf0 +zipp==3.19.2 ; python_version >= "3.8" and python_version < "4.0" \ + --hash=sha256:bf1dcf6450f873a13e952a29504887c89e6de7506209e5b1bcc3460135d4de19 \ + --hash=sha256:f091755f667055f2d02b32c53771a7a6c8b47e1fdbc4b72a8b9072b3eef8015c diff --git a/docs/advanced.md b/docs/advanced.md index 84b6e27..7d14f94 100644 --- a/docs/advanced.md +++ b/docs/advanced.md @@ -43,7 +43,8 @@ Detailed information can be accessed using the `.json()` method. "expires_at": "2024-03-14 19:52:37Z", "authenticating_institution_id": "00001", "principalID": "", - "context_institution_id": "00001", + "context_institution_id": "00001", + "scope": "WorldCatMetadataAPI:view_brief_bib", "scopes": "WorldCatMetadataAPI:view_brief_bib", "token_type": "bearer", "expires_in": 1199, diff --git a/docs/changelog.md b/docs/changelog.md index c2dde45..957a0ea 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,5 +1,15 @@ # Changelog +## [1.0.2] - (7/25/2024) +### Changed ++ Updated dependencies: + + certifi (2024.7.4) + + jinja2 (3.1.4) + + requests (2.32.3) + + urllib3 (2.2.2) + + zipp (3.19.2) ++ Documentation and tests to account for `scope` as available parameter for OCLC Authorization Server + ## [1.0.1] - (5/1/2024) ### Fixed + Inconsistent default values for `timeout` arg for `MetadataSession`, `WorldcatAccessToken` and `Query` objects diff --git a/poetry.lock b/poetry.lock index a955f33..fb7f8ad 100644 --- a/poetry.lock +++ b/poetry.lock @@ -80,13 +80,13 @@ uvloop = ["uvloop (>=0.15.2)"] [[package]] name = "certifi" -version = "2024.2.2" +version = "2024.7.4" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.6" files = [ - {file = "certifi-2024.2.2-py3-none-any.whl", hash = "sha256:dc383c07b76109f368f6106eee2b593b04a011ea4d55f652c6ca24a754d1cdd1"}, - {file = "certifi-2024.2.2.tar.gz", hash = "sha256:0569859f95fc761b18b45ef421b1290a0f65f147e92a1e5eb3e635f9a5e4e66f"}, + {file = "certifi-2024.7.4-py3-none-any.whl", hash = "sha256:c198e21b1289c2ab85ee4e67bb4b4ef3ead0892059901a8d5b622f24a1101e90"}, + {file = "certifi-2024.7.4.tar.gz", hash = "sha256:5a1e7645bc0ec61a09e26c36f6106dd4cf40c6db3a1fb6352b0244e7fb057c7b"}, ] [[package]] @@ -387,13 +387,13 @@ files = [ [[package]] name = "jinja2" -version = "3.1.3" +version = "3.1.4" description = "A very fast and expressive template engine." optional = false python-versions = ">=3.7" files = [ - {file = "Jinja2-3.1.3-py3-none-any.whl", hash = "sha256:7d6d50dd97d52cbc355597bd845fabfbac3f551e1f99619e39a35ce8c370b5fa"}, - {file = "Jinja2-3.1.3.tar.gz", hash = "sha256:ac8bd6544d4bb2c9792bf3a159e80bba8fda7f07e81bc3aed565432d5925ba90"}, + {file = "jinja2-3.1.4-py3-none-any.whl", hash = "sha256:bc5dd2abb727a5319567b7a813e6a2e7318c39f4f487cfe6c89c6f9c7d25197d"}, + {file = "jinja2-3.1.4.tar.gz", hash = "sha256:4a3aee7acbbe7303aede8e9648d13b8bf88a429282aa6122a993f0ac800cb369"}, ] [package.dependencies] @@ -1081,13 +1081,13 @@ files = [ [[package]] name = "requests" -version = "2.31.0" +version = "2.32.3" description = "Python HTTP for Humans." optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "requests-2.31.0-py3-none-any.whl", hash = "sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f"}, - {file = "requests-2.31.0.tar.gz", hash = "sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1"}, + {file = "requests-2.32.3-py3-none-any.whl", hash = "sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6"}, + {file = "requests-2.32.3.tar.gz", hash = "sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760"}, ] [package.dependencies] @@ -1149,13 +1149,13 @@ files = [ [[package]] name = "urllib3" -version = "2.2.0" +version = "2.2.2" description = "HTTP library with thread-safe connection pooling, file post, and more." optional = false python-versions = ">=3.8" files = [ - {file = "urllib3-2.2.0-py3-none-any.whl", hash = "sha256:ce3711610ddce217e6d113a2732fafad960a03fd0318c91faa79481e35c11224"}, - {file = "urllib3-2.2.0.tar.gz", hash = "sha256:051d961ad0c62a94e50ecf1af379c3aba230c66c710493493560c0c223c49f20"}, + {file = "urllib3-2.2.2-py3-none-any.whl", hash = "sha256:a448b2f64d686155468037e1ace9f2d2199776e17f0a46610480d311f73e3472"}, + {file = "urllib3-2.2.2.tar.gz", hash = "sha256:dd505485549a7a552833da5e6063639d0d177c04f23bc3864e41e5dc5f612168"}, ] [package.extras] @@ -1233,18 +1233,18 @@ test = ["pytest (>=6.0.0)", "setuptools (>=65)"] [[package]] name = "zipp" -version = "3.17.0" +version = "3.19.2" description = "Backport of pathlib-compatible object wrapper for zip files" optional = false python-versions = ">=3.8" files = [ - {file = "zipp-3.17.0-py3-none-any.whl", hash = "sha256:0e923e726174922dce09c53c59ad483ff7bbb8e572e00c7f7c46b88556409f31"}, - {file = "zipp-3.17.0.tar.gz", hash = "sha256:84e64a1c28cf7e91ed2078bb8cc8c259cb19b76942096c8d7b84947690cabaf0"}, + {file = "zipp-3.19.2-py3-none-any.whl", hash = "sha256:f091755f667055f2d02b32c53771a7a6c8b47e1fdbc4b72a8b9072b3eef8015c"}, + {file = "zipp-3.19.2.tar.gz", hash = "sha256:bf1dcf6450f873a13e952a29504887c89e6de7506209e5b1bcc3460135d4de19"}, ] [package.extras] -docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (<7.2.5)", "sphinx (>=3.5)", "sphinx-lint"] -testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-ignore-flaky", "pytest-mypy (>=0.9.1)", "pytest-ruff"] +doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] +test = ["big-O", "importlib-resources", "jaraco.functools", "jaraco.itertools", "jaraco.test", "more-itertools", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-ignore-flaky", "pytest-mypy", "pytest-ruff (>=0.2.1)"] [metadata] lock-version = "2.0" diff --git a/requirements.txt b/requirements.txt index b4132b6..d135348 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ -certifi==2024.2.2 ; python_version >= "3.8" and python_version < "4.0" \ - --hash=sha256:0569859f95fc761b18b45ef421b1290a0f65f147e92a1e5eb3e635f9a5e4e66f \ - --hash=sha256:dc383c07b76109f368f6106eee2b593b04a011ea4d55f652c6ca24a754d1cdd1 +certifi==2024.7.4 ; python_version >= "3.8" and python_version < "4.0" \ + --hash=sha256:5a1e7645bc0ec61a09e26c36f6106dd4cf40c6db3a1fb6352b0244e7fb057c7b \ + --hash=sha256:c198e21b1289c2ab85ee4e67bb4b4ef3ead0892059901a8d5b622f24a1101e90 charset-normalizer==3.3.2 ; python_version >= "3.8" and python_version < "4.0" \ --hash=sha256:06435b539f889b1f6f4ac1758871aae42dc3a8c0e24ac9e60c2384973ad73027 \ --hash=sha256:06a81e93cd441c56a9b65d8e1d043daeb97a3d0856d177d5c90ba85acb3db087 \ @@ -95,9 +95,9 @@ charset-normalizer==3.3.2 ; python_version >= "3.8" and python_version < "4.0" \ idna==3.7 ; python_version >= "3.8" and python_version < "4.0" \ --hash=sha256:028ff3aadf0609c1fd278d8ea3089299412a7a8b9bd005dd08b9f8285bcb5cfc \ --hash=sha256:82fee1fc78add43492d3a1898bfa6d8a904cc97d8427f683ed8e798d07761aa0 -requests==2.31.0 ; python_version >= "3.8" and python_version < "4.0" \ - --hash=sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f \ - --hash=sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1 -urllib3==2.2.0 ; python_version >= "3.8" and python_version < "4.0" \ - --hash=sha256:051d961ad0c62a94e50ecf1af379c3aba230c66c710493493560c0c223c49f20 \ - --hash=sha256:ce3711610ddce217e6d113a2732fafad960a03fd0318c91faa79481e35c11224 +requests==2.32.3 ; python_version >= "3.8" and python_version < "4.0" \ + --hash=sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760 \ + --hash=sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6 +urllib3==2.2.2 ; python_version >= "3.8" and python_version < "4.0" \ + --hash=sha256:a448b2f64d686155468037e1ace9f2d2199776e17f0a46610480d311f73e3472 \ + --hash=sha256:dd505485549a7a552833da5e6063639d0d177c04f23bc3864e41e5dc5f612168 diff --git a/tests/conftest.py b/tests/conftest.py index 9532720..e02bfcf 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -74,6 +74,7 @@ def json(self): "expires_in": "1199", "principalID": "", "principalIDNS": "", + "scope": "scope1", "scopes": "scope1", "contextInstitutionId": "00001", "expires_at": expires_at, diff --git a/tests/test_authorize.py b/tests/test_authorize.py index 84a7f1c..4a97fb7 100644 --- a/tests/test_authorize.py +++ b/tests/test_authorize.py @@ -326,6 +326,7 @@ def test_post_token_request_with_live_service(self, live_keys): "authenticating_institution_id", "principalID", "context_institution_id", + "scope", "scopes", "token_type", "expires_in", @@ -339,6 +340,7 @@ def test_post_token_request_with_live_service(self, live_keys): # test if token looks right assert token.token_str.startswith("tk_") + assert response["scopes"] == response["scope"] assert token.is_expired() is False assert isinstance(token.token_expires_at, datetime.datetime) @@ -361,6 +363,7 @@ def test_post_token_request_with_live_service_no_timeout(self, live_keys): "authenticating_institution_id", "principalID", "context_institution_id", + "scope", "scopes", "token_type", "expires_in", @@ -374,5 +377,6 @@ def test_post_token_request_with_live_service_no_timeout(self, live_keys): # test if token looks right assert token.token_str.startswith("tk_") + assert response["scopes"] == response["scope"] assert token.is_expired() is False assert isinstance(token.token_expires_at, datetime.datetime) diff --git a/tests/test_version.py b/tests/test_version.py index 0c9388a..c919159 100644 --- a/tests/test_version.py +++ b/tests/test_version.py @@ -10,7 +10,7 @@ def test_version(): - assert __version__ == "1.0.0" + assert __version__ == "1.0.2" def test_title():