-
Notifications
You must be signed in to change notification settings - Fork 166
[TT-10073] Support Tyk OAS with Open Policy Agent #7054
base: master
Are you sure you want to change the base?
Conversation
|
|
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
✅ PS. Add to the end of url /docs/nightly
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ PS. Add to the end of url /docs/nightly
To edit notification comments on pull requests, go to your Netlify project configuration. |
andyo-tyk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made suggested changes to the shared opa_rules.md file.
@sharadregoti Is this automatically embedded in the dashboard_configuration.md file?
If not, then please update that file to match.
tyk-docs/content/shared/opa-rules.md
Outdated
| not input.user.group_name == "TeamA-Admin" | ||
| } | ||
| # Rule is_tyk_oas check if endpoint belongs to oas api. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # Rule is_tyk_oas check if endpoint belongs to oas api. | |
| # Rule is_tyk_oas identifies if the API is Tyk OAS by checking the endpoint used for the operation. |
tyk-docs/content/shared/opa-rules.md
Outdated
| startswith(input.request.path, "/api/apis/oas") | ||
| } | ||
| # Rule is_tyk_streams check if endpoint belongs to streams api. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # Rule is_tyk_streams check if endpoint belongs to streams api. | |
| # Rule is_tyk_streams identifies if the API is Tyk Streams by checking the endpoint used for the operation. |
tyk-docs/content/shared/opa-rules.md
Outdated
| startswith(input.request.path, "/api/apis/streams") | ||
| } | ||
| # Rule is_tyk_classic check if endpoint belongs to classic api. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # Rule is_tyk_classic check if endpoint belongs to classic api. | |
| # Rule is_tyk_classic identifies if the API is Tyk Classic by exclusion (i.e. not Tyk OAS and not Tyk Streams). |
tyk-docs/content/shared/opa-rules.md
Outdated
| # | ||
| # IMPORTANT: Whenever a new API type is introduced under the "/api/apis/" path, | ||
| # this rule MUST be explicitly updated to exclude the new type. | ||
| # Failure to do so will result in the new API type being incorrectly classified as "classic", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # Failure to do so will result in the new API type being incorrectly classified as "classic", | |
| # Failure to do so will result in the new API type being incorrectly classified as "Tyk Classic", |
tyk-docs/content/shared/opa-rules.md
Outdated
| # } | ||
| # | ||
| # Consider refactoring this rule to use positive matching instead of exclusion | ||
| # if a specific pattern for classic APIs can be identified. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # if a specific pattern for classic APIs can be identified. |
tyk-docs/content/shared/opa-rules.md
Outdated
| default is_tyk_classic = false | ||
| is_tyk_classic { | ||
| not is_tyk_oas | ||
| not is_tyk_streams |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| not is_tyk_streams |
tyk-docs/content/shared/opa-rules.md
Outdated
| is_tyk_classic { | ||
| not is_tyk_oas | ||
| not is_tyk_streams | ||
| startswith(input.request.path, "/api/apis") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| startswith(input.request.path, "/api/apis") |
tyk-docs/content/shared/opa-rules.md
Outdated
| not is_tyk_oas | ||
| not is_tyk_streams | ||
| startswith(input.request.path, "/api/apis") | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| } |
tyk-docs/content/shared/opa-rules.md
Outdated
| # Failure to do so will result in the new API type being incorrectly classified as "classic", | ||
| # which may lead to incorrect authorization policies being applied. | ||
| # | ||
| # Example: If a new API type "graphql" is added with path "/api/apis/graphql", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # Example: If a new API type "graphql" is added with path "/api/apis/graphql", | |
| # Example: If a new API type "graphql" is added, you should add an identifier |
tyk-docs/content/shared/opa-rules.md
Outdated
| # which may lead to incorrect authorization policies being applied. | ||
| # | ||
| # Example: If a new API type "graphql" is added with path "/api/apis/graphql", | ||
| # this rule must be updated to: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # this rule must be updated to: | |
| # helper (e.g. is_tyk_graphql) and this rule must be updated to: |
a90edf0 to
b8708b5
Compare
User description
Contributor checklist
New Contributors
masterPR Type
Documentation
Description
Add OPA helpers for Tyk OAS/streams/classic
Gate patch rules with is_tyk_classic
Document maintenance warning for exclusions
Sync shared OPA rules snippet
Diagram Walkthrough
File Walkthrough
dashboard-configuration.md
OPA helpers and guards added to dashboard config docstyk-docs/content/api-management/dashboard-configuration.md
is_tyk_oas,is_tyk_streams,is_tyk_classicrules.patch_requestexamples withis_tyk_classic.opa-rules.md
Shared OPA rules for API type detectiontyk-docs/content/shared/opa-rules.md