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 basic behavior of authorization webhook #188

Merged
merged 9 commits into from
May 27, 2021
Merged

Add basic behavior of authorization webhook #188

merged 9 commits into from
May 27, 2021

Conversation

hackerwins
Copy link
Member

@hackerwins hackerwins commented May 21, 2021

What this PR does / why we need it:

Add authorization webhook. In this PR, we only implement the default behavior.

  • Delete RequestHeader because we can carry the version in gRPC metadata.
  • Implement basic authorization webhook.
  • Add access attributes such as key and verb to webhook request payload.

Which issue(s) this PR fixes:

Fixes #182

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


Additional documentation:


Checklist:

  • Added relevant tests or not required
  • Didn't break anything

@codecov
Copy link

codecov bot commented May 21, 2021

Codecov Report

Merging #188 (dd71d3c) into main (e0c4b51) will increase coverage by 0.22%.
The diff coverage is 69.84%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #188      +/-   ##
==========================================
+ Coverage   61.45%   61.68%   +0.22%     
==========================================
  Files          39       40       +1     
  Lines        3386     3440      +54     
==========================================
+ Hits         2081     2122      +41     
- Misses       1117     1124       +7     
- Partials      188      194       +6     
Impacted Files Coverage Δ
yorkie/config.go 89.28% <0.00%> (+8.03%) ⬆️
yorkie/rpc/server.go 49.81% <61.53%> (+1.21%) ⬆️
client/auth.go 73.91% <73.91%> (ø)
client/client.go 12.13% <84.61%> (+4.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e0c4b51...dd71d3c. Read the comment docs.

@hackerwins hackerwins force-pushed the authz-webhook branch 6 times, most recently from f23d9aa to a515688 Compare May 23, 2021 04:13
@hackerwins hackerwins changed the title Add authorization webhook Add basic behavior of authorization webhook May 24, 2021
@hackerwins hackerwins marked this pull request as ready for review May 24, 2021 05:06
@hackerwins hackerwins requested a review from a team May 24, 2021 05:06
@hackerwins
Copy link
Member Author

hackerwins commented May 25, 2021

The following additional work will be done in the follow-up PR.

  • Implement retry and retryBackoff.
  • Add authorization-methods flags.
  • Add authorization-cache-ttl flags (LRUExpireCache).
  • Provide a way to refresh the token.

pkg/types/auth_webhook.go Outdated Show resolved Hide resolved
Copy link
Member

@ppeeou ppeeou left a comment

Choose a reason for hiding this comment

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

LGTM🚀

Copy link
Member

@dc7303 dc7303 left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@hackerwins hackerwins merged commit 18c083d into main May 27, 2021
@hackerwins hackerwins deleted the authz-webhook branch May 27, 2021 14:17
jeonjonghyeok pushed a commit to jeonjonghyeok/yorkie that referenced this pull request Aug 4, 2022
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.

Provide Authorization Webhook
4 participants