Skip to content

Add authentication #74

@fadden

Description

@fadden

The current github REST API has a limit of 60 requests per hour. This isn't a lot if you're iterating on development of a batch documentation converter. Authentication raises the limit to 5000/hour.

The core of the required change is to add two items to the headers dictionary in the markdown_to_html_via_github_api function:

    headers = {"Content-Type": "text/plain", "charset": "utf-8",
            "Authorization": "Bearer github_pat_####",
            "X-GitHub-Api-Version": "2022-11-28"
            }

where "github_pat_####" is replaced by a generated personal access token, which would be provided on the command line.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions