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: json schema for access rules #1074

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

imrushi
Copy link

@imrushi imrushi commented Mar 1, 2023

This adds schema validation for access rules. It will be useful for users and developers to take action prior to deploying the configuration to the Oathkeeper in order to verify the schema's rules and some of the validation in their IDE. It follows the Access Rule format.

Related issue(s)

Related to issue: #828

Checklist

  • I have read the contributing guidelines.
  • I have referenced an issue containing the design document if my change
    introduces a new feature.
  • I am following the
    contributing code guidelines.
  • I have read the security policy.
  • I confirm that this pull request does not address a security
    vulnerability. If this pull request addresses a security vulnerability, I
    confirm that I got the approval (please contact
    security@ory.sh) from the maintainers to push
    the changes.
  • I have added tests that prove my fix is effective or that my feature
    works.
  • I have added or changed the documentation.

Further Comments

I'm not sure if I should add this schema to version.schema.json

This adds schema validation for access rules. Closes ory#828
@imrushi imrushi requested a review from aeneasr as a code owner March 1, 2023 18:10
@codecov
Copy link

codecov bot commented Mar 1, 2023

Codecov Report

Merging #1074 (60c40da) into master (461f088) will increase coverage by 0.57%.
Report is 1 commits behind head on master.
The diff coverage is n/a.

❗ Current head 60c40da differs from pull request most recent head 551dee2. Consider uploading reports for the commit 551dee2 to get more accurate results

@@            Coverage Diff             @@
##           master    #1074      +/-   ##
==========================================
+ Coverage   77.65%   78.22%   +0.57%     
==========================================
  Files          79       80       +1     
  Lines        3979     3863     -116     
==========================================
- Hits         3090     3022      -68     
+ Misses        608      566      -42     
+ Partials      281      275       -6     

see 2 files with indirect coverage changes

@zeroows
Copy link

zeroows commented Aug 17, 2024

any update on this?

@hqdncw
Copy link

hqdncw commented Sep 14, 2024

There's a lack of support for match.authority and match.full_method fields

# yaml-language-server: $schema=https://raw.githubusercontent.com/ory/oathkeeper/551dee219fa12c86b26cc59f2dc840f68915f67d/.schema/rules.schema.json
- id: some-id
  version: v0.36.0-beta.4
  match:
    authority: example.com  # Property authority is not allowed. [0]
    full_method: my.grpc.package/MyService/MyMethod  # Property full_method is not allowed. [0]
  authenticators:
  - handler: noop
  authorizer:
    handler: allow
  mutators:
  - handler: noop
  errors:
  - handler: json

https://www.ory.sh/docs/oathkeeper/grpc-middleware

@aeneasr
Copy link
Member

aeneasr commented Sep 14, 2024

So far this only adds the JSON file, but does not actually validate the rules! I also think we can probably use some of the config schema? However so far I think this needs more work

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.

4 participants