Skip to content

Commit

Permalink
feat: generate tokens backed by GitHub releases as 2FA (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoe committed Dec 20, 2019
1 parent bf7d837 commit fee686f
Show file tree
Hide file tree
Showing 12 changed files with 866 additions and 21 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ code-workspace
html/documentation.html
.vscode
config
.coverage

6 changes: 4 additions & 2 deletions html/manage-tokens.html
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,8 @@ <h4>created tokens:</h4>
return;
}

let table = tableize(state.tokens,['prefix','package','created','expires','actions'],(row,k,td)=>{
let table = tableize(state.tokens,['prefix','package','created','expires', 'releaseAs2FA', 'actions'],(row,k,td)=>{
switch(k){

case "expires":
if(row.expiration){
td.innerText = new Date(row.expiration).toJSON();
Expand All @@ -194,6 +193,9 @@ <h4>created tokens:</h4>
case "prefix":
td.innerText = ""+row[k]+'...'
break;
case "releaseAs2FA":
td.innerText = row[k] ? 'true' : 'false'
break;
case "actions":
let link = document.createElement('a')
link.setAttribute('class','token-delete')
Expand Down
9 changes: 9 additions & 0 deletions html/token-settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ <h3> 24 hour publish token </h3>
<button>Create 24 hour token</button>
</form>
</div>
<div>
<h3>GitHub release backed token</h3>
<div>a publication will only be permitted if a corresponding release is found on GitHub.</div>
<form id="release-token" action="/_/token">
<input type="hidden" value="release" name="type"/>
<input class="ott" type="hidden" name="ott" value=""/>
<button>Create release-backed publication token</button>
</form>
</div>
<div>
<h3>Package specific publish token.</h3>
<div>package tokens do not timeout, but can only publish a single package. Use these for build automation etc.</div>
Expand Down
Loading

0 comments on commit fee686f

Please sign in to comment.