Skip to content

feat: Add initial AuthzQuerier implementation #5919

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

Merged
merged 384 commits into from
Feb 14, 2023
Merged

Conversation

Emyrk
Copy link
Member

@Emyrk Emyrk commented Jan 30, 2023

What this does

This adds the initial AuthzQuerier implementation as an experiment. It has negative latency impacts to the api at this point, but it is correct* (bugs not withstanding).

The goal of this PR is to push a working implementation.

Testing

Prior to this PR we used AuthorizeAllEndpoints as our rbac assertions. This was weak (see #5204). There is a similar unit test in authzquery that asserts all interface methods have been tested with the proper rbac checks:

func (s *MethodTestSuite) TearDownSuite() {
It solves the problems brought up in that issue.

So we can remove these tests in a future PR:

Fixes #5204

Future Work

In no particular order

  • Implement authz call caching (optimization)
    • Then load testing
  • Optimize certain routes (job cancel)
  • Use joins to make more tables first class rbac objects (dependant on certain tooling changes)
  • Refactor AuthzStore to not be 1:1 with db.Store. Make a new interface for it.
  • Fully implement scoped system roles
  • // TODO: This feels incorrect as we are really returning a list of orgmembers.
    // This return type should be refactored to return a list of orgmembers, not this
    // special type.

Optimizations

@johnstcn johnstcn changed the title chore: Add initial AuthzQuerier implementation [WIP] chore: Add initial AuthzQuerier implementation Jan 30, 2023
@johnstcn johnstcn merged commit 6fb8aff into main Feb 14, 2023
@johnstcn johnstcn deleted the authzquerier_layer branch February 14, 2023 14:27
@github-actions github-actions bot locked and limited conversation to collaborators Feb 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve RBAC comprehensive testing
4 participants