rename functions for clarity

This commit is contained in:
Ray Lyon
2023-08-07 20:56:38 +00:00
parent 2a2e07f18a
commit 7302a4a4a3

View File

@@ -42,7 +42,7 @@ from lxml import etree
from . import templates
def get_access_token(sf_url: str, company_id: str, client_id: str,
def request_token(sf_url: str, company_id: str, client_id: str,
assertion: str) -> str:
"""
Send POST request to SuccessFactors containing the generated
@@ -113,7 +113,7 @@ def sign_assertion(xml_string: str, private_key: str) -> str:
return etree.tostring(root)
def auth(sf_url: str, sf_company_id: str, sf_oauth_client_id: str,
def get_token(sf_url: str, sf_company_id: str, sf_oauth_client_id: str,
sf_admin_user: str, sf_saml_private_key: str) -> str:
"""
Request an API access token by generating a signed SAML assertion
@@ -135,7 +135,7 @@ def auth(sf_url: str, sf_company_id: str, sf_oauth_client_id: str,
signed_assertion_b64 = base64.b64encode(signed_assertion).replace(b'\n', b'')
# Request the API token from SuccessFactors via a POST request
access_token = get_access_token(sf_url,
access_token = request_token(sf_url,
sf_company_id,
sf_oauth_client_id,
signed_assertion_b64)