Skip to content

Commit bbe1eb5

Browse files
committed
More views modularization for website/extension merge.
1 parent ea71027 commit bbe1eb5

File tree

6 files changed

+75
-68
lines changed

6 files changed

+75
-68
lines changed

views/extension/index.pug

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
extends layout
2+
3+
include ../token-editor.pug

views/token-editor-algorithms.pug

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
select#algorithm-select
2+
option(name='algorithm',value='HS256', selected='') HS256
3+
option(name='algorithm',value='HS384') HS384
4+
option(name='algorithm',value='HS512') HS512
5+
option(name='algorithm',value='RS256') RS256
6+
option(name='algorithm',value='RS384') RS384
7+
option(name='algorithm',value='RS512') RS512
8+
option(name='algorithm',value='ES256') ES256
9+
option(name='algorithm',value='ES384') ES384
10+
//- Unsupported by jsrsasign
11+
option(name='algorithm',value='ES512') ES512
12+
option(name='algorithm',value='PS256') PS256
13+
option(name='algorithm',value='PS384') PS384
14+
option(name='algorithm',value='PS512') PS512
15+
16+

views/token-editor-common.pug

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
.algorithm-code
2+
.tab-nav
3+
.tab-link.current
4+
a(href='#encoded-jwt') Encoded
5+
small paste a token here
6+
.tab-link
7+
a(href='#decoded-jwt') Decoded
8+
small edit the payload and secret
9+
10+
.tab-content
11+
#encoded-jwt.box-content.current
12+
.input.js-input
13+
#decoded-jwt.box-content
14+
.output
15+
.jwt-explained.jwt-header
16+
p.text-line HEADER:
17+
span ALGORITHM & TOKEN TYPE
18+
.js-header
19+
20+
.jwt-explained.jwt-payload
21+
p.text-line PAYLOAD:
22+
span DATA
23+
.js-payload
24+
#js-payload-tooltip placeholder
25+
26+
.jwt-explained.jwt-signature
27+
p.text-line VERIFY SIGNATURE
28+
pre.pre-encode.HS256.
29+
<span id="hmacsha-text">HMACSHA256</span>(
30+
base64UrlEncode(header) + "." +
31+
base64UrlEncode(payload),
32+
<input type="text" name="secret" value="secret">
33+
)<span class="is-base64-encoded-label"> <input id="is-base64-encoded" type="checkbox" name="is-base64-encoded"><label for="is-base64-encoded">secret base64 encoded</label></span>
34+
pre.pre-encode.RS256.
35+
<span id="rsasha-text">RSASHA256</span>(
36+
base64UrlEncode(header) + "." +
37+
base64UrlEncode(payload),
38+
<textarea rows="4" name="public-key" placeholder="Public Key or Certificate. Enter it in plain text only if you want to verify a token"></textarea>,
39+
<textarea rows="5" name="private-key" placeholder="Private Key. Enter the it in plain text only if you want to generate a new token. The key never leaves your browser."></textarea>
40+
)
41+
42+
.validation-status.js-signature

views/token-editor.pug

Lines changed: 0 additions & 67 deletions
This file was deleted.

views/website/index.pug

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ block content
4444

4545
include ebook.pug
4646

47-
include ../token-editor.pug
47+
include token-editor.pug
4848

4949
include libraries.pug
5050

views/website/token-editor.pug

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
section#debugger-io.debugger-jwt
2+
.container
3+
//- a(name='debugger')
4+
h1 Debugger
5+
6+
.jwt-playground
7+
.selections
8+
.algorithm
9+
span Algorithm
10+
.jwt-select
11+
include ../token-editor-algorithms.pug
12+
13+
include ../token-editor-common.pug

0 commit comments

Comments
 (0)