Skip to content

Commit

Permalink
refactor!: openid-client@6
Browse files Browse the repository at this point in the history
BREAKING CHANGE: openid-client v6.x is a complete rewrite of the openid-client module, this is the first time since 0.1.0 (8 years ago) that the API has drastically changed. The new module structure and API focuses on three core principles:

- runtime compatibility (adding support for Deno, Cloudflare Workers, Bun, and other Web API interoperable runtimes)
- tree-shakeability (bundles should not contain features that don't end up being used)
- less options (removing support for processing deprecated response types, cutting down on the number of combinations that need to handled)

To that end openid-client@6 no longer supports the full cartesian matrix of response types and response modes, it no longer supports issuing encrypted assertions, decrypting assertions is limited to only a few algorithms, it no longer supports Dynamic Client Registration or Management, and Self-Issued OpenID Provider responses are also not supported.

The new API makes basic setups simple while allowing some degree of complexity where needed.

openid-client@6 is an ESM module using ES2022 syntax and it depends on WebCryptoAPI and Fetch API globals being available in the JS runtime.

openid-client@6 is written in TypeScript and its exported types come with comment annotations.

(Node.js) Versions 20.x and newer have all the necessary globals.

(Node.js) CJS style `let client = require('openid-client')` is possible in versions where `process.features.require_module` is `true`. This is a new Node.js feature slated to be released without a CLI flag in 23.x and 22.x
  • Loading branch information
panva committed Oct 15, 2024
1 parent d142984 commit 15890ff
Show file tree
Hide file tree
Showing 267 changed files with 20,471 additions and 15,027 deletions.
9 changes: 9 additions & 0 deletions .electron_flags.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
echo $(electron -i <<< 'process.exit(0)' 2> /dev/null | grep "Using" | awk '{$1=$1};1' | sed -r "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2};?)?)?[mGK]//g")

electron -i <<< 'process.exit(parseInt(process.versions.node, 10))' &> /dev/null
NODE_VERSION=$?
export NODE_OPTIONS='--import=tsx/esm --conditions=browser --no-warnings --tls-cipher-list="ECDHE-RSA-AES128-GCM-SHA256 ECDHE-RSA-AES256-GCM-SHA384 ECDHE-ECDSA-AES128-GCM-SHA256 ECDHE-ECDSA-AES256-GCM-SHA384"'

if [[ $NODE_VERSION -eq 18 ]]; then
export NODE_OPTIONS+=' --experimental-global-webcrypto'
fi
96 changes: 55 additions & 41 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,56 @@
---
name: 🐞Bug report
about: Something is not working as I think it should be
labels: triage

---

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


**To Reproduce**
Issuer and Client configuration: (inline or gist) - Don't forget to redact your secrets.
```js
// Issuer configuration (issuer.metadata) and how it is constructed (discovery or manual?)
{
// ...
}
// Client configuration (client.metadata) and how it is constructed (fromUri or manual?)
{
// ...
}
```

Steps to reproduce the behaviour:

1.
2.
3.

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

**Environment:**
- openid-client version: [e.g. v3.14.0]
- node version: [e.g. v8.9.0]

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

- [ ] the bug is happening on latest openid-client too.
- [ ] i have searched the issues tracker on github for similar issues and couldn't find anything related.
description: There's a bug I want to report
labels:
- triage
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report. Do not use this form to ask questions or make suggestions, use the [appropriate](https://github.com/panva/openid-client/issues/new/choose) Discussions Topic for those.
- type: textarea
attributes:
label: What happened?
description: A clear and concise description of what the bug is and what you expected to happen instead.
validations:
required: true
- type: input
attributes:
label: Version
description: What exact version of the library do you use?
placeholder: e.g. v6.0.0
validations:
required: true
- type: dropdown
attributes:
label: Runtime
description: What JavaScript runtime are you seeing the problem on?
options:
- Browser
- Cloudflare Workers
- Deno
- Electron
- Node.js
- Other (I will specify below)
validations:
required: true
- type: input
attributes:
label: Runtime Details
description: More information about the runtime (e.g. node version, browser vendor and version, electron version, operating system)
validations:
required: true
- type: textarea
attributes:
label: Code to reproduce
description: Please copy and paste code to reproduce the issue. This will be automatically formatted into JavaScript code, so no need for backticks.
render: js
validations:
required: true
- type: checkboxes
attributes:
label: Required
options:
- label: I have searched the issues tracker and discussions for similar topics and couldn't find anything related.
required: true
- label: I agree to follow this project's [Code of Conduct](https://github.com/panva/openid-client/blob/main/CODE_OF_CONDUCT.md)
required: true
10 changes: 4 additions & 6 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
blank_issues_enabled: false
contact_links:
- name: ❓ Question
url: https://github.com/panva/node-openid-client/discussions/new?category=q-a
about:
Have a question about using openid-client? Head over to the discussions "Q&A" Category
url: https://github.com/panva/openid-client/discussions/new?category=q-a
about: Have a question about using openid-client? Head over to the discussions "Q&A" Category
- name: 💡 Feature proposal
url: https://github.com/panva/node-openid-client/discussions/new?category=ideas
about:
Have a proposal for a new feature? Head over to the discussions "Ideas" Category
url: https://github.com/panva/openid-client/discussions/new?category=ideas
about: Have a proposal for a new feature? Head over to the discussions "Ideas" Category
- name: Support the project
url: https://github.com/sponsors/panva
about:
Expand Down
13 changes: 10 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,15 @@

version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
- package-ecosystem: 'npm' # See documentation for possible values
directory: '/' # Location of package manifests
schedule:
interval: 'weekly'
versioning-strategy: 'increase'
allow:
- dependency-name: 'edge-runtime'
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"
interval: 'weekly'
64 changes: 32 additions & 32 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,20 @@
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
name: 'CodeQL'

on:
push:
branches: [ "main" ]
branches: ['main']
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
branches: ['main']
schedule:
- cron: '20 11 * * 1'

jobs:
analyze:
if: ${{ github.repository == 'panva/openid-client' }}
name: Analyze
runs-on: ubuntu-latest
permissions:
Expand All @@ -32,43 +33,42 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
language: ['javascript']
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# 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@v3

# 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@v3
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: '/language:${{matrix.language}}'
Loading

0 comments on commit 15890ff

Please sign in to comment.