Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add authentication #74

Open
fadden opened this issue Sep 23, 2024 · 0 comments
Open

Add authentication #74

fadden opened this issue Sep 23, 2024 · 0 comments

Comments

@fadden
Copy link

fadden commented Sep 23, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant