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

Migrate deprecating GitHub API authentication through query parameters #591

Open
peaceiris opened this issue Aug 14, 2021 · 0 comments
Open

Comments

@peaceiris
Copy link
Contributor

peaceiris commented Aug 14, 2021

Maybe, we need to migrate the API authentication in the following lines.

let query = '';
const headers= (() => {
if (this.githubCredential === undefined) {
return {};
} else {
const {githubClientId, githubClientSecret} = this.githubCredential;
const h: {[key: string]: string} = {
// Basic Auth
"Authorization": `Basic: ${Buffer.from(`${githubClientId}:${githubClientSecret}`).toString("base64")}`,
};
query = `?client_id=${githubClientId}&client_secret=${githubClientSecret}`;
return h;
}
})();
const githubRes = await fetch(`https://api.github.com/repos/${repoName}${query}`, {
headers,
});

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