Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: add support for oidc-provider@8 #23

Merged
merged 23 commits into from
Oct 2, 2024
Merged

Conversation

adrianbrs
Copy link
Owner

@adrianbrs adrianbrs commented Feb 19, 2024

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior?

Currently, version 8 of oidc-provider is not supported as it is now ESM-only, and NestJS still does not support ESM-only packages as it builds only for CJS, generating an error [ERR_REQUIRE_ESM] when importing the oidc-provider library.

Issue Number: #22

What is the new behavior?

ESM-only versions of oidc-provider are now supported through dynamic imports. The only limitation is that you cannot import anything from the oidc-provider library directly, but only through the dependency injection provided by this package.

Does this PR introduce a breaking change?

  • Yes
  • No

Some important changes must be made for this new version to work:

  • All direct imports to the oidc-provider library must be removed
  • You must use decorators or injection tokens to inject the oidc-provider instance or other module exposures
  • Parameter decorators have been renamed to remove the Oidc namespace, and now all decorators are prefixed with Oidc, for example: @OidcContext.
  • The InteractionDetails type has been renamed to Interaction and is now exported directly from oidc-provider.
  • NodeJS >=18

@adrianbrs adrianbrs self-assigned this Feb 19, 2024
@m7rlin
Copy link

m7rlin commented Jun 10, 2024

do you plan to release this feature any soon?

This new decorator makes it easy to retrieve the current user session from the context
@adrianbrs adrianbrs marked this pull request as ready for review October 2, 2024 02:36
This version of `oidc-provider` exports the Provider as a named export. The latest version of the `@types` package also includes the previously missing typings.

BREAKING CHANGE: The `InteractionDetails` type has been renamed to `Interaction` and is now exported directly from `oidc-provider`.
@adrianbrs adrianbrs added type: enhancement New feature or request type: deps Pull requests that update a dependency file type: build labels Oct 2, 2024
@adrianbrs adrianbrs merged commit b455438 into main Oct 2, 2024
7 checks passed
@adrianbrs
Copy link
Owner Author

@m7rlin released in v2.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: build type: deps Pull requests that update a dependency file type: enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants