Skip to content

Commit

Permalink
feat: Revised API, No dependencies, Browser Support, Promises
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Revised, Promise-based API
BREAKING CHANGE: No dependencies
BREAKING CHANGE: Browser support (using [Web Cryptography API](https://www.w3.org/TR/WebCryptoAPI/))
BREAKING CHANGE: Support for verification using a remote JWKS endpoint
BREAKING CHANGE: Experimental Node.js libuv thread pool based runtime (non-blocking 🎉)
  • Loading branch information
panva committed Nov 14, 2020
1 parent c803d1b commit 357fe0b
Show file tree
Hide file tree
Showing 458 changed files with 18,104 additions and 18,848 deletions.
3 changes: 0 additions & 3 deletions .c8rc.json

This file was deleted.

14 changes: 0 additions & 14 deletions .codecov.yml

This file was deleted.

25 changes: 16 additions & 9 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,33 @@ labels: triage
---

**Describe the bug**
<!-- A clear and concise description of what the bug is. -->

<!-- A clear and concise description of what the bug is. -->

**To Reproduce**

Steps to reproduce the behaviour:
<!--
⚠️ issues without reproduction steps are incomplete and will
most likely be ignored, closed, or deleted without further
inspection.
-->

1.
2.
3.
Code to reproduce the behaviour:

```js
// formatted code snippet that reproduces the behaviour
```

**Expected behaviour**
A clear and concise description of what you expected to happen.

**Environment:**
- `jose` version: [e.g. v1.0.0]
- node version: [e.g. v12.0.0]

- `jose` version: [e.g. v3.0.0]
- affected runtime is: [e.g. Node.js 14.15.0, Chrome 86, or iOS 14 Safari]

**Additional context**
Add any other context about the problem here.

- [ ] the bug is happening on latest `jose` too.
- [ ] i have searched the issues tracker on github for similar issues and couldn't find anything related.
- [ ] the bug is happening on latest `jose` too.
- [ ] i have searched the issues tracker on github for similar issues and couldn't find anything related.
3 changes: 2 additions & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ contact_links:
about: Are you asking your nth question? Consider supporting the project before opening another.
- name: Report a security vulnerability
url: https://en.wikipedia.org/wiki/Responsible_disclosure
about: Do not disclose vulnerabilities via issues. Reach out to the project team via e.g. email,
about:
Do not disclose vulnerabilities via issues. Reach out to the project team via e.g. email,
we'll work together on patching the vulnerability and follow some form of Responsible
disclosure once fixed. Thank you.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ A clear and concise description of any alternative solutions or features you've
**Additional context**
Add any other context about the problem here.

- [ ] i have searched the configuration section for this feature and couldn't find it
- [ ] i have searched the issues tracker on github for similar requests and couldn't find anything related.
- [ ] i have searched the configuration section for this feature and couldn't find it
- [ ] i have searched the issues tracker on github for similar requests and couldn't find anything related.
83 changes: 38 additions & 45 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,55 +1,48 @@
name: "Code scanning - action"

on:
push:
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'
schedule:
- cron: '0 6 * * 0'
- cron: "0 6 * * 0"

jobs:
CodeQL-Build:

runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
# Override language selection by uncommenting this and choosing your languages
# with:
# languages: go, javascript, csharp, python, cpp, java

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
# Override language selection by uncommenting this and choosing your languages
# with:
# languages: go, javascript, csharp, python, cpp, java

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
12 changes: 6 additions & 6 deletions .github/workflows/lock.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: 'Lock threads'
name: "Lock threads"

on:
schedule:
- cron: '0 9 * * *'
- cron: "0 9 * * *"

jobs:
lock:
Expand All @@ -11,7 +11,7 @@ jobs:
- uses: dessant/lock-threads@v2
with:
github-token: ${{ github.token }}
issue-lock-inactive-days: '90'
issue-lock-reason: ''
pr-lock-inactive-days: '90'
pr-lock-reason: ''
issue-lock-inactive-days: "90"
issue-lock-reason: ""
pr-lock-inactive-days: "90"
pr-lock-reason: ""
105 changes: 55 additions & 50 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,23 @@ name: Continuous Integration
on:
push:
paths-ignore:
- '**.md'
- "**.md"
pull_request:
paths-ignore:
- '**.md'
- "**.md"
schedule:
- cron: 0 11 * * 1-5
- cron: 0 11 * * 1-5

jobs:
lint:
name: Lint
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Setup node
uses: actions/setup-node@v2-beta
with:
node-version: 12
node-version: 14
- name: Store node version variable
id: node
run: |
Expand All @@ -30,35 +29,37 @@ jobs:
id: node_modules
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package.json') }}-${{ steps.node.outputs.version }}
key: ${{ runner.os }}-node_modules-${{ hashFiles('package.json') }}-${{ steps.node.outputs.version }}
- name: Install dependencies
run: npx panva/npm-install-retry
if: ${{ steps.node_modules.outputs.cache-hit != 'true' }}
- run: npm run lint
- run: npm run lint-ts
- name: Cache dist
uses: actions/cache@v2
id: dist
with:
path: dist
key: dist-${{ hashFiles('src/**/*.ts') }}-${{ hashFiles('tsconfig/*.json') }}
- run: sed -i -e "s/-i ''/-i/g" package.json
- name: Build
run: npm run build-all
if: ${{ steps.dist.outputs.cache-hit != 'true' }}
- run: git reset HEAD --hard

test:
env:
NODE_NO_WARNINGS: 1
runs-on: ${{ matrix.os }}
NODE_OPTIONS: --enable-source-maps
needs:
- build
strategy:
matrix:
node-version:
- 10.13.0
- 10
- 11.0.0
- 11
- 12.0.0
- 12.19.0
- 12
- 13.7.0
- 13
- 14.0.0
- 14.15.0
- 14
- 15.0.1
- 15
os:
- ubuntu-latest
- windows-latest
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
Expand All @@ -75,42 +76,40 @@ jobs:
id: node_modules
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package.json') }}-${{ steps.node.outputs.version }}
key: ${{ runner.os }}-node_modules-${{ hashFiles('package.json') }}-${{ steps.node.outputs.version }}
- name: Install dependencies
run: npx panva/npm-install-retry
if: ${{ steps.node_modules.outputs.cache-hit != 'true' }}
- run: npm run coverage
- env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: npx codecov
- name: Load cached dist
uses: actions/cache@v2
id: dist
with:
path: dist
key: dist-${{ hashFiles('src/**/*.ts') }}-${{ hashFiles('tsconfig/*.json') }}
- run: npm install
working-directory: ./test
- name: Test Node.js crypto
run: npm run test
- name: Test Web Cryptography API
run: npm run test-webcrypto
if: ${{ !startsWith(matrix.node-version, '14') && !startsWith(matrix.node-version, '12') }}
- run: git reset HEAD --hard

test-electron:
browserstack:
env:
NODE_NO_WARNINGS: 1
runs-on: ${{ matrix.os }}
strategy:
matrix:
electron-version:
- 6.0.0
- 6
- 7.0.0
- 7
- 8.0.0
- 8
- 9.0.0
- 9
- 10.0.0
- 10
os:
- ubuntu-latest
- windows-latest
NODE_OPTIONS: --enable-source-maps
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
needs:
- build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Setup node
uses: actions/setup-node@v2-beta
with:
node-version: 12
node-version: 14
- name: Store node version variable
id: node
run: |
Expand All @@ -120,9 +119,15 @@ jobs:
id: node_modules
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package.json') }}-${{ steps.node.outputs.version }}
key: ${{ runner.os }}-node_modules-${{ hashFiles('package.json') }}-${{ steps.node.outputs.version }}
- name: Install dependencies
run: npx panva/npm-install-retry
if: ${{ steps.node_modules.outputs.cache-hit != 'true' }}
- run: npm install --global xvfb-maybe electron@${{ matrix.electron-version }}
- run: xvfb-maybe electron ./test/electron
- name: Load cached dist
uses: actions/cache@v2
id: dist
with:
path: dist
key: dist-${{ hashFiles('src/**/*.ts') }}-${{ hashFiles('tsconfig/*.json') }}
- run: npm run test-browser
- run: git reset HEAD --hard
Loading

0 comments on commit 357fe0b

Please sign in to comment.