INNER CODE UNIT · Python

get_gitlab_credentials

phasehq/console · backend/api/utils/syncing/gitlab/main.py:66

def get_gitlab_credentials(credential_id):

    credentials = get_credentials(credential_id)

    host = credentials["gitlab_host"]
    token = credentials["gitlab_token"]

    if settings.APP_HOST == "cloud":
        validate_url_is_safe(host)

    return host, token


def validate_auth(credential_id):
    """
    Check if the GitLab token is valid and operational.
    This function makes a request to the GitLab API to fetch the user's details.
    A successful request (status code 200) indicates a valid token.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…