Skip to content

Commit c7858e1

Browse files
authored
Merge pull request #303 from jsonwebtoken/stage-6
New features: - Minimum length notice for HMAC algorithms, including tooltip. - Share button - Easy library edition: libraries are now loaded from JSON files, no HTML or code needs to be edited - Library tests - Accept more tokens as URL params (PR) - Claim info tooltips - Plain RSA keys (no X509 header) are now supported Bug fixes: - Correct font - Minor positioning fixes - Added missing star counts Libraries: - More libraries - Updated libraries
2 parents d9726c2 + 9f1ce9d commit c7858e1

File tree

135 files changed

+3598
-5984
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+3598
-5984
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ dist
33
.tmp
44
.DS_Store
55
npm-debug.log
6+

Gruntfile.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
const extensionManifest = require('./manifest.json');
2+
const getLanguages =
3+
require('./views/website/libraries/support/get-languages.js');
24

35
module.exports = grunt => {
46
grunt.loadNpmTasks('grunt-contrib-copy');
@@ -108,6 +110,12 @@ module.exports = grunt => {
108110

109111
pug: {
110112
website: {
113+
options: {
114+
//pretty: true,
115+
data: {
116+
languages: getLanguages()
117+
}
118+
},
111119
files: {
112120
'dist/website/index.html': 'views/website/index.pug',
113121
'dist/website/introduction/index.html':
@@ -173,6 +181,9 @@ module.exports = grunt => {
173181
files: [
174182
'stylus/*.styl',
175183
'stylus/extension/**',
184+
// Yes, we still share styles with the website, it's really hard
185+
// to refactor them out without breaking stuff
186+
'stylus/website/**',
176187
'views/*.pug',
177188
'views/extension/**'
178189
],

README.md

Lines changed: 88 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,85 @@
1-
##JWT.io
1+
## JWT.io
22

33
<img src="https://cdn.auth0.com/blog/jwtio/jwtio.png"/>
44

55
[![Build Status](https://travis-ci.org/jsonwebtoken/jsonwebtoken.github.io.png?branch=master)](https://travis-ci.org/jsonwebtoken/jsonwebtoken.github.io)
66

7+
### How to add a library
8+
To add a library, simply edit the right JSON file located at `views/website/libraries`. Each language gets its own file. Multiple libraries share the same language file.
9+
10+
To add a new language, simply add a JSON file in the same folder as the others. It will get automatically recognized. If you add a new language, you will need to provide a proper icon for it and place it in the `img` folder.
11+
12+
Here's a commented example of the .NET language file (`0-.NET.json`). All fields must have valid values unless noted:
13+
14+
```javascript
15+
{
16+
// Language name (unique)
17+
"name": ".NET",
18+
19+
// Unique identifier that will be used as a CSS class
20+
// for this language (only valid CSS class names).
21+
"uniqueClass": "net",
22+
23+
// The language icon, SVG format preferred, should be placed
24+
// in /img directory.
25+
"image": "/img/1.svg",
26+
27+
// The color of header that displays the name of the language
28+
// and the icon. This is a valid CSS color definition.
29+
"bgColor": "rgb(42, 168, 229)",
30+
31+
// An array of libraries for this language.
32+
"libs": [
33+
{
34+
// In case the library suffered from a vulnerability, the
35+
// minimum version in which the vuln was fixed must be
36+
// listed here. Optional (can be null).
37+
"minimumVersion": "1.0.1", // or null
38+
39+
// Supported features, true for supported,
40+
// false for not supported.
41+
"support": {
42+
"sign": true,
43+
"verify": true,
44+
"iss": true,
45+
"sub": true,
46+
"aud": true,
47+
"exp": true,
48+
"nbf": true,
49+
"iat": true,
50+
"jti": true,
51+
"hs256": true,
52+
"hs384": true,
53+
"hs512": true,
54+
"rs256": true,
55+
"rs384": true,
56+
"rs512": true,
57+
"es256": true,
58+
"es384": true,
59+
"es512": true
60+
},
61+
62+
// Author URL, can be GitHub profile, personal page
63+
// company page, etc. Can be null.
64+
"authorUrl": "https://www.microsoft.com", // or null
65+
66+
// Author name.
67+
"authorName": "Microsoft",
68+
69+
// For the star count, this is the GitHub repository path,
70+
// (usually user/repo). Can be null (no star count shown).
71+
"gitHubRepoPath": "AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet", // or null
72+
73+
// URL for source code.
74+
"repoUrl": "https://github.com/MSOpenTech/azure-activedirectory-identitymodel-extensions-for-dotnet",
75+
76+
// Install command, can be HTML or plain text.
77+
"installCommandHtml": "Install-Package<br><a href=\"https://www.nuget.org/packages/System.IdentityModel.Tokens.Jwt/\">System.IdentityModel.Tokens.Jwt</a>"
78+
}
79+
]
80+
}
81+
```
82+
783
### How to build
884

985
First, install the required dependencies:
@@ -15,11 +91,19 @@ npm install
1591
In order to build (and run) the project execute:
1692

1793
```sh
18-
grunt
94+
./node_modules/.bin/grunt
1995
```
2096

21-
You will find the generated files in the `dist` directory. For the website, you can run a server at its root. For example: `http-server dist/website`.
97+
You will find the generated files in the `dist` directory. For the website, you can run a server at its root. For example: `http-server dist/website`. The default `grunt` task runs a server
98+
at [https://127.0.0.1:8000](https://127.0.0.1:8000) and watches
99+
for changes.
22100

23-
### Happy hacking!
101+
To run tests, execute:
24102

103+
```
104+
./node_modules/.bin/grunt test
105+
```
25106

107+
Look at the end of the `Gruntfile` for other common tasks.
108+
109+
### Happy hacking!

img/website/27.svg

Lines changed: 38 additions & 0 deletions
Loading

package-lock.json

Lines changed: 77 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
{
22
"name": "jwt.io",
3-
"version": "2.0.0",
3+
"version": "2.1.0",
44
"repository": {
55
"type": "git",
66
"url": "https://github.com/jsonwebtoken/jsonwebtoken.github.io"
77
},
88
"dependencies": {
99
"express": "^4.16.2",
10-
"express-sslify": "^1.2.0"
10+
"express-sslify": "^1.2.0",
11+
"querystring": "^0.2.0"
1112
},
1213
"devDependencies": {
1314
"@babel/core": "^7.0.0-beta.36",
@@ -18,7 +19,10 @@
1819
"chai": "^4.1.2",
1920
"chai-arrays": "^2.0.0",
2021
"chai-as-promised": "^7.1.1",
22+
"chai-json-schema": "^1.5.0",
23+
"clipboard-polyfill": "^2.4.6",
2124
"codemirror": "^5.33.0",
25+
"deep-freeze": "0.0.1",
2226
"flipclock": "^0.7.8",
2327
"grunt": "^1.0.1",
2428
"grunt-cli": "^1.2.0",
@@ -48,6 +52,8 @@
4852
"sinon-chai": "^2.14.0",
4953
"source-map-support": "^0.5.3",
5054
"stylus": "^0.54.5",
55+
"tippy.js": "^2.3.0",
56+
"tv4-formats": "^3.0.3",
5157
"uglifyjs-webpack-plugin": "^1.1.6",
5258
"web-ext": "^2.4.0",
5359
"webpack": "^4.1.0",

src/dom-elements.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ export const decodedTabLink =
44
document.querySelector('.tab-link a[href="#decoded-jwt"]');
55
export const encodedTabElement = document.getElementById('encoded-jwt');
66
export const decodedTabElement = document.getElementById('decoded-jwt');
7+
78
export const editorElement = document.querySelector('#encoded-jwt .input');
89
export const decodedElement = document.querySelector('#decoded-jwt .output');
10+
911
export const headerElement = document.querySelector('.js-header');
1012
export const payloadElement = document.querySelector('.js-payload');
11-
export const payloadTooltipElement =
12-
document.getElementById('js-payload-tooltip');
1313

1414
export const signatureStatusElement =
1515
document.querySelector('.validation-status.js-signature');

0 commit comments

Comments
 (0)