update readme
This commit is contained in:
45
README.md
45
README.md
@@ -4,51 +4,30 @@ pyrad3 is an implementation of a RADIUS client/server as described in RFC2865.
|
||||
It takes care of all the details like building RADIUS packets, sending them and
|
||||
decoding responses.
|
||||
|
||||
This is the successor of pyrad. It is written in python3 only (python3.6+) and
|
||||
This is the successor of pyrad. It is written in python3 only (python3.7+) and
|
||||
has an improved API.
|
||||
|
||||
Here is an example of doing a authentication request:
|
||||
|
||||
```python3
|
||||
from pyrad.client import Client
|
||||
from pyrad.dictionary import Dictionary
|
||||
import pyrad.packet
|
||||
|
||||
srv = Client(server="localhost", secret=b"Kah3choteereethiejeimaeziecumi",
|
||||
dict=Dictionary("dictionary"))
|
||||
|
||||
# create request
|
||||
req = srv.CreateAuthPacket(code=pyrad.packet.AccessRequest,
|
||||
User_Name="wichert", NAS_Identifier="localhost")
|
||||
req["User-Password"] = req.PwCrypt("password")
|
||||
|
||||
# send request
|
||||
reply = srv.SendPacket(req)
|
||||
|
||||
if reply.code == pyrad.packet.AccessAccept:
|
||||
print("access accepted")
|
||||
else:
|
||||
print("access denied")
|
||||
|
||||
print("Attributes returned by server:")
|
||||
for key, values in reply.items():
|
||||
print("{key}: {value}")
|
||||
```
|
||||
|
||||
## Requirements & Installation
|
||||
|
||||
pyrad requires Python 3.6 or later.
|
||||
pyrad requires Python 3.7 or later.
|
||||
|
||||
```cli
|
||||
# Install from the repository
|
||||
pip install .
|
||||
# Install from pypi
|
||||
pip install pyrad3
|
||||
|
||||
# Install from the repository
|
||||
git clone https://github.com/pyradius/pyrad3
|
||||
pip install .
|
||||
|
||||
# Installing with poetry
|
||||
git clone https://github.com/pyradius/pyrad3
|
||||
poetry install --no-dev # for usage; without optional dev dependencies
|
||||
poetry install # for development
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
pyrad3 is distributed under the terms of both the MIT license and the Apache
|
||||
pyrad3 is distributed under the terms of both the MIT License and the Apache
|
||||
License (Version 2.0).
|
||||
|
||||
See [LICENSE-APACHE](LICENSE-APACHE) and [LICENSE-MIT](LICENSE-MIT) for
|
||||
|
||||
Reference in New Issue
Block a user