Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docstring for Profile Keygen Util #39

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions pritunl_api/utils/keygen.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
from urllib.parse import urlparse

def profile_key(pritunl, org_id, usr_id):
"""
Generate URLs for a profile key in Pritunl.

Args:
pritunl (object): Pritunl API client
org_id (str): Organization ID
usr_id (str): User ID

Returns:
tuple: (key_uri_url, key_view_url) or (None, None) if no key is found
"""
key = pritunl.key.get(org_id=org_id, usr_id=usr_id)
if key:
key_uri_url = urlparse(pritunl.BASE_URL)._replace(scheme='pritunl').geturl() + key['uri_url']
Expand Down