diff --git a/pritunl_api/utils/keygen.py b/pritunl_api/utils/keygen.py index 5015679..a2aff0d 100644 --- a/pritunl_api/utils/keygen.py +++ b/pritunl_api/utils/keygen.py @@ -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']