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

Add cookie subject extractor #536

Merged
merged 2 commits into from
Jun 30, 2023
Merged

Conversation

nothing0012
Copy link
Contributor

@nothing0012 nothing0012 commented Jun 25, 2023

Description

Add cookie subject extractor, specifically trying to work with https://developers.cloudflare.com/cloudflare-one/identity/authorization-cookie/application-token/, and assuming that zero trust already did the validation of the jwt, and in this PR, we simply need to extract the subject (i.e. email from the cookie).

Motivation and Context

How Has This Been Tested?

unit test.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@codecov-commenter
Copy link

Codecov Report

Merging #536 (dd2a603) into main (347a36d) will increase coverage by 0.06%.
The diff coverage is 92.85%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##             main     #536      +/-   ##
==========================================
+ Coverage   80.96%   81.02%   +0.06%     
==========================================
  Files          28       28              
  Lines        2222     2235      +13     
==========================================
+ Hits         1799     1811      +12     
- Misses        334      335       +1     
  Partials       89       89              
Impacted Files Coverage Δ
pkg/handler/subject.go 96.55% <92.85%> (-3.45%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@zhouzhuojie zhouzhuojie force-pushed the zz/add-cookie-subject-extractor branch from dd2a603 to b365c8e Compare June 25, 2023 22:34
@nothing0012 nothing0012 merged commit 9ac5043 into main Jun 30, 2023
@nothing0012 nothing0012 deleted the zz/add-cookie-subject-extractor branch June 30, 2023 02:00
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.

3 participants