Skip to content

chore(backend): Enforce request param in authenticateRequest - #2122

Merged
dimkl merged 5 commits into
mainfrom
sdk-784-enforce-request-param
Nov 16, 2023
Merged

chore(backend): Enforce request param in authenticateRequest#2122
dimkl merged 5 commits into
mainfrom
sdk-784-enforce-request-param

Conversation

@dimkl

Copy link
Copy Markdown
Contributor

Description

Changes:

  • drop options that can be retrieved from headers or cookies of request
  • enforce usage of request param
  • refactor types to fix the cyclic type dependency and allow separating the options passed in authenticateRequest from the options used internally

Checklist

  • npm test runs as expected.
  • npm run build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

Packages affected

  • @clerk/backend
  • @clerk/chrome-extension
  • @clerk/clerk-js
  • @clerk/clerk-expo
  • @clerk/fastify
  • gatsby-plugin-clerk
  • @clerk/localizations
  • @clerk/nextjs
  • @clerk/clerk-react
  • @clerk/remix
  • @clerk/clerk-sdk-node
  • @clerk/shared
  • @clerk/themes
  • @clerk/types
  • build/tooling/chore

@dimkldimkl self-assigned this Nov 13, 2023
@dimkl
dimkl requested a review from a team as a code ownerNovember 13, 2023 16:07
@changeset-bot

changeset-botBot commented Nov 13, 2023

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: eaa8e1b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
NameType
@clerk/backendMajor
@clerk/fastifyPatch
gatsby-plugin-clerkPatch
@clerk/nextjsPatch
@clerk/remixPatch
@clerk/clerk-sdk-nodePatch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Comment threadpackages/backend/src/api/request.ts Outdated
@dimkl
dimklforce-pushed the sdk-782-drop-deprecations-backend branch from 9be55f9 to 07edf5bCompareNovember 14, 2023 15:37
@dimkl
dimklforce-pushed the sdk-784-enforce-request-param branch from a2ce60e to 4c80b1aCompareNovember 14, 2023 15:39
@dimkl
dimkl requested a review from LekoArtsNovember 14, 2023 15:40
@dimkl
dimklforce-pushed the sdk-782-drop-deprecations-backend branch 3 times, most recently from 6b8d70b to 92bbeb9CompareNovember 15, 2023 14:16
@dimkl
dimklforce-pushed the sdk-782-drop-deprecations-backend branch from 92bbeb9 to 53bef9cCompareNovember 16, 2023 10:47
Base automatically changed from sdk-782-drop-deprecations-backend to mainNovember 16, 2023 11:41
@dimkl
dimklforce-pushed the sdk-784-enforce-request-param branch 2 times, most recently from d45a8e4 to 6e54944CompareNovember 16, 2023 17:08
…pes dependencies
Instead of passing the `AuthenticateRequestOptions` down the dependency tree
`authenticateRequest => interstitialRule => AuthStatus => AuthObjects`, we
change the approach to bottom-up by definiting types per layer and importing them
to the parent layer. Also options of parent layers extend the options of child layers.
@dimkl
dimklforce-pushed the sdk-784-enforce-request-param branch 2 times, most recently from b08abaa to 90a6ff9CompareNovember 16, 2023 21:20
@dimkl
dimklforce-pushed the sdk-784-enforce-request-param branch from 90a6ff9 to eaa8e1bCompareNovember 16, 2023 21:21
@dimkl
dimkl added this pull request to the merge queue Nov 16, 2023
Merged via the queue into main with commit 9615e6cNov 16, 2023
@dimkl
dimkl deleted the sdk-784-enforce-request-param branch November 16, 2023 21:49
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@dimkl@anagstef@LekoArts@clerk-cookie