Skip to content

Commit

Permalink
Merge pull request #39 from nathanielvarona/improvement/docstring-for…
Browse files Browse the repository at this point in the history
…-profile-keygen-util

Docstring for Profile Keygen Util
  • Loading branch information
nathanielvarona committed May 4, 2024
2 parents 9df6cf7 + 873387b commit 772b074
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 772b074

Please sign in to comment.