jamlib 2.6.0b0.dev4__tar.gz → 3.0.0__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 (148) hide show
  1. jamlib-3.0.0/LICENSE.md +173 -0
  2. jamlib-3.0.0/PKG-INFO +117 -0
  3. jamlib-3.0.0/README.md +66 -0
  4. {jamlib-2.6.0b0.dev4 → jamlib-3.0.0}/pyproject.toml +56 -48
  5. jamlib-3.0.0/src/jam/__base__.py +477 -0
  6. jamlib-2.6.0b0.dev4/src/jam/__abc_encoder__.py → jamlib-3.0.0/src/jam/__base_encoder__.py +2 -2
  7. {jamlib-2.6.0b0.dev4 → jamlib-3.0.0}/src/jam/__deprecated__.py +2 -3
  8. {jamlib-2.6.0b0.dev4 → jamlib-3.0.0}/src/jam/__init__.py +4 -5
  9. jamlib-2.6.0b0.dev4/src/jam/__abc_instances__.py → jamlib-3.0.0/src/jam/aio/__base__.py +58 -150
  10. jamlib-3.0.0/src/jam/aio/__init__.py +7 -0
  11. jamlib-3.0.0/src/jam/aio/instance.py +423 -0
  12. jamlib-3.0.0/src/jam/aio/jwt/__init__.py +61 -0
  13. jamlib-3.0.0/src/jam/aio/oauth2/__base__.py +104 -0
  14. jamlib-3.0.0/src/jam/aio/oauth2/__init__.py +71 -0
  15. jamlib-3.0.0/src/jam/aio/oauth2/builtin/__init__.py +3 -0
  16. {jamlib-2.6.0b0.dev4 → jamlib-3.0.0}/src/jam/aio/oauth2/builtin/github.py +1 -1
  17. {jamlib-2.6.0b0.dev4 → jamlib-3.0.0}/src/jam/aio/oauth2/builtin/gitlab.py +1 -1
  18. {jamlib-2.6.0b0.dev4 → jamlib-3.0.0}/src/jam/aio/oauth2/builtin/google.py +1 -1
  19. {jamlib-2.6.0b0.dev4 → jamlib-3.0.0}/src/jam/aio/oauth2/builtin/yandex.py +1 -1
  20. {jamlib-2.6.0b0.dev4 → jamlib-3.0.0}/src/jam/aio/oauth2/client.py +65 -41
  21. jamlib-3.0.0/src/jam/aio/sessions/__base__.py +166 -0
  22. jamlib-3.0.0/src/jam/aio/sessions/__init__.py +106 -0
  23. jamlib-3.0.0/src/jam/aio/sessions/json.py +221 -0
  24. {jamlib-2.6.0b0.dev4 → jamlib-3.0.0}/src/jam/aio/sessions/redis.py +101 -50
  25. {jamlib-2.6.0b0.dev4 → jamlib-3.0.0}/src/jam/encoders.py +5 -5
  26. jamlib-3.0.0/src/jam/exceptions/__init__.py +79 -0
  27. jamlib-3.0.0/src/jam/exceptions/base.py +64 -0
  28. jamlib-3.0.0/src/jam/exceptions/jwt.py +38 -0
  29. jamlib-3.0.0/src/jam/exceptions/oauth2.py +19 -0
  30. jamlib-3.0.0/src/jam/exceptions/paseto.py +37 -0
  31. jamlib-3.0.0/src/jam/exceptions/plugins.py +44 -0
  32. jamlib-3.0.0/src/jam/exceptions/sessions.py +13 -0
  33. jamlib-3.0.0/src/jam/ext/fastapi/__init__.py +11 -0
  34. jamlib-3.0.0/src/jam/ext/flask/__init__.py +26 -0
  35. jamlib-3.0.0/src/jam/ext/flask/extensions.py +247 -0
  36. jamlib-3.0.0/src/jam/ext/flask/objects.py +12 -0
  37. jamlib-3.0.0/src/jam/ext/litestar/__init__.py +32 -0
  38. jamlib-3.0.0/src/jam/ext/litestar/middleware.py +121 -0
  39. jamlib-3.0.0/src/jam/ext/litestar/objects.py +44 -0
  40. jamlib-3.0.0/src/jam/ext/litestar/plugins.py +198 -0
  41. jamlib-3.0.0/src/jam/ext/starlette/__init__.py +18 -0
  42. jamlib-3.0.0/src/jam/ext/starlette/backends.py +187 -0
  43. jamlib-3.0.0/src/jam/ext/starlette/objects.py +56 -0
  44. jamlib-3.0.0/src/jam/instance.py +430 -0
  45. jamlib-3.0.0/src/jam/jwt/__algorithms__.py +488 -0
  46. jamlib-3.0.0/src/jam/jwt/__base__.py +58 -0
  47. jamlib-3.0.0/src/jam/jwt/__init__.py +65 -0
  48. jamlib-3.0.0/src/jam/jwt/__types__.py +15 -0
  49. jamlib-2.6.0b0.dev4/src/jam/jwt/lists/__abc_list_repo__.py → jamlib-3.0.0/src/jam/jwt/lists/__base__.py +4 -4
  50. jamlib-3.0.0/src/jam/jwt/lists/__init__.py +8 -0
  51. {jamlib-2.6.0b0.dev4 → jamlib-3.0.0}/src/jam/jwt/lists/json.py +33 -12
  52. {jamlib-2.6.0b0.dev4 → jamlib-3.0.0}/src/jam/jwt/lists/redis.py +30 -11
  53. jamlib-3.0.0/src/jam/jwt/module.py +236 -0
  54. jamlib-2.6.0b0.dev4/src/jam/jwt/__utils__.py → jamlib-3.0.0/src/jam/jwt/utils.py +2 -2
  55. jamlib-3.0.0/src/jam/logger.py +102 -0
  56. jamlib-2.6.0b0.dev4/src/jam/oauth2/__abc_oauth2_repo__.py → jamlib-3.0.0/src/jam/oauth2/__base__.py +17 -6
  57. jamlib-3.0.0/src/jam/oauth2/__init__.py +69 -0
  58. {jamlib-2.6.0b0.dev4 → jamlib-3.0.0}/src/jam/oauth2/client.py +23 -9
  59. jamlib-2.6.0b0.dev4/src/jam/otp/__abc_module__.py → jamlib-3.0.0/src/jam/otp/__base__.py +32 -5
  60. jamlib-3.0.0/src/jam/otp/__init__.py +37 -0
  61. {jamlib-2.6.0b0.dev4 → jamlib-3.0.0}/src/jam/otp/hotp.py +3 -3
  62. {jamlib-2.6.0b0.dev4 → jamlib-3.0.0}/src/jam/otp/totp.py +5 -5
  63. jamlib-2.6.0b0.dev4/src/jam/paseto/__abc_paseto_repo__.py → jamlib-3.0.0/src/jam/paseto/__base__.py +39 -29
  64. jamlib-3.0.0/src/jam/paseto/__init__.py +57 -0
  65. {jamlib-2.6.0b0.dev4 → jamlib-3.0.0}/src/jam/paseto/utils.py +21 -51
  66. {jamlib-2.6.0b0.dev4 → jamlib-3.0.0}/src/jam/paseto/v1.py +88 -43
  67. {jamlib-2.6.0b0.dev4 → jamlib-3.0.0}/src/jam/paseto/v2.py +65 -41
  68. {jamlib-2.6.0b0.dev4 → jamlib-3.0.0}/src/jam/paseto/v3.py +67 -48
  69. {jamlib-2.6.0b0.dev4 → jamlib-3.0.0}/src/jam/paseto/v4.py +72 -38
  70. jamlib-3.0.0/src/jam/py.typed +0 -0
  71. jamlib-2.6.0b0.dev4/src/jam/sessions/__abc_session_repo__.py → jamlib-3.0.0/src/jam/sessions/__base__.py +37 -24
  72. jamlib-3.0.0/src/jam/sessions/__init__.py +89 -0
  73. {jamlib-2.6.0b0.dev4 → jamlib-3.0.0}/src/jam/sessions/json.py +63 -23
  74. {jamlib-2.6.0b0.dev4 → jamlib-3.0.0}/src/jam/sessions/redis.py +94 -39
  75. jamlib-3.0.0/src/jam/tests/clients.py +853 -0
  76. jamlib-3.0.0/src/jam/tests/fakers.py +102 -0
  77. {jamlib-2.6.0b0.dev4 → jamlib-3.0.0}/src/jam/utils/__init__.py +3 -0
  78. {jamlib-2.6.0b0.dev4 → jamlib-3.0.0}/src/jam/utils/await_maybe.py +4 -4
  79. jamlib-3.0.0/src/jam/utils/basic_auth.py +47 -0
  80. jamlib-3.0.0/src/jam/utils/config_maker.py +384 -0
  81. {jamlib-2.6.0b0.dev4 → jamlib-3.0.0}/src/jam/utils/salt_hash.py +1 -2
  82. jamlib-3.0.0/src/jamlib.egg-info/PKG-INFO +117 -0
  83. {jamlib-2.6.0b0.dev4 → jamlib-3.0.0}/src/jamlib.egg-info/SOURCES.txt +26 -23
  84. jamlib-3.0.0/src/jamlib.egg-info/requires.txt +25 -0
  85. jamlib-2.6.0b0.dev4/LICENSE.md +0 -23
  86. jamlib-2.6.0b0.dev4/PKG-INFO +0 -118
  87. jamlib-2.6.0b0.dev4/README.md +0 -65
  88. jamlib-2.6.0b0.dev4/src/jam/__logger__.py +0 -11
  89. jamlib-2.6.0b0.dev4/src/jam/aio/__init__.py +0 -10
  90. jamlib-2.6.0b0.dev4/src/jam/aio/instance.py +0 -642
  91. jamlib-2.6.0b0.dev4/src/jam/aio/jwt/__init__.py +0 -1
  92. jamlib-2.6.0b0.dev4/src/jam/aio/jwt/lists/__init__.py +0 -1
  93. jamlib-2.6.0b0.dev4/src/jam/aio/jwt/lists/json.py +0 -88
  94. jamlib-2.6.0b0.dev4/src/jam/aio/jwt/lists/redis.py +0 -88
  95. jamlib-2.6.0b0.dev4/src/jam/aio/jwt/tools.py +0 -88
  96. jamlib-2.6.0b0.dev4/src/jam/aio/modules.py +0 -451
  97. jamlib-2.6.0b0.dev4/src/jam/aio/oauth2/__init__.py +0 -16
  98. jamlib-2.6.0b0.dev4/src/jam/aio/sessions/__init__.py +0 -3
  99. jamlib-2.6.0b0.dev4/src/jam/aio/sessions/json.py +0 -85
  100. jamlib-2.6.0b0.dev4/src/jam/exceptions/__init__.py +0 -19
  101. jamlib-2.6.0b0.dev4/src/jam/exceptions/jwt.py +0 -39
  102. jamlib-2.6.0b0.dev4/src/jam/exceptions/oauth2.py +0 -11
  103. jamlib-2.6.0b0.dev4/src/jam/exceptions/sessions.py +0 -11
  104. jamlib-2.6.0b0.dev4/src/jam/ext/fastapi/__init__.py +0 -11
  105. jamlib-2.6.0b0.dev4/src/jam/ext/flask/__init__.py +0 -11
  106. jamlib-2.6.0b0.dev4/src/jam/ext/flask/extensions.py +0 -139
  107. jamlib-2.6.0b0.dev4/src/jam/ext/litestar/__init__.py +0 -13
  108. jamlib-2.6.0b0.dev4/src/jam/ext/litestar/middlewares.py +0 -113
  109. jamlib-2.6.0b0.dev4/src/jam/ext/litestar/plugins.py +0 -121
  110. jamlib-2.6.0b0.dev4/src/jam/ext/litestar/value.py +0 -28
  111. jamlib-2.6.0b0.dev4/src/jam/ext/starlette/__init__.py +0 -12
  112. jamlib-2.6.0b0.dev4/src/jam/ext/starlette/auth_backends.py +0 -116
  113. jamlib-2.6.0b0.dev4/src/jam/ext/starlette/value.py +0 -18
  114. jamlib-2.6.0b0.dev4/src/jam/instance.py +0 -648
  115. jamlib-2.6.0b0.dev4/src/jam/jwt/__init__.py +0 -1
  116. jamlib-2.6.0b0.dev4/src/jam/jwt/lists/__init__.py +0 -11
  117. jamlib-2.6.0b0.dev4/src/jam/jwt/tools.py +0 -168
  118. jamlib-2.6.0b0.dev4/src/jam/jwt/types.py +0 -34
  119. jamlib-2.6.0b0.dev4/src/jam/modules.py +0 -487
  120. jamlib-2.6.0b0.dev4/src/jam/oauth2/__init__.py +0 -18
  121. jamlib-2.6.0b0.dev4/src/jam/oauth2/builtin/__init__.py +0 -3
  122. jamlib-2.6.0b0.dev4/src/jam/otp/__init__.py +0 -9
  123. jamlib-2.6.0b0.dev4/src/jam/paseto/__init__.py +0 -19
  124. jamlib-2.6.0b0.dev4/src/jam/quick/__init__.py +0 -26
  125. jamlib-2.6.0b0.dev4/src/jam/quick/jwt.py +0 -245
  126. jamlib-2.6.0b0.dev4/src/jam/sessions/__init__.py +0 -7
  127. jamlib-2.6.0b0.dev4/src/jam/tests/clients.py +0 -914
  128. jamlib-2.6.0b0.dev4/src/jam/tests/fakers.py +0 -51
  129. jamlib-2.6.0b0.dev4/src/jam/utils/config_maker.py +0 -142
  130. jamlib-2.6.0b0.dev4/src/jamlib.egg-info/PKG-INFO +0 -118
  131. jamlib-2.6.0b0.dev4/src/jamlib.egg-info/requires.txt +0 -26
  132. {jamlib-2.6.0b0.dev4 → jamlib-3.0.0}/setup.cfg +0 -0
  133. {jamlib-2.6.0b0.dev4 → jamlib-3.0.0}/src/jam/ext/__init__.py +0 -0
  134. {jamlib-2.6.0b0.dev4/src/jam/aio → jamlib-3.0.0/src/jam}/oauth2/builtin/__init__.py +0 -0
  135. {jamlib-2.6.0b0.dev4 → jamlib-3.0.0}/src/jam/oauth2/builtin/github.py +0 -0
  136. {jamlib-2.6.0b0.dev4 → jamlib-3.0.0}/src/jam/oauth2/builtin/gitlab.py +0 -0
  137. {jamlib-2.6.0b0.dev4 → jamlib-3.0.0}/src/jam/oauth2/builtin/google.py +0 -0
  138. {jamlib-2.6.0b0.dev4 → jamlib-3.0.0}/src/jam/oauth2/builtin/yandex.py +0 -0
  139. {jamlib-2.6.0b0.dev4 → jamlib-3.0.0}/src/jam/tests/__init__.py +0 -0
  140. {jamlib-2.6.0b0.dev4 → jamlib-3.0.0}/src/jam/utils/aes.py +0 -0
  141. {jamlib-2.6.0b0.dev4 → jamlib-3.0.0}/src/jam/utils/ed.py +0 -0
  142. {jamlib-2.6.0b0.dev4 → jamlib-3.0.0}/src/jam/utils/otp_keys.py +0 -0
  143. {jamlib-2.6.0b0.dev4 → jamlib-3.0.0}/src/jam/utils/rsa.py +0 -0
  144. {jamlib-2.6.0b0.dev4 → jamlib-3.0.0}/src/jam/utils/symmetric.py +0 -0
  145. {jamlib-2.6.0b0.dev4 → jamlib-3.0.0}/src/jam/utils/xchacha20poly1305.py +0 -0
  146. {jamlib-2.6.0b0.dev4 → jamlib-3.0.0}/src/jam/utils/xor.py +0 -0
  147. {jamlib-2.6.0b0.dev4 → jamlib-3.0.0}/src/jamlib.egg-info/dependency_links.txt +0 -0
  148. {jamlib-2.6.0b0.dev4 → jamlib-3.0.0}/src/jamlib.egg-info/top_level.txt +0 -0
@@ -0,0 +1,173 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ 1. Definitions.
7
+
8
+ "License" shall mean the terms and conditions for use, reproduction,
9
+ and distribution as defined by Sections 1 through 9 of this document.
10
+
11
+ "Licensor" shall mean the copyright owner or entity authorized by
12
+ the copyright owner that is granting the License.
13
+
14
+ "Legal Entity" shall mean the union of the acting entity and all
15
+ other entities that control, are controlled by, or are under common
16
+ control with that entity. For the purposes of this definition,
17
+ "control" means (i) the power, direct or indirect, to cause the
18
+ direction or management of such entity, whether by contract or
19
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
20
+ outstanding shares, or (iii) beneficial ownership of such entity.
21
+
22
+ "You" (or "Your") shall mean an individual or Legal Entity
23
+ exercising permissions granted by this License.
24
+
25
+ "Source" form shall mean the preferred form for making modifications,
26
+ including but not limited to software source code, documentation
27
+ source, and configuration files.
28
+
29
+ "Object" form shall mean any form resulting from mechanical
30
+ transformation or translation of a Source form, including but
31
+ not limited to compiled object code, generated documentation,
32
+ and conversions to other media types.
33
+
34
+ "Work" shall mean the work of authorship, whether in Source or
35
+ Object form, made available under the License, as indicated by a
36
+ copyright notice that is included in or attached to the work
37
+ (an example is provided in the Appendix below).
38
+
39
+ "Derivative Works" shall mean any work, whether in Source or Object
40
+ form, that is based on (or derived from) the Work and for which the
41
+ editorial revisions, annotations, elaborations, or other modifications
42
+ represent, as a whole, an original work of authorship. For the purposes
43
+ of this License, Derivative Works shall not include works that remain
44
+ separable from, or merely link (or bind by name) to the interfaces of,
45
+ the Work and Derivative Works thereof.
46
+
47
+ "Contribution" shall mean any work of authorship, including
48
+ the original version of the Work and any modifications or additions
49
+ to that Work or Derivative Works thereof, that is intentionally
50
+ submitted to Licensor for inclusion in the Work by the copyright owner
51
+ or by an individual or Legal Entity authorized to submit on behalf of
52
+ the copyright owner. For the purposes of this definition, "submitted"
53
+ means any form of electronic, verbal, or written communication sent
54
+ to the Licensor or its representatives, including but not limited to
55
+ communication on electronic mailing lists, source code control systems,
56
+ and issue tracking systems that are managed by, or on behalf of, the
57
+ Licensor for the purpose of discussing and improving the Work, but
58
+ excluding communication that is conspicuously marked or otherwise
59
+ designated in writing by the copyright owner as "Not a Contribution."
60
+
61
+ "Contributor" shall mean Licensor and any individual or Legal Entity
62
+ on behalf of whom a Contribution has been received by Licensor and
63
+ subsequently incorporated within the Work.
64
+
65
+ 2. Grant of Copyright License. Subject to the terms and conditions of
66
+ this License, each Contributor hereby grants to You a perpetual,
67
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
68
+ copyright license to reproduce, prepare Derivative Works of,
69
+ publicly display, publicly perform, sublicense, and distribute the
70
+ Work and such Derivative Works in Source or Object form.
71
+
72
+ 3. Grant of Patent License. Subject to the terms and conditions of
73
+ this License, each Contributor hereby grants to You a perpetual,
74
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
75
+ (except as stated in this section) patent license to make, have made,
76
+ use, offer to sell, sell, import, and otherwise transfer the Work,
77
+ where such license applies only to those patent claims licensable
78
+ by such Contributor that are necessarily infringed by their
79
+ Contribution(s) alone or by combination of their Contribution(s)
80
+ with the Work to which such Contribution(s) was submitted. If You
81
+ institute patent litigation against any entity (including a
82
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
83
+ or a Contribution incorporated within the Work constitutes direct
84
+ or contributory patent infringement, then any patent licenses
85
+ granted to You under this License for that Work shall terminate
86
+ as of the date such litigation is filed.
87
+
88
+ 4. Redistribution. You may reproduce and distribute copies of the
89
+ Work or Derivative Works thereof in any medium, with or without
90
+ modifications, and in Source or Object form, provided that You
91
+ meet the following conditions:
92
+
93
+ (a) You must give any other recipients of the Work or
94
+ Derivative Works a copy of this License; and
95
+
96
+ (b) You must cause any modified files to carry prominent notices
97
+ stating that You changed the files; and
98
+
99
+ (c) You must retain, in the Source form of any Derivative Works
100
+ that You distribute, all copyright, patent, trademark, and
101
+ attribution notices from the Source form of the Work,
102
+ excluding those notices that do not pertain to any part of
103
+ the Derivative Works; and
104
+
105
+ (d) If the Work includes a "NOTICE" text file as part of its
106
+ distribution, then any Derivative Works that You distribute must
107
+ include a readable copy of the attribution notices contained
108
+ within such NOTICE file, excluding those notices that do not
109
+ pertain to any part of the Derivative Works, in at least one
110
+ of the following places: within a NOTICE text file distributed
111
+ as part of the Derivative Works; within the Source form or
112
+ documentation, if provided along with the Derivative Works; or,
113
+ within a display generated by the Derivative Works, if and
114
+ wherever such third-party notices normally appear. The contents
115
+ of the NOTICE file are for informational purposes only and
116
+ do not modify the License. You may add Your own attribution
117
+ notices within Derivative Works that You distribute, alongside
118
+ or as an addendum to the NOTICE text from the Work, provided
119
+ that such additional attribution notices cannot be construed
120
+ as modifying the License.
121
+
122
+ You may add Your own copyright statement to Your modifications and
123
+ may provide additional or different license terms and conditions
124
+ for use, reproduction, or distribution of Your modifications, or
125
+ for any such Derivative Works as a whole, provided Your use,
126
+ reproduction, and distribution of the Work otherwise complies with
127
+ the conditions stated in this License.
128
+
129
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
130
+ any Contribution intentionally submitted for inclusion in the Work
131
+ by You to the Licensor shall be under the terms and conditions of
132
+ this License, without any additional terms or conditions.
133
+ Notwithstanding the above, nothing herein shall supersede or modify
134
+ the terms of any separate license agreement you may have executed
135
+ with Licensor regarding such Contributions.
136
+
137
+ 6. Trademarks. This License does not grant permission to use the trade
138
+ names, trademarks, service marks, or product names of the Licensor,
139
+ except as required for reasonable and customary use in describing the
140
+ origin of the Work and reproducing the content of the NOTICE file.
141
+
142
+ 7. Disclaimer of Warranty. Unless required by applicable law or
143
+ agreed to in writing, Licensor provides the Work (and each
144
+ Contributor provides its Contributions) on an "AS IS" BASIS,
145
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
146
+ implied, including, without limitation, any warranties or conditions
147
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
148
+ PARTICULAR PURPOSE. You are solely responsible for determining the
149
+ appropriateness of using or redistributing the Work and assume any
150
+ risks associated with Your exercise of permissions under this License.
151
+
152
+ 8. Limitation of Liability. In no event and under no legal theory,
153
+ whether in tort (including negligence), contract, or otherwise,
154
+ unless required by applicable law (such as deliberate and grossly
155
+ negligent acts) or agreed to in writing, shall any Contributor be
156
+ liable to You for damages, including any direct, indirect, special,
157
+ incidental, or consequential damages of any character arising as a
158
+ result of this License or out of the use or inability to use the
159
+ Work (including but not limited to damages for loss of goodwill,
160
+ work stoppage, computer failure or malfunction, or any and all
161
+ other commercial damages or losses), even if such Contributor
162
+ has been advised of the possibility of such damages.
163
+
164
+ 9. Accepting Warranty or Additional Liability. While redistributing
165
+ the Work or Derivative Works thereof, You may choose to offer,
166
+ and charge a fee for, acceptance of support, warranty, indemnity,
167
+ or other liability obligations and/or rights consistent with this
168
+ License. However, in accepting such obligations, You may act only
169
+ on Your own behalf and on Your sole responsibility, not on behalf
170
+ of any other Contributor, and only if You agree to indemnify,
171
+ defend, and hold each Contributor harmless for any liability
172
+ incurred by, or claims asserted against, such Contributor by reason
173
+ of your accepting any such warranty or additional liability.
jamlib-3.0.0/PKG-INFO ADDED
@@ -0,0 +1,117 @@
1
+ Metadata-Version: 2.4
2
+ Name: jamlib
3
+ Version: 3.0.0
4
+ Summary: Simple and universal library for authorization.
5
+ Author-email: Makridenko Adrian <adrianmakridenko@duck.com>, Ksenia Travnikova <kseniatravnikova@duck.com>
6
+ License: Apache-2.0
7
+ Project-URL: Homepage, https://jam.makridenko.ru
8
+ Project-URL: Repository, https://github.com/lyaguxafrog/jam
9
+ Project-URL: Issues, https://github.com/lyaguxafrog/jam/issues
10
+ Project-URL: Changelog, https://github.com/lyaguxafrog/jam/blob/master/CHANGELOG.md
11
+ Keywords: Authentication,Backend,JWT,Sessions,OTP,TOTP,OAuth2,Litestar,FastAPI,Starlette,Flask
12
+ Classifier: License :: OSI Approved :: Apache Software License
13
+ Classifier: Development Status :: 5 - Production/Stable
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Intended Audience :: Information Technology
17
+ Classifier: Programming Language :: Python
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Programming Language :: Python :: 3 :: Only
24
+ Classifier: Topic :: Internet :: WWW/HTTP :: Session
25
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
26
+ Classifier: Topic :: Internet
27
+ Classifier: Typing :: Typed
28
+ Classifier: Framework :: Flask
29
+ Classifier: Framework :: FastAPI
30
+ Requires-Python: >=3.10
31
+ Description-Content-Type: text/markdown
32
+ License-File: LICENSE.md
33
+ Requires-Dist: cryptography>=46.0.5
34
+ Provides-Extra: redis
35
+ Requires-Dist: redis>=7.3.0; extra == "redis"
36
+ Provides-Extra: json
37
+ Requires-Dist: tinydb>=4.8.2; extra == "json"
38
+ Provides-Extra: yaml
39
+ Requires-Dist: pyyaml>=6.0.3; extra == "yaml"
40
+ Provides-Extra: toml
41
+ Requires-Dist: toml>=0.10.2; extra == "toml"
42
+ Provides-Extra: litestar
43
+ Requires-Dist: litestar>=2.21.1; extra == "litestar"
44
+ Provides-Extra: starlette
45
+ Requires-Dist: starlette>=0.52.1; extra == "starlette"
46
+ Provides-Extra: fastapi
47
+ Requires-Dist: fastapi>=0.135.1; extra == "fastapi"
48
+ Provides-Extra: flask
49
+ Requires-Dist: flask>=3.1.2; extra == "flask"
50
+ Dynamic: license-file
51
+
52
+ # Jam
53
+
54
+ ![logo](https://github.com/lyaguxafrog/jam/blob/master/docs/assets/h_logo_n_title.png?raw=true)
55
+
56
+ ![Python Version](https://img.shields.io/badge/Python-3.10+-blue?logo=python&logoColor=white)
57
+ [![PyPI - Version](https://img.shields.io/pypi/v/jamlib)](https://pypi.org/project/jamlib/)
58
+ [![PyPI Downloads](https://static.pepy.tech/personalized-badge/jamlib?period=total&units=INTERNATIONAL_SYSTEM&left_color=GRAY&right_color=RED&left_text=Downloads)](https://pypi.org/project/jamlib/)
59
+ ![tests](https://github.com/lyaguxafrog/jam/actions/workflows/run-tests.yml/badge.svg)
60
+ [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/lyaguxafrog/jam)
61
+ [![GitHub License](https://img.shields.io/github/license/lyaguxafrog/jam)](https://github.com/lyaguxafrog/jam/blob/master/LICENSE.md)
62
+
63
+ * Documentation: [jam.makridenko.ru](https://jam.makridenko.ru)
64
+ * Changelog: [CHANGELOG.md](https://github.com/lyaguxafrog/jam/blob/master/CHANGELOG.md)
65
+
66
+
67
+ ## Install
68
+ ```bash
69
+ pip install jamlib
70
+ ```
71
+
72
+ ## Quick example
73
+ ```python
74
+ from jam import Jam
75
+
76
+ jam = Jam(config="config.toml")
77
+
78
+ jwt = jam.jwt_create({"user": 1})
79
+ session_id = jam.session_create(session_key="username", data={"user": 1})
80
+ otp_code = jam.otp_code(secret="3DB7FOAOFBCI3WFDRE7EPF43CA")
81
+ ```
82
+
83
+ ## Why Jam?
84
+ Jam is a library that provides the most popular AUTH* mechanisms right out of the box.
85
+
86
+ * [JWT](https://jam.makridenko.ru/usage/jwt/)
87
+ * [PASETO](https://jam.makridenko.ru/usage/paseto/)
88
+ * [Server side sessions](https://jam.makridenko.ru/usage/sessions/)
89
+ * [OTP](https://jam.makridenko.ru/usage/otp/)
90
+ * [OAuth2](https://jam.makridenko.ru/usage/oauth2/)
91
+
92
+ ### Framework integrations
93
+
94
+ Jam provides ready-to-use integrations for the most popular frameworks:
95
+
96
+ * [FastAPI](https://jam.makridenko.ru/framework_integrations/fastapi)
97
+ * [Starlette](https://jam.makridenko.ru/framework_integrations/starlette)
98
+ * [Litestar](https://jam.makridenko.ru/framework_integrations/litestar)
99
+ * [Flask](https://jam.makridenko.ru/framework_integrations/flask)
100
+
101
+ Each integration offers built-in middleware or plugin support for JWT and session-based authentication.
102
+
103
+ ### Why choose Jam?
104
+ Jam supports many authentication methods out of the box with minimal dependencies.
105
+ Here is a comparison with other libraries:
106
+
107
+
108
+ | Features / Library | **Jam** | [Authx](https://authx.yezz.me/) | [PyJWT](https://pyjwt.readthedocs.io) | [AuthLib](https://docs.authlib.org) | [OTP Auth](https://otp.authlib.org/) |
109
+ |-----------------------|--------|----------------------------------|---------------------------------------|-------------------------------------|--------------------------------------|
110
+ | JWT | ✅ | ✅ | ✅ | ✅ | ❌ |
111
+ | JWT black/white lists | ✅ | ❌ | ❌ | ❌ | ❌ |
112
+ | PASETO | ✅ | ❌ | ❌ | ❌ | ❌ |
113
+ | Server side sessions | ✅ | ✅ | ❌ | ❌ | ❌ |
114
+ | OTP | ✅ | ❌ | ❌ | ❌ | ✅ |
115
+ | OAuth2 | ✅ | ✅ | ❌ | ✅ | ❌ |
116
+ | Flexible config | ✅ | ❌ | ❌ | ❌ | ❌ |
117
+ | Modularity | ✅ | ❌ | ❌ | ❌ | ❌ |
jamlib-3.0.0/README.md ADDED
@@ -0,0 +1,66 @@
1
+ # Jam
2
+
3
+ ![logo](https://github.com/lyaguxafrog/jam/blob/master/docs/assets/h_logo_n_title.png?raw=true)
4
+
5
+ ![Python Version](https://img.shields.io/badge/Python-3.10+-blue?logo=python&logoColor=white)
6
+ [![PyPI - Version](https://img.shields.io/pypi/v/jamlib)](https://pypi.org/project/jamlib/)
7
+ [![PyPI Downloads](https://static.pepy.tech/personalized-badge/jamlib?period=total&units=INTERNATIONAL_SYSTEM&left_color=GRAY&right_color=RED&left_text=Downloads)](https://pypi.org/project/jamlib/)
8
+ ![tests](https://github.com/lyaguxafrog/jam/actions/workflows/run-tests.yml/badge.svg)
9
+ [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/lyaguxafrog/jam)
10
+ [![GitHub License](https://img.shields.io/github/license/lyaguxafrog/jam)](https://github.com/lyaguxafrog/jam/blob/master/LICENSE.md)
11
+
12
+ * Documentation: [jam.makridenko.ru](https://jam.makridenko.ru)
13
+ * Changelog: [CHANGELOG.md](https://github.com/lyaguxafrog/jam/blob/master/CHANGELOG.md)
14
+
15
+
16
+ ## Install
17
+ ```bash
18
+ pip install jamlib
19
+ ```
20
+
21
+ ## Quick example
22
+ ```python
23
+ from jam import Jam
24
+
25
+ jam = Jam(config="config.toml")
26
+
27
+ jwt = jam.jwt_create({"user": 1})
28
+ session_id = jam.session_create(session_key="username", data={"user": 1})
29
+ otp_code = jam.otp_code(secret="3DB7FOAOFBCI3WFDRE7EPF43CA")
30
+ ```
31
+
32
+ ## Why Jam?
33
+ Jam is a library that provides the most popular AUTH* mechanisms right out of the box.
34
+
35
+ * [JWT](https://jam.makridenko.ru/usage/jwt/)
36
+ * [PASETO](https://jam.makridenko.ru/usage/paseto/)
37
+ * [Server side sessions](https://jam.makridenko.ru/usage/sessions/)
38
+ * [OTP](https://jam.makridenko.ru/usage/otp/)
39
+ * [OAuth2](https://jam.makridenko.ru/usage/oauth2/)
40
+
41
+ ### Framework integrations
42
+
43
+ Jam provides ready-to-use integrations for the most popular frameworks:
44
+
45
+ * [FastAPI](https://jam.makridenko.ru/framework_integrations/fastapi)
46
+ * [Starlette](https://jam.makridenko.ru/framework_integrations/starlette)
47
+ * [Litestar](https://jam.makridenko.ru/framework_integrations/litestar)
48
+ * [Flask](https://jam.makridenko.ru/framework_integrations/flask)
49
+
50
+ Each integration offers built-in middleware or plugin support for JWT and session-based authentication.
51
+
52
+ ### Why choose Jam?
53
+ Jam supports many authentication methods out of the box with minimal dependencies.
54
+ Here is a comparison with other libraries:
55
+
56
+
57
+ | Features / Library | **Jam** | [Authx](https://authx.yezz.me/) | [PyJWT](https://pyjwt.readthedocs.io) | [AuthLib](https://docs.authlib.org) | [OTP Auth](https://otp.authlib.org/) |
58
+ |-----------------------|--------|----------------------------------|---------------------------------------|-------------------------------------|--------------------------------------|
59
+ | JWT | ✅ | ✅ | ✅ | ✅ | ❌ |
60
+ | JWT black/white lists | ✅ | ❌ | ❌ | ❌ | ❌ |
61
+ | PASETO | ✅ | ❌ | ❌ | ❌ | ❌ |
62
+ | Server side sessions | ✅ | ✅ | ❌ | ❌ | ❌ |
63
+ | OTP | ✅ | ❌ | ❌ | ❌ | ✅ |
64
+ | OAuth2 | ✅ | ✅ | ❌ | ✅ | ❌ |
65
+ | Flexible config | ✅ | ❌ | ❌ | ❌ | ❌ |
66
+ | Modularity | ✅ | ❌ | ❌ | ❌ | ❌ |
@@ -1,12 +1,12 @@
1
1
  [project]
2
2
  name = "jamlib"
3
- version = "2.6.0b0.dev4"
3
+ version = "3.0.0"
4
4
  description = "Simple and universal library for authorization."
5
5
  authors = [
6
6
  {name = "Makridenko Adrian",email = "adrianmakridenko@duck.com"},
7
7
  {name = "Ksenia Travnikova",email = "kseniatravnikova@duck.com"}
8
8
  ]
9
- license = {text = "MIT License"}
9
+ license = {text = "Apache-2.0"}
10
10
  readme = {file = "README.md", content-type = "text/markdown"}
11
11
  keywords = [
12
12
  "Authentication",
@@ -21,21 +21,19 @@ keywords = [
21
21
  "Starlette",
22
22
  "Flask"
23
23
  ]
24
- requires-python = ">=3.9"
24
+ requires-python = ">=3.10"
25
25
  dependencies = [
26
- "pycryptodome>=3.21.0,<4.0.0",
27
- "cryptography (>=44.0.2,<45.0.0)",
26
+ "cryptography>=46.0.5",
28
27
  ]
29
28
 
30
29
  classifiers = [
31
- "License :: OSI Approved :: MIT License",
30
+ "License :: OSI Approved :: Apache Software License",
32
31
  "Development Status :: 5 - Production/Stable",
33
32
  "Operating System :: OS Independent",
34
33
  "Intended Audience :: Developers",
35
34
  "Intended Audience :: Information Technology",
36
35
  "Programming Language :: Python",
37
36
  "Programming Language :: Python :: 3",
38
- "Programming Language :: Python :: 3.9",
39
37
  "Programming Language :: Python :: 3.10",
40
38
  "Programming Language :: Python :: 3.11",
41
39
  "Programming Language :: Python :: 3.12",
@@ -53,21 +51,21 @@ classifiers = [
53
51
  Homepage = "https://jam.makridenko.ru"
54
52
  Repository = "https://github.com/lyaguxafrog/jam"
55
53
  Issues = "https://github.com/lyaguxafrog/jam/issues"
56
- Changelog = "https://github.com/lyaguxafrog/jam/releases"
54
+ Changelog = "https://github.com/lyaguxafrog/jam/blob/master/CHANGELOG.md"
57
55
 
58
56
 
59
57
  [project.optional-dependencies]
60
- redis=["redis>=6.4.0"]
58
+ redis=["redis>=7.3.0"]
61
59
  json=["tinydb>=4.8.2"]
62
- yaml=["pyyaml>=6.0.2"]
60
+ yaml=["pyyaml>=6.0.3"]
63
61
  toml=["toml>=0.10.2"]
64
- litestar=["litestar>=2.18.0"]
65
- starlette=["starlette>=0.48.0"]
66
- fastapi=["fastapi>=0.119.0"]
62
+ litestar=["litestar>=2.21.1"]
63
+ starlette=["starlette>=0.52.1"]
64
+ fastapi=["fastapi>=0.135.1"]
67
65
  flask=["flask>=3.1.2"]
68
66
 
69
67
  [build-system]
70
- requires = ["setuptools>=61.0", "wheel"]
68
+ requires = ["setuptools>=82.0.1", "wheel"]
71
69
  build-backend = "setuptools.build_meta"
72
70
 
73
71
  [tool.setuptools.packages.find]
@@ -76,62 +74,72 @@ include = ["jam*"]
76
74
 
77
75
  [dependency-groups]
78
76
  dev = [
79
- "black>=25.1.0",
80
- "fakeredis>=2.28.1",
81
- "icecream>=2.1.4",
82
- "isort>=6.0.1",
83
- "pre-commit>=4.2.0",
84
- "pyrefly>=0.39.1",
85
- "ruff>=0.11.2",
86
- "uvicorn>=0.37.0",
77
+ "fakeredis>=2.34.1",
78
+ "icecream>=2.1.10",
79
+ "pre-commit>=4.5.1",
80
+ "pyrefly>=0.56.0",
81
+ "ruff>=0.15.6",
82
+ "unicecream>=0.2.1",
83
+ "uvicorn>=0.41.0",
87
84
  ]
88
85
  docs = [
89
86
  "mkdocs>=1.6.1",
87
+ "mkdocs-gen-files>=0.6.0",
88
+ "mkdocs-literate-nav>=0.6.2",
90
89
  "mkdocs-material>=9.6.19",
91
90
  "mkdocstrings>=0.30.0",
92
91
  "mkdocstrings-python>=1.18.2",
93
92
  "termynal>=0.13.0",
94
93
  ]
95
94
  tests = [
96
- "pytest>=8.4.2",
97
- "pytest-asyncio>=1.1.0",
95
+ "pytest>=9.0.2",
96
+ "pytest-asyncio>=1.3.0",
97
+ "coverage>=7.13.4"
98
98
  ]
99
99
 
100
100
 
101
101
  [tool.ruff]
102
- target-version = "py39"
102
+ target-version = "py310"
103
103
  line-length = 80
104
- ignore = ["UP009", "D100"]
105
- exclude = ["*__init__.py", "tests/", "*exceptions/"]
104
+ ignore = ["UP009", "D100", "UP007"]
105
+ exclude = ["*__init__.py", "tests/", "*exceptions/", "env", ".env", ".env.example", "migrations/", ".venv/"]
106
106
 
107
107
  [tool.ruff.lint]
108
- extend-select = ["UP", "D"]
108
+ extend-select = ["UP", "D", "I"]
109
109
 
110
110
  [tool.ruff.lint.pydocstyle]
111
111
  convention = "google"
112
112
 
113
- [tool.isort]
114
- profile = "black"
115
- default_section = "THIRDPARTY"
116
- balanced_wrapping = true
117
- known_first_party = "src"
118
- line_length = 80
119
- lines_after_imports = 2
120
- lines_between_sections = 1
121
- multi_line_output = 3
122
- sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
123
- skip = ["env", ".env", ".env.example", "migrations/", ".venv/"]
124
-
125
- [tool.black]
126
- line-length = 80
127
- skip-string-normalization = false
113
+ [tool.ruff.lint.isort]
114
+ known-first-party = ["jam"]
115
+ split-on-trailing-comma = true
116
+ force-wrap-aliases = true
117
+ force-sort-within-sections = true
118
+ lines-after-imports = 2
119
+ lines-between-types = 1
128
120
 
129
- [tool.mypy]
130
- disable_error_code = ["no-redef", "import-not-found", "import-untyped", "attr-defined"]
121
+ [tool.ruff.format]
122
+ quote-style = "double"
123
+ skip-magic-trailing-comma = false
124
+ line-ending = "auto"
131
125
 
132
126
  [tool.pytest]
133
127
  python_files = ["test*.py"]
134
-
135
- [tool.pytest.ini_options]
136
- addopts = "--capture=no"
128
+ addopts = ["--capture=no"]
137
129
  asyncio_default_fixture_loop_scope = "function"
130
+
131
+ [tool.unicecream]
132
+ exclude = ["__devtools/"]
133
+
134
+ [tool.pyrefly]
135
+ python_version = "3.10"
136
+ project_includes = ["src/jam/**/*.py"]
137
+ project_excludes = [
138
+ ".venv",
139
+ "venv",
140
+ "build",
141
+ "dist",
142
+ "__pycache__",
143
+ "tests/",
144
+ "docs/",
145
+ ]