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

feat: Add Cloudflare Access middleware #880

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

G4brym
Copy link
Contributor

@G4brym G4brym commented Dec 10, 2024

usage:

app.use('*', cloudflareAccess('my-access-team-name'))

access jwt payload

app.get('/', (c) => {
  const payload = c.get('accessPayload')
  
  return c.text(`You just authenticated with the email ${payload.email}`)
})

Copy link

changeset-bot bot commented Dec 10, 2024

🦋 Changeset detected

Latest commit: 4dc4227

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

This PR includes changesets to release 1 package
Name Type
@hono/cloudflare-access Minor

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

@G4brym G4brym force-pushed the add-cloudflare-access-middleware branch 2 times, most recently from a355909 to b9061e2 Compare December 10, 2024 20:41
@yusukebe yusukebe changed the title Add Cloudflare Access middleware feat: Add Cloudflare Access middleware Dec 12, 2024
Copy link
Member

@yusukebe yusukebe left a comment

Choose a reason for hiding this comment

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

Can you add a CI for this middleware like this: https://github.com/honojs/middleware/blob/main/.github/workflows/ci-hello.yml

And I've left comments.

packages/cloudflare-access/src/index.ts Show resolved Hide resolved
@yusukebe
Copy link
Member

Hi @G4brym

I've tried this middleware in my environment, and it works well! Please check some comments.

@G4brym G4brym force-pushed the add-cloudflare-access-middleware branch from b9061e2 to 4dc4227 Compare December 12, 2024 11:26
@G4brym
Copy link
Contributor Author

G4brym commented Dec 12, 2024

Can you add a CI for this middleware like this: https://github.com/honojs/middleware/blob/main/.github/workflows/ci-hello.yml

And I've left comments.

i've just added the CI

If you want, you can add me as CODEOWNER for packages/cloudflare-access/* if you want me to review future contributions

@yusukebe
Copy link
Member

@G4brym

Using CODEOWNER sounds good! (Currently, we don't use it for this repo)

Looks good for this PR. Let's go. Thank you very much!

@yusukebe yusukebe merged commit 2720ac7 into honojs:main Dec 13, 2024
1 check passed
@github-actions github-actions bot mentioned this pull request Dec 13, 2024
askorupskyy pushed a commit to askorupskyy/hono-middleware that referenced this pull request Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants