
Security News
Open Source Maintainers Demand Ability to Block Copilot-Generated Issues and PRs
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
outline-vpn-api-client
Advanced tools
This library provides a convenient interface for managing an Outline VPN server in Python using the official Outline Management API. It simplifies server interaction by enabling you to:
The library is suitable for both individual users and administrators of corporate VPN solutions, helping to streamline server management, save time, and improve operational efficiency.
It is designed with simplicity in mind and features cleanly implemented, well-documented methods.
pip install outline-vpn-api-client
poetry add outline-vpn-api-client
To get started with the library, you need to obtain the management_url
for your Outline VPN server. Once you have the management_url
, you can create an instance of the OutlineClient
class to interact with the server.
from outline_vpn_api_client import OutlineClient
# Replace 'your.management.url' with your actual management URL
management_url = "your.management.url"
# Create an OutlineClient instance
client = OutlineClient(management_url=management_url)
import json
# Fetch server information and pretty-print it
print(json.dumps(client.get_information(), ensure_ascii=False, indent=4))
# Replace 'name' with a meaningful identifier for the key
client.access_keys.create(name="Example Key")
# Replace 'name' with a meaningful identifier for the key
# Replace 'limit' with the desired bandwidth limit in bytes
client.access_keys.create(name="Example Key with Limit", limit=10**9) # Example: 1 GB limit
The library uses a custom exception, ResponseNotOkException, to handle server-side errors. This exception is raised whenever the API returns an unexpected response.
from outline_vpn_api_client import ResponseNotOkException
try:
# Attempting to fetch server information
info = client.get_information()
print(info)
except ResponseNotOkException as e:
print(e)
The error message provides details about the HTTP status code and the error message returned by the API. It follows this format:
def _get_error_message(status_code: int, error: str) -> str:
return f"An error occurred: {status_code} - {error}"
For example, if the API returns a 404 error with the message "Not Found", the exception will produce the message:
outline_vpn_api_client.client.ResponseNotOkException: An error occured: 404 - {'code': 'NotFound', 'message': 'Access key "100" not found'}
For use async client install async version of package:
pip install outline-vpn-api-client[async]
Then import async client and create instance of this
from outline_vpn_api_client.async_client import AsyncOutlineClient
# Replace 'your.management.url' with your actual management URL
management_url = "your.management.url"
# Create an AsyncOutlineClient instance
client = AsyncOutlineClient(management_url=management_url)
The library also includes a command-line interface (CLI) for quick access. You can use the following command to interact with the server:
python3 -m outline_vpn_api_client management_url get_info
Created by zeph1rr
Email: grianton535@gmail.com
FAQs
Unknown package
We found that outline-vpn-api-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
Research
Security News
Malicious Koishi plugin silently exfiltrates messages with hex strings to a hardcoded QQ account, exposing secrets in chatbots across platforms.
Research
Security News
Malicious PyPI checkers validate stolen emails against TikTok and Instagram APIs, enabling targeted account attacks and dark web credential sales.