Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authorization server scope changes #111

Merged
merged 3 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bookops_worldcat/__version__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__title__ = "bookops-worldcat"
__version__ = "1.0.0"
__version__ = "1.0.2"
__author__ = "Tomasz Kalata"
__author_email__ = "klingaroo@gmail.com"
1 change: 1 addition & 0 deletions bookops_worldcat/authorize.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
30 changes: 15 additions & 15 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
3 changes: 2 additions & 1 deletion docs/advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
10 changes: 10 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
36 changes: 18 additions & 18 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -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 \
Expand Down Expand Up @@ -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
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def json(self):
"expires_in": "1199",
"principalID": "",
"principalIDNS": "",
"scope": "scope1",
"scopes": "scope1",
"contextInstitutionId": "00001",
"expires_at": expires_at,
Expand Down
4 changes: 4 additions & 0 deletions tests/test_authorize.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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)

Expand All @@ -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",
Expand All @@ -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)
2 changes: 1 addition & 1 deletion tests/test_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


def test_version():
assert __version__ == "1.0.0"
assert __version__ == "1.0.2"


def test_title():
Expand Down