import requests


def github_issue_labels(issue, githubauth):
    """Get the labels attached to a GitHub ``issue``."""
    url = f"https://api.github.com/repos/zeff.ai/ZeffClient/issues/{issue}/labels"
    authn = githubauth.authn
    headers = githubauth.headers
    resp = requests.get(url, auth=authn, headers=headers)
    if resp.status_code == 401:
        githubauth.refresh()
        authn = githubauth.authn
        headers = githubauth.headers
        resp = requests.get(url, auth=authn, headers=headers)
    json = resp.json()
    ret = [label["name"] for label in json]
    return ret