Skip to content

Commit

Permalink
Docstring for Profile Keygen Util
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanielvarona committed May 4, 2024
1 parent 9df6cf7 commit 873387b
Showing 1 changed file with 11 additions and 0 deletions.
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

0 comments on commit 873387b

Please sign in to comment.