pyrad 2.5.2__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 (59) hide show
  1. pyrad-2.5.2/CHANGES.rst +311 -0
  2. pyrad-2.5.2/LICENSE.txt +31 -0
  3. pyrad-2.5.2/MANIFEST.in +7 -0
  4. pyrad-2.5.2/PKG-INFO +129 -0
  5. pyrad-2.5.2/README.rst +94 -0
  6. pyrad-2.5.2/TODO.rst +2 -0
  7. pyrad-2.5.2/docs/Makefile +20 -0
  8. pyrad-2.5.2/docs/make.bat +36 -0
  9. pyrad-2.5.2/docs/source/_static/logo.png +0 -0
  10. pyrad-2.5.2/docs/source/api/client.rst +10 -0
  11. pyrad-2.5.2/docs/source/api/dictionary.rst +10 -0
  12. pyrad-2.5.2/docs/source/api/host.rst +7 -0
  13. pyrad-2.5.2/docs/source/api/packet.rst +48 -0
  14. pyrad-2.5.2/docs/source/api/proxy.rst +7 -0
  15. pyrad-2.5.2/docs/source/api/server.rst +13 -0
  16. pyrad-2.5.2/docs/source/conf.py +163 -0
  17. pyrad-2.5.2/docs/source/index.rst +104 -0
  18. pyrad-2.5.2/example/acct.py +41 -0
  19. pyrad-2.5.2/example/auth.py +37 -0
  20. pyrad-2.5.2/example/auth_async.py +164 -0
  21. pyrad-2.5.2/example/client-coa.py +61 -0
  22. pyrad-2.5.2/example/coa.py +40 -0
  23. pyrad-2.5.2/example/dictionary +405 -0
  24. pyrad-2.5.2/example/dictionary.freeradius +91 -0
  25. pyrad-2.5.2/example/pyrad.log +0 -0
  26. pyrad-2.5.2/example/server.py +68 -0
  27. pyrad-2.5.2/example/server_async.py +117 -0
  28. pyrad-2.5.2/example/status.py +26 -0
  29. pyrad-2.5.2/pyproject.toml +63 -0
  30. pyrad-2.5.2/pyrad/__init__.py +46 -0
  31. pyrad-2.5.2/pyrad/bidict.py +39 -0
  32. pyrad-2.5.2/pyrad/client.py +229 -0
  33. pyrad-2.5.2/pyrad/client_async.py +415 -0
  34. pyrad-2.5.2/pyrad/curved.py +81 -0
  35. pyrad-2.5.2/pyrad/dictfile.py +114 -0
  36. pyrad-2.5.2/pyrad/dictionary.py +399 -0
  37. pyrad-2.5.2/pyrad/host.py +100 -0
  38. pyrad-2.5.2/pyrad/packet.py +984 -0
  39. pyrad-2.5.2/pyrad/proxy.py +67 -0
  40. pyrad-2.5.2/pyrad/server.py +341 -0
  41. pyrad-2.5.2/pyrad/server_async.py +335 -0
  42. pyrad-2.5.2/pyrad/tests/__init__.py +5 -0
  43. pyrad-2.5.2/pyrad/tests/mock.py +145 -0
  44. pyrad-2.5.2/pyrad/tests/test_bidict.py +56 -0
  45. pyrad-2.5.2/pyrad/tests/test_client.py +183 -0
  46. pyrad-2.5.2/pyrad/tests/test_dictionary.py +357 -0
  47. pyrad-2.5.2/pyrad/tests/test_host.py +87 -0
  48. pyrad-2.5.2/pyrad/tests/test_packet.py +679 -0
  49. pyrad-2.5.2/pyrad/tests/test_proxy.py +96 -0
  50. pyrad-2.5.2/pyrad/tests/test_server.py +323 -0
  51. pyrad-2.5.2/pyrad/tests/test_tools.py +126 -0
  52. pyrad-2.5.2/pyrad/tools.py +332 -0
  53. pyrad-2.5.2/pyrad.egg-info/PKG-INFO +129 -0
  54. pyrad-2.5.2/pyrad.egg-info/SOURCES.txt +57 -0
  55. pyrad-2.5.2/pyrad.egg-info/dependency_links.txt +1 -0
  56. pyrad-2.5.2/pyrad.egg-info/requires.txt +13 -0
  57. pyrad-2.5.2/pyrad.egg-info/top_level.txt +5 -0
  58. pyrad-2.5.2/pyrad.egg-info/zip-safe +1 -0
  59. pyrad-2.5.2/setup.cfg +4 -0
@@ -0,0 +1,311 @@
1
+ Changelog
2
+ =========
3
+
4
+ 2.5.2 - Jan 29, 2026
5
+ --------------------
6
+
7
+ * Fix readthedocs
8
+
9
+ 2.5.1 - Jan 29, 2026
10
+ --------------------
11
+
12
+ * Fix build and release infra
13
+
14
+ 2.5.0 - Jan 29, 2026
15
+ --------------------
16
+
17
+ * Drop support of Python 2.x
18
+
19
+ * Add salt decryption of encrypted attributes
20
+
21
+ * Fix #194 salt-encryption
22
+
23
+ * Fix #213 EncodeIPv6Prefix
24
+
25
+ * Fix for UTF-8
26
+
27
+ * Fix fix usage of socket.getaddrinfo
28
+
29
+ * Fix #197 KeyError when handling CoA packet for 0.0.0.0
30
+
31
+ * Fix create CoA packet in client_async
32
+
33
+ * Fix #152 and add corresponding unittests
34
+
35
+ * Fixed unittests
36
+
37
+ 2.4 - Nov 23, 2020
38
+ ------------------
39
+
40
+ * Support poetry for for building this project
41
+
42
+ * Use secrets.SysRandom instead of random.SystemRandom if possible
43
+
44
+ * `.get` on Packets has an optional default parameter (to mimic dict.get())
45
+
46
+ * Fix: digestmod is not optional in python3.8 anymore
47
+
48
+ * Fix: authenticator was refreshed before the packet was generated
49
+
50
+ * Fix bug causing Message-Authenticator verification to fail if
51
+ multiple instances of an attribute do not appear sequentially in
52
+ the attributes list
53
+
54
+ * Fixed #140 VerifyReply broken when multiple instances of same attribute are
55
+ not adjacent on reply
56
+
57
+ * Fixed #135 Missing send_packet for async Client
58
+
59
+ * Fixed #126 python3 support for SaltCrypt
60
+ (was previously broken)
61
+
62
+ 2.3 - Feb 6, 2020
63
+ -----------------
64
+
65
+ * Fixed #124 remove reuse_address=True from async server/client
66
+
67
+ * Fixed #121 Unknown attribute key error
68
+
69
+ 2.2 - Oct 19, 2019
70
+ ------------------
71
+
72
+ * Add message authenticator support (attribute 80)
73
+
74
+ * Add support for multiple values of the same attribute (#95)
75
+
76
+ * Add experimental async client and server implementation for python >=3.5.
77
+
78
+ * Add IPv6 bind support for client and server.
79
+
80
+ * Add support of tlv and integer64 attributes.
81
+
82
+ * Multiple minor enhancements and fixes.
83
+
84
+ 2.1 - Feb 2, 2017
85
+ -----------------
86
+
87
+ * Add CoA support (client and server).
88
+
89
+ * Add tagged attribute support (send only).
90
+
91
+ * Add salt encryption support (encrypt 2).
92
+
93
+ * Add ascend data filter support (human readable format to octets).
94
+
95
+ * Add ipv6 address and prefix support.
96
+
97
+ * Add support for octet strings in hex (starting with 0x).
98
+
99
+ * Add support for types short, signed and byte.
100
+
101
+ * Add support for VSA's with multiple sub TLV's.
102
+
103
+ * Use a different random generator to improve the security of generated
104
+ packet ids and authenticators.
105
+
106
+
107
+ 2.0 - May 15, 2011
108
+ ------------------
109
+
110
+ * Start moving codebase to PEP8 compatible coding style.
111
+
112
+ * Add support for Python 3.2.
113
+
114
+ * Several code cleanups. As a side effect Python versions before 2.6
115
+ are unfortunatley no longer supported. If you use Python 2.5 or older
116
+ Pyrad 1.2 will still work for you.
117
+
118
+
119
+ 1.2 - July 12, 2009
120
+ -------------------
121
+
122
+ * Setup sphinx based documentation.
123
+
124
+ * Use hashlib instead of md5, if present. This fixes deprecation warnings
125
+ for python 2.6. Patch from Jeremy Liané.
126
+
127
+ * Support parsing VENDOR format specifications in dictionary files. Patch by
128
+ Kristoffer Grönlun.
129
+
130
+ * Supprt $INCLUDE directores in dictionary files. Patch by
131
+ Kristoffer Grönlun.
132
+
133
+ * Standardize on 4 spaces for indents. Patch by Kristoffer Grönlund/
134
+ Purplescout.
135
+
136
+ * Make sure all encoding utility methods raise a TypeError if a value of
137
+ the wrong type is passed in.
138
+
139
+
140
+ 1.1 - September 30, 2007
141
+ ------------------------
142
+
143
+ * Add the 'octets' datatype from FreeRADIUS. This is treated just like string;
144
+ the only difference is how FreeRADIUS prints it.
145
+
146
+ * Check against unimplemented datatypes in EncodeData and DecodeData instead
147
+ of assuming an identity transform works.
148
+
149
+ * Make Packet.has_key and __contains__ gracefully handle unknown attributes.
150
+ Based on a patch from Alexey V Michurun <am@rol.ru>.
151
+
152
+ * Add a __delitem__ implementation to Packet. Based on a patch from
153
+ Alexey V Michurun <am@rol.ru>.
154
+
155
+
156
+ 1.0 - September 16, 2007
157
+ ------------------------
158
+
159
+ * Add unit tests. Pyrad now has 100% test coverage!
160
+
161
+ * Moved the proxy server has been out of the server module to a new
162
+ proxy module.
163
+
164
+ * Fix several errors that prevented the proxy code from working.
165
+
166
+ * Use the standard logging module instead of printing to stdout.
167
+
168
+ * The default dictionary for Server instances was shared between all
169
+ instances, possibly leading to unwanted data pollution. Each Server now
170
+ gets its own dict instance if none is passed in to the constructor.
171
+
172
+ * Fixed a timeout handling problem in the client: after receiving an
173
+ invalid reply the current time was not updated, possibly leading to
174
+ the client blocking forever.
175
+
176
+ * Switch to setuptools, allowing pyrad to be distributed as an egg
177
+ via the python package index.
178
+
179
+ * Use absolute instead of relative imports.
180
+
181
+ * Sockets are now opened with SO_REUSEADDR enabled to allow for faster
182
+ restarts.
183
+
184
+
185
+ 0.9 - April 25, 2007
186
+ ------------------------
187
+
188
+ * Start using trac to manage the project: http://code.wiggy.net/tracker/pyrad/
189
+
190
+ * [bug 3] Fix handling of packets with an id of 0
191
+
192
+ * [bug 2] Fix handling of file descriptor parameters in the server
193
+ code and example.
194
+
195
+ * [bug 4] Fix wrong variable name in exception raised when encountering
196
+ an overly long packet.
197
+
198
+ * [bug 5] Fix error message in parse error for dictionaries.
199
+
200
+ * [bug 8] Packet.CreateAuthenticator is now a static method.
201
+
202
+
203
+ 0.8
204
+ ---
205
+
206
+ * Fix time-handling in the client packet sending code: it would loop
207
+ forever since the now time was updated at the wrong moment. Fix from
208
+ Michael Mitchell <Michael.Mitchell@team.telstra.com>
209
+
210
+ * Fix passing of dict parameter when creating reply packets
211
+
212
+
213
+ 0.7
214
+ ---
215
+
216
+ * add HandleAuthPacket and HandleAcctPacket hooks to Server class.
217
+ Request from Thomas Boettcher.
218
+
219
+ * Pass on dict attribute when creating a reply packet. Requested by
220
+ Thomas Boettcher.
221
+
222
+ * Allow specififying new attributes when using
223
+ Server.CreateReplyPacket. Requested by Thomas Boettcher.
224
+
225
+
226
+ 0.6
227
+ ---
228
+
229
+ * packet.VerifyReply() had a syntax error when not called with a raw packet.
230
+
231
+ * Add bind() method to the Client class.
232
+
233
+ * [SECURITY] Fix handling of timeouts in client module: when a bad
234
+ packet was received pyrad immediately started the next retry instead of
235
+ discarding it and waiting for a timeout. This could be exploited by
236
+ sending a number of bogus responses before a correct reply to make pyrad
237
+ not see the real response.
238
+
239
+ * correctly set Acct-Delay-Time when resending accounting requests packets.
240
+
241
+ * verify account request packages as well (from Farshad Khoshkhui).
242
+
243
+ * protect against packets with bogus lengths (from Farshad Khoshkhui).
244
+
245
+
246
+ 0.5
247
+ ---
248
+
249
+ * Fix typo in server class which broke handling of accounting packets.
250
+
251
+ * Create seperate AuthPacket and AcctPacket classes; this resulted in
252
+ a fair number of API changes.
253
+
254
+ * Packets now know how to create and verify replies.
255
+
256
+ * Client now directs authentication and accounting packets to the
257
+ correct port on the server.
258
+
259
+ * Add twisted support via the new curved module.
260
+
261
+ * Fix incorrect exception handling in client code.
262
+
263
+ * Update example server to handle accounting packets.
264
+
265
+ * Add example for sending account packets.
266
+
267
+
268
+ 0.4
269
+ ---
270
+
271
+ * Fix last case of bogus exception usage.
272
+
273
+ * Move RADIUS code constants to packet module.
274
+
275
+ * Add support for decoding passwords and generating reply packets to Packet
276
+ class.
277
+
278
+ * Add basic RADIUS server and proxy implementation.
279
+
280
+
281
+ 0.3
282
+ ---
283
+
284
+ * client.Timeout is now derived from Exception.
285
+
286
+ * Docstring documentation added.
287
+
288
+ * Include example dictionaries and authentication script.
289
+
290
+
291
+ 0.2
292
+ ---
293
+
294
+ * Use proper exceptions.
295
+
296
+ * Encode and decode vendor attributes.
297
+
298
+ * Dictionary can parse vendor dictionaries.
299
+
300
+ * Dictionary can handle attribute values.
301
+
302
+ * Enhance most constructors; they now take extra optional parameters
303
+ with initialisation info.
304
+
305
+ * No longer use obsolete python interfaces like whrandom.
306
+
307
+
308
+ 0.1
309
+ ---
310
+
311
+ * First release
@@ -0,0 +1,31 @@
1
+ Copyright 2020 Istvan Ruzman. All rights reserved.
2
+ Copyright 2017-2026 Christian Giese. All rights reserved.
3
+ Copyright 2007-2008 Simplon. All rights reserved.
4
+ Copyright 2002-2008 Wichert Akkerman. All rights reserved.
5
+
6
+ All rights reserved.
7
+
8
+ Redistribution and use in source and binary forms, with or without
9
+ modification, are permitted provided that the following conditions
10
+ are met:
11
+ 1. Redistributions of source code must retain the above copyright
12
+ notice, this list of conditions and the following disclaimer.
13
+ 2. Redistributions in binary form must reproduce the above copyright
14
+ notice, this list of conditions and the following disclaimer in the
15
+ documentation and/or other materials provided with the distribution.
16
+ 3. Neither the name of the University nor the names of its contributors
17
+ may be used to endorse or promote products derived from this software
18
+ without specific prior written permission.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23
+ ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30
+ SUCH DAMAGE.
31
+
@@ -0,0 +1,7 @@
1
+ include README.rst
2
+ include CHANGES.rst
3
+ include TODO.rst
4
+ include LICENSE.txt
5
+ recursive-include example *
6
+ recursive-include docs *
7
+ recursive-include tests/data *
pyrad-2.5.2/PKG-INFO ADDED
@@ -0,0 +1,129 @@
1
+ Metadata-Version: 2.4
2
+ Name: pyrad
3
+ Version: 2.5.2
4
+ Summary: RADIUS tools
5
+ Author-email: Istvan Ruzman <istvan@ruzman.eu>, Christian Giese <gic@gicnet.de>, Stefan Lieberth <stefan@lieberth.net>
6
+ License: BSD-3-Clause
7
+ Project-URL: Repository, https://github.com/pyradius/pyrad
8
+ Project-URL: Documentation, https://pyradius-pyrad.readthedocs.io
9
+ Keywords: radius,authentication,AAA,accounting,authorization,RADIUS
10
+ Classifier: Development Status :: 6 - Mature
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.8
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: 3.14
20
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
+ Classifier: Topic :: System :: Systems Administration :: Authentication/Directory
22
+ Requires-Python: >=3.8
23
+ Description-Content-Type: text/x-rst
24
+ License-File: LICENSE.txt
25
+ Requires-Dist: netaddr>=0.8.0
26
+ Requires-Dist: six>=1.16.0
27
+ Provides-Extra: test
28
+ Requires-Dist: pytest>=8; extra == "test"
29
+ Requires-Dist: mock; python_version < "3.10" and extra == "test"
30
+ Provides-Extra: docs
31
+ Requires-Dist: sphinx>=7.0; extra == "docs"
32
+ Requires-Dist: sphinx-autodoc-typehints; extra == "docs"
33
+ Requires-Dist: sphinx-rtd-theme>=2.0; extra == "docs"
34
+ Dynamic: license-file
35
+
36
+
37
+ .. image:: https://github.com/pyradius/pyrad/actions/workflows/python-test.yml/badge.svg?branch=master
38
+ :target: https://github.com/pyradius/pyrad/actions/workflows/python-test.yml
39
+ .. image:: https://coveralls.io/repos/github/pyradius/pyrad/badge.svg?branch=master
40
+ :target: https://coveralls.io/github/pyradius/pyrad?branch=master
41
+ .. image:: https://img.shields.io/pypi/v/pyrad.svg
42
+ :target: https://pypi.python.org/pypi/pyrad
43
+ .. image:: https://img.shields.io/pypi/pyversions/pyrad.svg
44
+ :target: https://pypi.python.org/pypi/pyrad
45
+ .. image:: https://img.shields.io/pypi/dm/pyrad.svg
46
+ :target: https://pypi.python.org/pypi/pyrad
47
+ .. image:: https://readthedocs.org/projects/pyradius-pyrad/badge/?version=latest
48
+ :target: https://pyradius-pyrad.readthedocs.io/en/latest/?badge=latest
49
+ :alt: Documentation Status
50
+ .. image:: https://img.shields.io/pypi/l/pyrad.svg
51
+ :target: https://pypi.python.org/pypi/pyrad
52
+ .. image:: https://img.shields.io/badge/Chat-darkgreen
53
+ :target: https://matrix.to/#/#pyradius:matrix.org
54
+
55
+ Introduction
56
+ ============
57
+
58
+ pyrad is an implementation of a RADIUS client/server as described in RFC2865.
59
+ It takes care of all the details like building RADIUS packets, sending
60
+ them and decoding responses.
61
+
62
+ Here is an example of doing a authentication request::
63
+
64
+ from pyrad.client import Client
65
+ from pyrad.dictionary import Dictionary
66
+ import pyrad.packet
67
+
68
+ srv = Client(server="localhost", secret=b"Kah3choteereethiejeimaeziecumi",
69
+ dict=Dictionary("dictionary"))
70
+
71
+ # create request
72
+ req = srv.CreateAuthPacket(code=pyrad.packet.AccessRequest,
73
+ User_Name="wichert", NAS_Identifier="localhost")
74
+ req["User-Password"] = req.PwCrypt("password")
75
+
76
+ # send request
77
+ reply = srv.SendPacket(req)
78
+
79
+ if reply.code == pyrad.packet.AccessAccept:
80
+ print("access accepted")
81
+ else:
82
+ print("access denied")
83
+
84
+ print("Attributes returned by server:")
85
+ for i in reply.keys():
86
+ print("%s: %s" % (i, reply[i]))
87
+
88
+
89
+
90
+ Requirements & Installation
91
+ ===========================
92
+
93
+ pyrad requires Python 3.8 or later
94
+
95
+ Installing is simple; pyrad uses the standard distutils system for installing
96
+ Python modules::
97
+
98
+ python setup.py install
99
+
100
+
101
+ Author, Copyright, Availability
102
+ ===============================
103
+
104
+ pyrad was written by Wichert Akkerman <wichert@wiggy.net> and is maintained by
105
+ Christian Giese (GIC-de), Istvan Ruzman (Istvan91) and Stefan Lieberth (slieberth).
106
+
107
+ We’re looking for contributors to support the pyrad team! If you’re interested in
108
+ helping with development, testing, documentation, or other areas, please contact
109
+ us directly.
110
+
111
+ This project is licensed under a BSD license.
112
+
113
+ Copyright and license information can be found in the LICENSE.txt file.
114
+
115
+ The current version and documentation can be found on pypi:
116
+ https://pypi.org/project/pyrad/
117
+
118
+ Bugs and wishes can be submitted in the pyrad issue tracker on github:
119
+ https://github.com/pyradius/pyrad/issues
120
+
121
+ Related Projects & Forks
122
+ ========================
123
+
124
+ **pyrad2:** Noteworthy fork with experimental RadSec (RFC 6614) support. Targets Python 3.12+,
125
+ adds extensive type hints, boosts test coverage, and includes fresh bug fixes.
126
+ https://github.com/nicholasamorim/pyrad2
127
+
128
+ **pyrad-server:** Lab-grade RADIUS test server built on top of pyrad.
129
+ https://github.com/slieberth/pyrad-server
pyrad-2.5.2/README.rst ADDED
@@ -0,0 +1,94 @@
1
+
2
+ .. image:: https://github.com/pyradius/pyrad/actions/workflows/python-test.yml/badge.svg?branch=master
3
+ :target: https://github.com/pyradius/pyrad/actions/workflows/python-test.yml
4
+ .. image:: https://coveralls.io/repos/github/pyradius/pyrad/badge.svg?branch=master
5
+ :target: https://coveralls.io/github/pyradius/pyrad?branch=master
6
+ .. image:: https://img.shields.io/pypi/v/pyrad.svg
7
+ :target: https://pypi.python.org/pypi/pyrad
8
+ .. image:: https://img.shields.io/pypi/pyversions/pyrad.svg
9
+ :target: https://pypi.python.org/pypi/pyrad
10
+ .. image:: https://img.shields.io/pypi/dm/pyrad.svg
11
+ :target: https://pypi.python.org/pypi/pyrad
12
+ .. image:: https://readthedocs.org/projects/pyradius-pyrad/badge/?version=latest
13
+ :target: https://pyradius-pyrad.readthedocs.io/en/latest/?badge=latest
14
+ :alt: Documentation Status
15
+ .. image:: https://img.shields.io/pypi/l/pyrad.svg
16
+ :target: https://pypi.python.org/pypi/pyrad
17
+ .. image:: https://img.shields.io/badge/Chat-darkgreen
18
+ :target: https://matrix.to/#/#pyradius:matrix.org
19
+
20
+ Introduction
21
+ ============
22
+
23
+ pyrad is an implementation of a RADIUS client/server as described in RFC2865.
24
+ It takes care of all the details like building RADIUS packets, sending
25
+ them and decoding responses.
26
+
27
+ Here is an example of doing a authentication request::
28
+
29
+ from pyrad.client import Client
30
+ from pyrad.dictionary import Dictionary
31
+ import pyrad.packet
32
+
33
+ srv = Client(server="localhost", secret=b"Kah3choteereethiejeimaeziecumi",
34
+ dict=Dictionary("dictionary"))
35
+
36
+ # create request
37
+ req = srv.CreateAuthPacket(code=pyrad.packet.AccessRequest,
38
+ User_Name="wichert", NAS_Identifier="localhost")
39
+ req["User-Password"] = req.PwCrypt("password")
40
+
41
+ # send request
42
+ reply = srv.SendPacket(req)
43
+
44
+ if reply.code == pyrad.packet.AccessAccept:
45
+ print("access accepted")
46
+ else:
47
+ print("access denied")
48
+
49
+ print("Attributes returned by server:")
50
+ for i in reply.keys():
51
+ print("%s: %s" % (i, reply[i]))
52
+
53
+
54
+
55
+ Requirements & Installation
56
+ ===========================
57
+
58
+ pyrad requires Python 3.8 or later
59
+
60
+ Installing is simple; pyrad uses the standard distutils system for installing
61
+ Python modules::
62
+
63
+ python setup.py install
64
+
65
+
66
+ Author, Copyright, Availability
67
+ ===============================
68
+
69
+ pyrad was written by Wichert Akkerman <wichert@wiggy.net> and is maintained by
70
+ Christian Giese (GIC-de), Istvan Ruzman (Istvan91) and Stefan Lieberth (slieberth).
71
+
72
+ We’re looking for contributors to support the pyrad team! If you’re interested in
73
+ helping with development, testing, documentation, or other areas, please contact
74
+ us directly.
75
+
76
+ This project is licensed under a BSD license.
77
+
78
+ Copyright and license information can be found in the LICENSE.txt file.
79
+
80
+ The current version and documentation can be found on pypi:
81
+ https://pypi.org/project/pyrad/
82
+
83
+ Bugs and wishes can be submitted in the pyrad issue tracker on github:
84
+ https://github.com/pyradius/pyrad/issues
85
+
86
+ Related Projects & Forks
87
+ ========================
88
+
89
+ **pyrad2:** Noteworthy fork with experimental RadSec (RFC 6614) support. Targets Python 3.12+,
90
+ adds extensive type hints, boosts test coverage, and includes fresh bug fixes.
91
+ https://github.com/nicholasamorim/pyrad2
92
+
93
+ **pyrad-server:** Lab-grade RADIUS test server built on top of pyrad.
94
+ https://github.com/slieberth/pyrad-server
pyrad-2.5.2/TODO.rst ADDED
@@ -0,0 +1,2 @@
1
+ ToDo
2
+ ====
@@ -0,0 +1,20 @@
1
+ # Minimal makefile for Sphinx documentation
2
+ #
3
+
4
+ # You can set these variables from the command line.
5
+ SPHINXOPTS =
6
+ SPHINXBUILD = sphinx-build
7
+ SPHINXPROJ = pyrad
8
+ SOURCEDIR = source
9
+ BUILDDIR = build
10
+
11
+ # Put it first so that "make" without argument is like "make help".
12
+ help:
13
+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14
+
15
+ .PHONY: help Makefile
16
+
17
+ # Catch-all target: route all unknown targets to Sphinx using the new
18
+ # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19
+ %: Makefile
20
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@@ -0,0 +1,36 @@
1
+ @ECHO OFF
2
+
3
+ pushd %~dp0
4
+
5
+ REM Command file for Sphinx documentation
6
+
7
+ if "%SPHINXBUILD%" == "" (
8
+ set SPHINXBUILD=sphinx-build
9
+ )
10
+ set SOURCEDIR=source
11
+ set BUILDDIR=build
12
+ set SPHINXPROJ=pyrad
13
+
14
+ if "%1" == "" goto help
15
+
16
+ %SPHINXBUILD% >NUL 2>NUL
17
+ if errorlevel 9009 (
18
+ echo.
19
+ echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
20
+ echo.installed, then set the SPHINXBUILD environment variable to point
21
+ echo.to the full path of the 'sphinx-build' executable. Alternatively you
22
+ echo.may add the Sphinx directory to PATH.
23
+ echo.
24
+ echo.If you don't have Sphinx installed, grab it from
25
+ echo.http://sphinx-doc.org/
26
+ exit /b 1
27
+ )
28
+
29
+ %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
30
+ goto end
31
+
32
+ :help
33
+ %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
34
+
35
+ :end
36
+ popd
Binary file
@@ -0,0 +1,10 @@
1
+ :mod:`pyrad.client` -- basic client
2
+ ===================================
3
+
4
+ .. automodule:: pyrad.client
5
+
6
+ .. autoclass:: Timeout
7
+ :members:
8
+
9
+ .. autoclass:: Client
10
+ :members:
@@ -0,0 +1,10 @@
1
+ :mod:`pyrad.dictionary` -- RADIUS dictionary
2
+ ============================================
3
+
4
+ .. automodule:: pyrad.dictionary
5
+
6
+ .. autoclass:: ParseError
7
+ :members:
8
+
9
+ .. autoclass:: Dictionary
10
+ :members:
@@ -0,0 +1,7 @@
1
+ :mod:`pyrad.host` -- RADIUS host definition
2
+ ===========================================
3
+
4
+ .. automodule:: pyrad.host
5
+
6
+ .. autoclass:: Host
7
+ :members: