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

SDK Spec: Backend-only #1394

Merged
merged 5 commits into from
Aug 9, 2024
Merged

SDK Spec: Backend-only #1394

merged 5 commits into from
Aug 9, 2024

Conversation

LekoArts
Copy link
Member

@LekoArts LekoArts commented Aug 6, 2024

This PR will be merged into #1344 and operates in the same context of "SDK Spec". Companion to #1368

Fixes ECO-110
Fixes ECO-100

@LekoArts LekoArts requested a review from a team as a code owner August 6, 2024 14:06
Copy link

github-actions bot commented Aug 6, 2024

Hey, here’s your docs preview: https://clerk.com/docs/pr/1394

@LekoArts LekoArts changed the title initial SDK Spec: Backend-only Aug 6, 2024
@LekoArts LekoArts mentioned this pull request Aug 6, 2024
@alexisintech alexisintech requested a review from jescalan August 7, 2024 18:26
docs/references/sdk/backend-only.mdx Outdated Show resolved Hide resolved
docs/references/sdk/backend-only.mdx Outdated Show resolved Hide resolved
docs/references/sdk/backend-only.mdx Outdated Show resolved Hide resolved
docs/references/sdk/backend-only.mdx Outdated Show resolved Hide resolved

const hasPermission = (context, next) => {
const auth = getAuth(context)
if (!auth.has({ permission: 'permission' })) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is that what you meant by hasPermission ? the has({ permission }) ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for asking, I made some changes and hopefully clarified some things!

Essentially I described https://clerk.com/docs/references/nextjs/auth-object and its has(). It's not unique to Next.js (so maybe in the wrong place?) and for now I linked to it.

Let me know if the updated text makes more sense

docs/references/sdk/backend-only.mdx Outdated Show resolved Hide resolved
docs/references/sdk/backend-only.mdx Outdated Show resolved Hide resolved
docs/references/sdk/backend-only.mdx Outdated Show resolved Hide resolved
docs/references/sdk/backend-only.mdx Outdated Show resolved Hide resolved

### Add handshake support

Add checks for the `headers` to apply them from the request to the response and handle and redirect headers.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is hard to grapple with if you don't have any understanding of what handshake is, or why you would need to do something like this. We could file it as a todo, as I'm not sure that writing an explanation of handshake for the docs is in scope for this PR, but this section is effectively just confusing for anyone who would realistically be trying to do anything with it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, correct 👍

I also noticed this knowledge gap but decided against working on it for this PR. In the internal Notion doc I mentioned that we probably should bring #577 over the finish line and add any new info we have on handshake (that was written internally in the meantime).

LekoArts and others added 2 commits August 9, 2024 11:10
Co-authored-by: Alexis Aguilar <[email protected]>
Co-authored-by: Jeff Escalante <[email protected]>
@LekoArts LekoArts merged commit 88b1d95 into sdk-spec Aug 9, 2024
1 check passed
@LekoArts LekoArts deleted the sdk-spec-backend branch August 9, 2024 09:23
Sign up for free to 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.

3 participants