Skip to main content

Python OpenVPN Access Server SDK

A Python library built on XML-RPC that demystifies remote interaction with OpenVPN Access Server

OpenVPN Access Server provides an XML-RPC API that allows administrators to manage the server remotely and programatically. Unfortunately, OpenVPN explicitly provides this feature undocumented. This SDK provides a way to interact with this API, with helpful error messages, powerful functionality, and a clear explanation of what the hell you're looking at.

For support please email peritz@pardonmynoot.com. Code is at https://github.com/peritz/pyovpn-as

Getting Started

Getting started is simple. First you must enable the XML-RPC feature on your access server. This can be done either through the web interface by navigating to Configurations -> Client Settings -> Enable Complete API or by setting it via the command line ./sacli --key "xmlrpc.relay_level" --value 2 ConfigPut

Now we can start running commands:

>>> from pyovpn_as import client

>>> mgmt_client = client.from_args('https://ovpn.example.org/RPC2/', 'openvpn', 'P4ssw0rd!!!!')

>>> new_user = mgmt_client.users.create_new_user('newuser', 'P4ssw0rd123£', prop_superuser=True)

>>> new_user.type

"user_connect"

>>> new_user.is_admin

True

>>> mgmt_client.users.delete_user(as_client, '404')
Traceback (most recent call last):   
  File "<stdin>", line 1, in <module>
AccessServerProfileNotFoundError: User "404" does not exist

Installation

pip install pyovpn-as

How to Contribute

There are three main ways to contribute to this project:

  • Search for open issues or open your own issue for a bug or problem discovered in the codebase or the documentation
  • Submit a pull request to merge a feature or fix into the master branch (more information on how to do that and what maintainers expect from your code can be found in the full documentation)
  • Use this SDK to poke at OpenVPN Access Server to find additional functionality, or to clarify the functionality given here, then open an issue and tell us what you found and how we can improve

We don't accept monetary contributions, everything you see is free :)

License

GPL license, see the License

Metadata

Release files for pyovpn-as 0.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyovpn-as 0.0.8
File Size Uploaded Provenance
pyovpn-as-0.0.8.tar.gz 45.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pyovpn-as 0.0.8
File Interpreter ABI Platform
pyovpn_as-0.0.8-py3-none-any.whl Python 3 none any Details

Total release size: 93.2 kB

Release files / pyovpn-as-0.0.8.tar.gz

Download URL pyovpn-as-0.0.8.tar.gz
Size 45.7 kB
Tags Source
SHA-256 checksum
How to use checksums
e0bbd5bd20296375fd8ca34a62781a8a02714903f68c61131bdec5bafc30bab4
BLAKE2b-256 checksum
How to use checksums
4f4d39b5684b527700f4500bffc9efd8b485c8c634d1652e93ffb72b1c461b4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.6

Release files / pyovpn_as-0.0.8-py3-none-any.whl

Download URL pyovpn_as-0.0.8-py3-none-any.whl
Size 47.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1b9367edcb503dc61e6b6c23764064cece0719910cee5cc45cb94a1b7f9cf139
BLAKE2b-256 checksum
How to use checksums
e40a72c3b8de2a512c263f44bb4661cd11e64296b5d6505b764547097652a7a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.6

Security for pyovpn-as 0.0.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.0.8 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page