Authlib 1.6.4__tar.gz → 1.6.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) hide show
  1. {authlib-1.6.4 → authlib-1.6.6}/Authlib.egg-info/PKG-INFO +1 -1
  2. {authlib-1.6.4 → authlib-1.6.6}/PKG-INFO +1 -1
  3. {authlib-1.6.4 → authlib-1.6.6}/authlib/__init__.py +2 -1
  4. {authlib-1.6.4 → authlib-1.6.6}/authlib/consts.py +1 -1
  5. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/base_client/framework_integration.py +13 -12
  6. {authlib-1.6.4 → authlib-1.6.6}/authlib/jose/rfc7515/jws.py +5 -0
  7. authlib-1.6.6/authlib/jose/rfc7518/jwe_zips.py +34 -0
  8. {authlib-1.6.4 → authlib-1.6.6}/authlib/jose/util.py +6 -0
  9. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth1/rfc5849/client_auth.py +2 -0
  10. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc6749/parameters.py +8 -3
  11. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc6749/wrappers.py +12 -1
  12. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc7591/endpoint.py +25 -6
  13. {authlib-1.6.4 → authlib-1.6.6}/authlib/oidc/core/grants/code.py +16 -4
  14. {authlib-1.6.4 → authlib-1.6.6}/authlib/oidc/core/grants/implicit.py +16 -4
  15. authlib-1.6.4/authlib/jose/rfc7518/jwe_zips.py +0 -23
  16. {authlib-1.6.4 → authlib-1.6.6}/Authlib.egg-info/SOURCES.txt +0 -0
  17. {authlib-1.6.4 → authlib-1.6.6}/Authlib.egg-info/dependency_links.txt +0 -0
  18. {authlib-1.6.4 → authlib-1.6.6}/Authlib.egg-info/requires.txt +0 -0
  19. {authlib-1.6.4 → authlib-1.6.6}/Authlib.egg-info/top_level.txt +0 -0
  20. {authlib-1.6.4 → authlib-1.6.6}/LICENSE +0 -0
  21. {authlib-1.6.4 → authlib-1.6.6}/MANIFEST.in +0 -0
  22. {authlib-1.6.4 → authlib-1.6.6}/README.md +0 -0
  23. {authlib-1.6.4 → authlib-1.6.6}/authlib/common/__init__.py +0 -0
  24. {authlib-1.6.4 → authlib-1.6.6}/authlib/common/encoding.py +0 -0
  25. {authlib-1.6.4 → authlib-1.6.6}/authlib/common/errors.py +0 -0
  26. {authlib-1.6.4 → authlib-1.6.6}/authlib/common/security.py +0 -0
  27. {authlib-1.6.4 → authlib-1.6.6}/authlib/common/urls.py +0 -0
  28. {authlib-1.6.4 → authlib-1.6.6}/authlib/deprecate.py +0 -0
  29. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/__init__.py +0 -0
  30. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/base_client/__init__.py +0 -0
  31. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/base_client/async_app.py +0 -0
  32. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/base_client/async_openid.py +0 -0
  33. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/base_client/errors.py +0 -0
  34. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/base_client/registry.py +0 -0
  35. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/base_client/sync_app.py +0 -0
  36. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/base_client/sync_openid.py +0 -0
  37. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/django_client/__init__.py +0 -0
  38. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/django_client/apps.py +0 -0
  39. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/django_client/integration.py +0 -0
  40. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/django_oauth1/__init__.py +0 -0
  41. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/django_oauth1/authorization_server.py +0 -0
  42. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/django_oauth1/nonce.py +0 -0
  43. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/django_oauth1/resource_protector.py +0 -0
  44. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/django_oauth2/__init__.py +0 -0
  45. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/django_oauth2/authorization_server.py +0 -0
  46. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/django_oauth2/endpoints.py +0 -0
  47. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/django_oauth2/requests.py +0 -0
  48. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/django_oauth2/resource_protector.py +0 -0
  49. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/django_oauth2/signals.py +0 -0
  50. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/flask_client/__init__.py +0 -0
  51. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/flask_client/apps.py +0 -0
  52. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/flask_client/integration.py +0 -0
  53. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/flask_oauth1/__init__.py +0 -0
  54. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/flask_oauth1/authorization_server.py +0 -0
  55. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/flask_oauth1/cache.py +0 -0
  56. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/flask_oauth1/resource_protector.py +0 -0
  57. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/flask_oauth2/__init__.py +0 -0
  58. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/flask_oauth2/authorization_server.py +0 -0
  59. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/flask_oauth2/errors.py +0 -0
  60. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/flask_oauth2/requests.py +0 -0
  61. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/flask_oauth2/resource_protector.py +0 -0
  62. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/flask_oauth2/signals.py +0 -0
  63. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/httpx_client/__init__.py +0 -0
  64. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/httpx_client/assertion_client.py +0 -0
  65. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/httpx_client/oauth1_client.py +0 -0
  66. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/httpx_client/oauth2_client.py +0 -0
  67. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/httpx_client/utils.py +0 -0
  68. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/requests_client/__init__.py +0 -0
  69. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/requests_client/assertion_session.py +0 -0
  70. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/requests_client/oauth1_session.py +0 -0
  71. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/requests_client/oauth2_session.py +0 -0
  72. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/requests_client/utils.py +0 -0
  73. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/sqla_oauth2/__init__.py +0 -0
  74. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/sqla_oauth2/client_mixin.py +0 -0
  75. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/sqla_oauth2/functions.py +0 -0
  76. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/sqla_oauth2/tokens_mixins.py +0 -0
  77. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/starlette_client/__init__.py +0 -0
  78. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/starlette_client/apps.py +0 -0
  79. {authlib-1.6.4 → authlib-1.6.6}/authlib/integrations/starlette_client/integration.py +0 -0
  80. {authlib-1.6.4 → authlib-1.6.6}/authlib/jose/__init__.py +0 -0
  81. {authlib-1.6.4 → authlib-1.6.6}/authlib/jose/drafts/__init__.py +0 -0
  82. {authlib-1.6.4 → authlib-1.6.6}/authlib/jose/drafts/_jwe_algorithms.py +0 -0
  83. {authlib-1.6.4 → authlib-1.6.6}/authlib/jose/drafts/_jwe_enc_cryptodome.py +0 -0
  84. {authlib-1.6.4 → authlib-1.6.6}/authlib/jose/drafts/_jwe_enc_cryptography.py +0 -0
  85. {authlib-1.6.4 → authlib-1.6.6}/authlib/jose/errors.py +0 -0
  86. {authlib-1.6.4 → authlib-1.6.6}/authlib/jose/jwk.py +0 -0
  87. {authlib-1.6.4 → authlib-1.6.6}/authlib/jose/rfc7515/__init__.py +0 -0
  88. {authlib-1.6.4 → authlib-1.6.6}/authlib/jose/rfc7515/models.py +0 -0
  89. {authlib-1.6.4 → authlib-1.6.6}/authlib/jose/rfc7516/__init__.py +0 -0
  90. {authlib-1.6.4 → authlib-1.6.6}/authlib/jose/rfc7516/jwe.py +0 -0
  91. {authlib-1.6.4 → authlib-1.6.6}/authlib/jose/rfc7516/models.py +0 -0
  92. {authlib-1.6.4 → authlib-1.6.6}/authlib/jose/rfc7517/__init__.py +0 -0
  93. {authlib-1.6.4 → authlib-1.6.6}/authlib/jose/rfc7517/_cryptography_key.py +0 -0
  94. {authlib-1.6.4 → authlib-1.6.6}/authlib/jose/rfc7517/asymmetric_key.py +0 -0
  95. {authlib-1.6.4 → authlib-1.6.6}/authlib/jose/rfc7517/base_key.py +0 -0
  96. {authlib-1.6.4 → authlib-1.6.6}/authlib/jose/rfc7517/jwk.py +0 -0
  97. {authlib-1.6.4 → authlib-1.6.6}/authlib/jose/rfc7517/key_set.py +0 -0
  98. {authlib-1.6.4 → authlib-1.6.6}/authlib/jose/rfc7518/__init__.py +0 -0
  99. {authlib-1.6.4 → authlib-1.6.6}/authlib/jose/rfc7518/ec_key.py +0 -0
  100. {authlib-1.6.4 → authlib-1.6.6}/authlib/jose/rfc7518/jwe_algs.py +0 -0
  101. {authlib-1.6.4 → authlib-1.6.6}/authlib/jose/rfc7518/jwe_encs.py +0 -0
  102. {authlib-1.6.4 → authlib-1.6.6}/authlib/jose/rfc7518/jws_algs.py +0 -0
  103. {authlib-1.6.4 → authlib-1.6.6}/authlib/jose/rfc7518/oct_key.py +0 -0
  104. {authlib-1.6.4 → authlib-1.6.6}/authlib/jose/rfc7518/rsa_key.py +0 -0
  105. {authlib-1.6.4 → authlib-1.6.6}/authlib/jose/rfc7518/util.py +0 -0
  106. {authlib-1.6.4 → authlib-1.6.6}/authlib/jose/rfc7519/__init__.py +0 -0
  107. {authlib-1.6.4 → authlib-1.6.6}/authlib/jose/rfc7519/claims.py +0 -0
  108. {authlib-1.6.4 → authlib-1.6.6}/authlib/jose/rfc7519/jwt.py +0 -0
  109. {authlib-1.6.4 → authlib-1.6.6}/authlib/jose/rfc8037/__init__.py +0 -0
  110. {authlib-1.6.4 → authlib-1.6.6}/authlib/jose/rfc8037/jws_eddsa.py +0 -0
  111. {authlib-1.6.4 → authlib-1.6.6}/authlib/jose/rfc8037/okp_key.py +0 -0
  112. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth1/__init__.py +0 -0
  113. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth1/client.py +0 -0
  114. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth1/errors.py +0 -0
  115. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth1/rfc5849/__init__.py +0 -0
  116. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth1/rfc5849/authorization_server.py +0 -0
  117. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth1/rfc5849/base_server.py +0 -0
  118. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth1/rfc5849/errors.py +0 -0
  119. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth1/rfc5849/models.py +0 -0
  120. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth1/rfc5849/parameters.py +0 -0
  121. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth1/rfc5849/resource_protector.py +0 -0
  122. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth1/rfc5849/rsa.py +0 -0
  123. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth1/rfc5849/signature.py +0 -0
  124. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth1/rfc5849/util.py +0 -0
  125. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth1/rfc5849/wrapper.py +0 -0
  126. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/__init__.py +0 -0
  127. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/auth.py +0 -0
  128. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/base.py +0 -0
  129. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/client.py +0 -0
  130. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc6749/__init__.py +0 -0
  131. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc6749/authenticate_client.py +0 -0
  132. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc6749/authorization_server.py +0 -0
  133. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc6749/errors.py +0 -0
  134. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc6749/grants/__init__.py +0 -0
  135. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc6749/grants/authorization_code.py +0 -0
  136. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc6749/grants/base.py +0 -0
  137. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc6749/grants/client_credentials.py +0 -0
  138. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc6749/grants/implicit.py +0 -0
  139. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc6749/grants/refresh_token.py +0 -0
  140. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc6749/grants/resource_owner_password_credentials.py +0 -0
  141. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc6749/hooks.py +0 -0
  142. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc6749/models.py +0 -0
  143. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc6749/requests.py +0 -0
  144. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc6749/resource_protector.py +0 -0
  145. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc6749/token_endpoint.py +0 -0
  146. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc6749/util.py +0 -0
  147. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc6750/__init__.py +0 -0
  148. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc6750/errors.py +0 -0
  149. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc6750/parameters.py +0 -0
  150. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc6750/token.py +0 -0
  151. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc6750/validator.py +0 -0
  152. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc7009/__init__.py +0 -0
  153. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc7009/parameters.py +0 -0
  154. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc7009/revocation.py +0 -0
  155. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc7521/__init__.py +0 -0
  156. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc7521/client.py +0 -0
  157. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc7523/__init__.py +0 -0
  158. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc7523/assertion.py +0 -0
  159. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc7523/auth.py +0 -0
  160. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc7523/client.py +0 -0
  161. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc7523/jwt_bearer.py +0 -0
  162. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc7523/token.py +0 -0
  163. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc7523/validator.py +0 -0
  164. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc7591/__init__.py +0 -0
  165. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc7591/claims.py +0 -0
  166. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc7591/errors.py +0 -0
  167. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc7592/__init__.py +0 -0
  168. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc7592/endpoint.py +0 -0
  169. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc7636/__init__.py +0 -0
  170. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc7636/challenge.py +0 -0
  171. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc7662/__init__.py +0 -0
  172. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc7662/introspection.py +0 -0
  173. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc7662/models.py +0 -0
  174. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc7662/token_validator.py +0 -0
  175. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc8414/__init__.py +0 -0
  176. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc8414/models.py +0 -0
  177. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc8414/well_known.py +0 -0
  178. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc8628/__init__.py +0 -0
  179. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc8628/device_code.py +0 -0
  180. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc8628/endpoint.py +0 -0
  181. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc8628/errors.py +0 -0
  182. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc8628/models.py +0 -0
  183. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc8693/__init__.py +0 -0
  184. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc9068/__init__.py +0 -0
  185. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc9068/claims.py +0 -0
  186. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc9068/introspection.py +0 -0
  187. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc9068/revocation.py +0 -0
  188. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc9068/token.py +0 -0
  189. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc9068/token_validator.py +0 -0
  190. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc9101/__init__.py +0 -0
  191. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc9101/authorization_server.py +0 -0
  192. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc9101/discovery.py +0 -0
  193. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc9101/errors.py +0 -0
  194. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc9101/registration.py +0 -0
  195. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc9207/__init__.py +0 -0
  196. {authlib-1.6.4 → authlib-1.6.6}/authlib/oauth2/rfc9207/parameter.py +0 -0
  197. {authlib-1.6.4 → authlib-1.6.6}/authlib/oidc/__init__.py +0 -0
  198. {authlib-1.6.4 → authlib-1.6.6}/authlib/oidc/core/__init__.py +0 -0
  199. {authlib-1.6.4 → authlib-1.6.6}/authlib/oidc/core/claims.py +0 -0
  200. {authlib-1.6.4 → authlib-1.6.6}/authlib/oidc/core/errors.py +0 -0
  201. {authlib-1.6.4 → authlib-1.6.6}/authlib/oidc/core/grants/__init__.py +0 -0
  202. {authlib-1.6.4 → authlib-1.6.6}/authlib/oidc/core/grants/hybrid.py +0 -0
  203. {authlib-1.6.4 → authlib-1.6.6}/authlib/oidc/core/grants/util.py +0 -0
  204. {authlib-1.6.4 → authlib-1.6.6}/authlib/oidc/core/models.py +0 -0
  205. {authlib-1.6.4 → authlib-1.6.6}/authlib/oidc/core/userinfo.py +0 -0
  206. {authlib-1.6.4 → authlib-1.6.6}/authlib/oidc/core/util.py +0 -0
  207. {authlib-1.6.4 → authlib-1.6.6}/authlib/oidc/discovery/__init__.py +0 -0
  208. {authlib-1.6.4 → authlib-1.6.6}/authlib/oidc/discovery/models.py +0 -0
  209. {authlib-1.6.4 → authlib-1.6.6}/authlib/oidc/discovery/well_known.py +0 -0
  210. {authlib-1.6.4 → authlib-1.6.6}/authlib/oidc/registration/__init__.py +0 -0
  211. {authlib-1.6.4 → authlib-1.6.6}/authlib/oidc/registration/claims.py +0 -0
  212. {authlib-1.6.4 → authlib-1.6.6}/pyproject.toml +0 -0
  213. {authlib-1.6.4 → authlib-1.6.6}/setup.cfg +0 -0
  214. {authlib-1.6.4 → authlib-1.6.6}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Authlib
3
- Version: 1.6.4
3
+ Version: 1.6.6
4
4
  Summary: The ultimate Python library in building OAuth and OpenID Connect servers and clients.
5
5
  Author-email: Hsiaoming Yang <me@lepture.com>
6
6
  License: BSD-3-Clause
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Authlib
3
- Version: 1.6.4
3
+ Version: 1.6.6
4
4
  Summary: The ultimate Python library in building OAuth and OpenID Connect servers and clients.
5
5
  Author-email: Hsiaoming Yang <me@lepture.com>
6
6
  License: BSD-3-Clause
@@ -1,4 +1,5 @@
1
- """authlib.
1
+ """
2
+ authlib
2
3
  ~~~~~~~
3
4
 
4
5
  The ultimate Python library in building OAuth 1.0, OAuth 2.0 and OpenID
@@ -1,5 +1,5 @@
1
1
  name = "Authlib"
2
- version = "1.6.4"
2
+ version = "1.6.6"
3
3
  author = "Hsiaoming Yang <me@lepture.com>"
4
4
  homepage = "https://authlib.org"
5
5
  default_user_agent = f"{name}/{version} (+{homepage})"
@@ -20,11 +20,9 @@ class FrameworkIntegration:
20
20
 
21
21
  def _clear_session_state(self, session):
22
22
  now = time.time()
23
+ prefix = f"_state_{self.name}"
23
24
  for key in dict(session):
24
- if "_authlib_" in key:
25
- # TODO: remove in future
26
- session.pop(key)
27
- elif key.startswith("_state_"):
25
+ if key.startswith(prefix):
28
26
  value = session[key]
29
27
  exp = value.get("exp")
30
28
  if not exp or exp < now:
@@ -32,29 +30,32 @@ class FrameworkIntegration:
32
30
 
33
31
  def get_state_data(self, session, state):
34
32
  key = f"_state_{self.name}_{state}"
33
+ session_data = session.get(key)
34
+ if not session_data:
35
+ return None
35
36
  if self.cache:
36
- value = self._get_cache_data(key)
37
+ cached_value = self._get_cache_data(key)
37
38
  else:
38
- value = session.get(key)
39
- if value:
40
- return value.get("data")
39
+ cached_value = session_data
40
+ if cached_value:
41
+ return cached_value.get("data")
41
42
  return None
42
43
 
43
44
  def set_state_data(self, session, state, data):
44
45
  key = f"_state_{self.name}_{state}"
46
+ now = time.time()
45
47
  if self.cache:
46
48
  self.cache.set(key, json.dumps({"data": data}), self.expires_in)
49
+ session[key] = {"exp": now + self.expires_in}
47
50
  else:
48
- now = time.time()
49
51
  session[key] = {"data": data, "exp": now + self.expires_in}
50
52
 
51
53
  def clear_state_data(self, session, state):
52
54
  key = f"_state_{self.name}_{state}"
53
55
  if self.cache:
54
56
  self.cache.delete(key)
55
- else:
56
- session.pop(key, None)
57
- self._clear_session_state(session)
57
+ session.pop(key, None)
58
+ self._clear_session_state(session)
58
59
 
59
60
  def update_token(self, token, refresh_token=None, access_token=None):
60
61
  raise NotImplementedError()
@@ -34,6 +34,8 @@ class JsonWebSignature:
34
34
  ]
35
35
  )
36
36
 
37
+ MAX_CONTENT_LENGTH: int = 256000
38
+
37
39
  #: Defined available JWS algorithms in the registry
38
40
  ALGORITHMS_REGISTRY = {}
39
41
 
@@ -89,6 +91,9 @@ class JsonWebSignature:
89
91
 
90
92
  .. _`Section 7.1`: https://tools.ietf.org/html/rfc7515#section-7.1
91
93
  """
94
+ if len(s) > self.MAX_CONTENT_LENGTH:
95
+ raise ValueError("Serialization is too long.")
96
+
92
97
  try:
93
98
  s = to_bytes(s)
94
99
  signing_input, signature_segment = s.rsplit(b".", 1)
@@ -0,0 +1,34 @@
1
+ import zlib
2
+
3
+ from ..rfc7516 import JsonWebEncryption
4
+ from ..rfc7516 import JWEZipAlgorithm
5
+
6
+ GZIP_HEAD = bytes([120, 156])
7
+ MAX_SIZE = 250 * 1024
8
+
9
+
10
+ class DeflateZipAlgorithm(JWEZipAlgorithm):
11
+ name = "DEF"
12
+ description = "DEFLATE"
13
+
14
+ def compress(self, s: bytes) -> bytes:
15
+ """Compress bytes data with DEFLATE algorithm."""
16
+ data = zlib.compress(s)
17
+ # https://datatracker.ietf.org/doc/html/rfc1951
18
+ # since DEF is always gzip, we can drop gzip headers and tail
19
+ return data[2:-4]
20
+
21
+ def decompress(self, s: bytes) -> bytes:
22
+ """Decompress DEFLATE bytes data."""
23
+ if s.startswith(GZIP_HEAD):
24
+ decompressor = zlib.decompressobj()
25
+ else:
26
+ decompressor = zlib.decompressobj(-zlib.MAX_WBITS)
27
+ value = decompressor.decompress(s, MAX_SIZE)
28
+ if decompressor.unconsumed_tail:
29
+ raise ValueError(f"Decompressed string exceeds {MAX_SIZE} bytes")
30
+ return value
31
+
32
+
33
+ def register_jwe_rfc7518():
34
+ JsonWebEncryption.register_algorithm(DeflateZipAlgorithm())
@@ -7,6 +7,9 @@ from authlib.jose.errors import DecodeError
7
7
 
8
8
 
9
9
  def extract_header(header_segment, error_cls):
10
+ if len(header_segment) > 256000:
11
+ raise ValueError("Value of header is too long")
12
+
10
13
  header_data = extract_segment(header_segment, error_cls, "header")
11
14
 
12
15
  try:
@@ -20,6 +23,9 @@ def extract_header(header_segment, error_cls):
20
23
 
21
24
 
22
25
  def extract_segment(segment, error_cls, name="payload"):
26
+ if len(segment) > 256000:
27
+ raise ValueError(f"Value of {name} is too long")
28
+
23
29
  try:
24
30
  return urlsafe_b64decode(segment)
25
31
  except (TypeError, binascii.Error) as exc:
@@ -172,6 +172,8 @@ class ClientAuth:
172
172
 
173
173
  if CONTENT_TYPE_FORM_URLENCODED in content_type:
174
174
  headers["Content-Type"] = CONTENT_TYPE_FORM_URLENCODED
175
+ if isinstance(body, bytes):
176
+ body = body.decode()
175
177
  uri, headers, body = self.sign(method, uri, headers, body)
176
178
  elif self.force_include_body:
177
179
  # To allow custom clients to work on non form encoded bodies.
@@ -54,9 +54,14 @@ def prepare_grant_uri(
54
54
  if state:
55
55
  params.append(("state", state))
56
56
 
57
- for k in kwargs:
58
- if kwargs[k] is not None:
59
- params.append((to_unicode(k), kwargs[k]))
57
+ for k, value in kwargs.items():
58
+ if value is not None:
59
+ if isinstance(value, (list, tuple)):
60
+ for v in value:
61
+ if v is not None:
62
+ params.append((to_unicode(k), v))
63
+ else:
64
+ params.append((to_unicode(k), value))
60
65
 
61
66
  return add_params_to_uri(uri, params)
62
67
 
@@ -4,15 +4,26 @@ import time
4
4
  class OAuth2Token(dict):
5
5
  def __init__(self, params):
6
6
  if params.get("expires_at"):
7
- params["expires_at"] = int(params["expires_at"])
7
+ try:
8
+ params["expires_at"] = int(params["expires_at"])
9
+ except ValueError:
10
+ # If expires_at is not parseable, fall back to expires_in if available
11
+ # Otherwise leave expires_at untouched
12
+ if params.get("expires_in"):
13
+ params["expires_at"] = int(time.time()) + int(params["expires_in"])
14
+
8
15
  elif params.get("expires_in"):
9
16
  params["expires_at"] = int(time.time()) + int(params["expires_in"])
17
+
10
18
  super().__init__(params)
11
19
 
12
20
  def is_expired(self, leeway=60):
13
21
  expires_at = self.get("expires_at")
14
22
  if not expires_at:
15
23
  return None
24
+ # Only check expiration if expires_at is an integer
25
+ if not isinstance(expires_at, int):
26
+ return None
16
27
  # small timedelta to consider token as expired before it actually expires
17
28
  expiration_threshold = expires_at - leeway
18
29
  return expiration_threshold < time.time()
@@ -4,6 +4,7 @@ import time
4
4
 
5
5
  from authlib.common.security import generate_token
6
6
  from authlib.consts import default_json_headers
7
+ from authlib.deprecate import deprecate
7
8
  from authlib.jose import JoseError
8
9
  from authlib.jose import JsonWebToken
9
10
 
@@ -41,7 +42,7 @@ class ClientRegistrationEndpoint:
41
42
  request.credential = token
42
43
 
43
44
  client_metadata = self.extract_client_metadata(request)
44
- client_info = self.generate_client_info()
45
+ client_info = self.generate_client_info(request)
45
46
  body = {}
46
47
  body.update(client_metadata)
47
48
  body.update(client_info)
@@ -91,10 +92,28 @@ class ClientRegistrationEndpoint:
91
92
  except JoseError as exc:
92
93
  raise InvalidSoftwareStatementError() from exc
93
94
 
94
- def generate_client_info(self):
95
+ def generate_client_info(self, request):
95
96
  # https://tools.ietf.org/html/rfc7591#section-3.2.1
96
- client_id = self.generate_client_id()
97
- client_secret = self.generate_client_secret()
97
+ try:
98
+ client_id = self.generate_client_id(request)
99
+ except TypeError: # pragma: no cover
100
+ client_id = self.generate_client_id()
101
+ deprecate(
102
+ "generate_client_id takes a 'request' parameter. "
103
+ "It will become mandatory in coming releases",
104
+ version="1.8",
105
+ )
106
+
107
+ try:
108
+ client_secret = self.generate_client_secret(request)
109
+ except TypeError: # pragma: no cover
110
+ client_secret = self.generate_client_secret()
111
+ deprecate(
112
+ "generate_client_secret takes a 'request' parameter. "
113
+ "It will become mandatory in coming releases",
114
+ version="1.8",
115
+ )
116
+
98
117
  client_id_issued_at = int(time.time())
99
118
  client_secret_expires_at = 0
100
119
  return dict(
@@ -114,13 +133,13 @@ class ClientRegistrationEndpoint:
114
133
  def create_endpoint_request(self, request):
115
134
  return self.server.create_json_request(request)
116
135
 
117
- def generate_client_id(self):
136
+ def generate_client_id(self, request):
118
137
  """Generate ``client_id`` value. Developers MAY rewrite this method
119
138
  to use their own way to generate ``client_id``.
120
139
  """
121
140
  return generate_token(42)
122
141
 
123
- def generate_client_secret(self):
142
+ def generate_client_secret(self, request):
124
143
  """Generate ``client_secret`` value. Developers MAY rewrite this method
125
144
  to use their own way to generate ``client_secret``.
126
145
  """
@@ -8,6 +8,7 @@ per `Section 3.1`_.
8
8
  """
9
9
 
10
10
  import logging
11
+ import warnings
11
12
 
12
13
  from authlib.oauth2.rfc6749 import OAuth2Request
13
14
 
@@ -20,7 +21,7 @@ log = logging.getLogger(__name__)
20
21
 
21
22
 
22
23
  class OpenIDToken:
23
- def get_jwt_config(self, grant): # pragma: no cover
24
+ def get_jwt_config(self, grant, client): # pragma: no cover
24
25
  """Get the JWT configuration for OpenIDCode extension. The JWT
25
26
  configuration will be used to generate ``id_token``.
26
27
  If ``alg`` is undefined, the ``id_token_signed_response_alg`` client
@@ -29,15 +30,16 @@ class OpenIDToken:
29
30
  will be used.
30
31
  Developers MUST implement this method in subclass, e.g.::
31
32
 
32
- def get_jwt_config(self, grant):
33
+ def get_jwt_config(self, grant, client):
33
34
  return {
34
35
  "key": read_private_key_file(key_path),
35
- "alg": "RS256",
36
+ "alg": client.id_token_signed_response_alg or "RS256",
36
37
  "iss": "issuer-identity",
37
38
  "exp": 3600,
38
39
  }
39
40
 
40
41
  :param grant: AuthorizationCodeGrant instance
42
+ :param client: OAuth2 client instance
41
43
  :return: dict
42
44
  """
43
45
  raise NotImplementedError()
@@ -78,7 +80,17 @@ class OpenIDToken:
78
80
  request: OAuth2Request = grant.request
79
81
  authorization_code = request.authorization_code
80
82
 
81
- config = self.get_jwt_config(grant)
83
+ try:
84
+ config = self.get_jwt_config(grant, request.client)
85
+ except TypeError:
86
+ warnings.warn(
87
+ "get_jwt_config(self, grant) is deprecated and will be removed in version 1.8. "
88
+ "Use get_jwt_config(self, grant, client) instead.",
89
+ DeprecationWarning,
90
+ stacklevel=2,
91
+ )
92
+ config = self.get_jwt_config(grant)
93
+
82
94
  config["aud"] = self.get_audiences(request)
83
95
 
84
96
  # Per OpenID Connect Registration 1.0 Section 2:
@@ -1,4 +1,5 @@
1
1
  import logging
2
+ import warnings
2
3
 
3
4
  from authlib.oauth2.rfc6749 import AccessDeniedError
4
5
  from authlib.oauth2.rfc6749 import ImplicitGrant
@@ -36,19 +37,20 @@ class OpenIDImplicitGrant(ImplicitGrant):
36
37
  """
37
38
  raise NotImplementedError()
38
39
 
39
- def get_jwt_config(self):
40
+ def get_jwt_config(self, client):
40
41
  """Get the JWT configuration for OpenIDImplicitGrant. The JWT
41
42
  configuration will be used to generate ``id_token``. Developers
42
43
  MUST implement this method in subclass, e.g.::
43
44
 
44
- def get_jwt_config(self):
45
+ def get_jwt_config(self, client):
45
46
  return {
46
47
  "key": read_private_key_file(key_path),
47
- "alg": "RS256",
48
+ "alg": client.id_token_signed_response_alg or "RS256",
48
49
  "iss": "issuer-identity",
49
50
  "exp": 3600,
50
51
  }
51
52
 
53
+ :param client: OAuth2 client instance
52
54
  :return: dict
53
55
  """
54
56
  raise NotImplementedError()
@@ -143,7 +145,17 @@ class OpenIDImplicitGrant(ImplicitGrant):
143
145
  return params
144
146
 
145
147
  def process_implicit_token(self, token, code=None):
146
- config = self.get_jwt_config()
148
+ try:
149
+ config = self.get_jwt_config(self.request.client)
150
+ except TypeError:
151
+ warnings.warn(
152
+ "get_jwt_config(self) is deprecated and will be removed in version 1.8. "
153
+ "Use get_jwt_config(self, client) instead.",
154
+ DeprecationWarning,
155
+ stacklevel=2,
156
+ )
157
+ config = self.get_jwt_config()
158
+
147
159
  config["aud"] = self.get_audiences(self.request)
148
160
  config["nonce"] = self.request.payload.data.get("nonce")
149
161
  if code is not None:
@@ -1,23 +0,0 @@
1
- import zlib
2
-
3
- from ..rfc7516 import JsonWebEncryption
4
- from ..rfc7516 import JWEZipAlgorithm
5
-
6
-
7
- class DeflateZipAlgorithm(JWEZipAlgorithm):
8
- name = "DEF"
9
- description = "DEFLATE"
10
-
11
- def compress(self, s):
12
- """Compress bytes data with DEFLATE algorithm."""
13
- data = zlib.compress(s)
14
- # drop gzip headers and tail
15
- return data[2:-4]
16
-
17
- def decompress(self, s):
18
- """Decompress DEFLATE bytes data."""
19
- return zlib.decompress(s, -zlib.MAX_WBITS)
20
-
21
-
22
- def register_jwe_rfc7518():
23
- JsonWebEncryption.register_algorithm(DeflateZipAlgorithm())
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes