Skip to content

Commit

Permalink
Authenticate with app key instead of PAT
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Aug 29, 2023
1 parent eecf65e commit 5f436f7
Showing 1 changed file with 25 additions and 6 deletions.
31 changes: 25 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,39 @@
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.20/css/jquery.dataTables.css">
-->


<script type="module">
import { Octokit } from "https://cdn.skypack.dev/@octokit/rest@18.5.6";
import { Octokit } from "https://esm.sh/@octokit/rest@18.5.6";
import { createAppAuth } from 'https://esm.sh/@octokit/auth-app@6.0.0';

/*
var t = $('table').DataTable({
paging: false,
searching: false
});
*/

const octokit = new Octokit({
auth: atob("Z2l0aHViX3BhdF8xMUFMNkNLSEkwRldQMmIzTFhabWNoX0V1T2NaMFY0ek80dlMwVXFvOHhiQUEzOTVka3IzeFE4eEEyY2dsNE1JblRUTDVOTURNSXZVUHR0aUNZ")

// GitHub App key: https://github.com/organizations/r-devel/settings/apps/svn-dashboard-front-end-auth
var appkey = "LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCk1JSUV2UUlCQURBTkJna3Foa2lHOXcwQkFRRUZBQVNDQktjd2dnU2pBZ0VBQW9JQkFRRFh1RnBlOTFoQlFocGoKZTFUYloweHlMNHh2cWl4Q0lRaXZsaXJ1YjRqSFZkdHNhTnVsYThWL0ZCRzM5dHpCeUhtemUwNWN6Qmdpakl3RAoxZG85UjVnL1lqS0R6OENtT2xSNTMrdGNiWXVLWlY4Q3Vub2JBMTdLNUo0QkdLUyswcExwRUJ4M2tyWER4RUtKCnBDKzgrTU5ZWkFaV0dlaHl1emtXQllkQlhRR09OM0x5MVZFaUk1S3hLa29raUwvRkxrTTJrOHg2WlVrWVRRUXUKeDkrcHcxdTJmRFZtV3g3YmxqaFNuSDRRYUR2Zk8xcjMxcytZckhtd3lqL2ZxS0REc0FuZHZTQVhBQlNHd0k1Uwo0QV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SUxiQzVjSzQ0Wm9NZjFoNWRyM3lVZEdmZ29xWHRCNGJxQkI4NWQ5MnZyQmpoCnhhamh0VlJ4YzFBWm5ZaUFWcmFzYWJlYngwV0UzcTZFZ0QxUzRNVW1EZVYrSHp4QVhuODFEM2lmNnpFdVh2K0kKQ2tvYmM0NDFybzVXZitKTDVXSlNBYk4xbHhUUXpFc1hBdUpDV0xseG96ZUt2bDIxcmlkR0VLNDVBb0dBTkh6MQpWRDJxTzFETEthTXV2eXJ2Rk5jNDRiWi9iTHFWSGVMYVBLblVzbkNONnpIcHl4YkVKSFpFVC9PL2pOMVRhenZlCkZyaEREMnl5aUhhQlMxSDh3T3pNQXNIRzFFUzN4clo0VTNSeXQ2dElrNmNmY2pyc3QwcHZkQi9oRzBJUnlsc3kKV1k4Ny85cDFGelVrK3YvVzdwdVgvVC8zMWpnNmJhSXA2djVPaklrQ2dZRUFoa042R2k3Q3pvTGM5dWxSUjZkcQpJbUZxQ0M5aHl6TU1JaHZwbWRtRVZwSlJkMDVhYTljZnFnRldFaU1rZkFXdEt3SFNIaWMyUXFCbUdQbzBtbWhOCjlzeDNmVjlKbG54c3hOcHNjR2syeityRkU1dDV5VVlhOW5BN1F5QXIwQVl4YStSalNCdCtYaEwvdWxSNDYzQm4KekovOGQ0dktyTjVVRmNJL3Jta0lzakU9Ci0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0K";

const appOctokit = new Octokit({
authStrategy: createAppAuth,
auth: {
appId: 382614,
privateKey: atob(appkey),
installationId: 41222863
}
});

appOctokit.auth({type: "installation"}).then(function(x){
window.octokit = new Octokit({
auth: x.token
});
init_page();
}).catch(function(err){
console.log("Failed to authenticate with key: " + err);
})

function sort_jobs(jobs){
var out = {};
jobs.forEach(function(x){
Expand Down Expand Up @@ -218,7 +237,7 @@
});
}

$(function(){
function init_page(){
var pagenum = 0;
function load_one_page(){
load_more_results(++pagenum).then(function(){
Expand All @@ -231,7 +250,7 @@
load_one_page();
});
load_one_page();
});
};

</script>
</head>
Expand Down

0 comments on commit 5f436f7

Please sign in to comment.