From 873387bf6ab99a485402bf3b93767ce295dc2a93 Mon Sep 17 00:00:00 2001 From: Nathaniel Varona <194283+nathanielvarona@users.noreply.github.com> Date: Sun, 5 May 2024 00:32:03 +0800 Subject: [PATCH] Docstring for Profile Keygen Util --- pritunl_api/utils/keygen.py | 11 +++++++++++ 1 file changed, 11 insertions(+) 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']