import requests


def _get_repo_list(token: str) -> list:
    """
    Retrieves the list of repositories for the given username.

    :param token:
        The GitLab access token
    :return:
        A JSON object with the list of repositories
    """
    url = 'https://gitlab.com/api/v4/projects'

    headers = {
        'Private-Token': token
    }

    params = {
        'simple': True,
        'owned': True
    }

    response = requests.get(url, params=params, headers=headers)

    if response.status_code != requests.codes.get('ok'):
        response.raise_for_status()

    return response.json()