Skip to content

Commit

Permalink
modify ruleset for authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
Long Le authored and Long Le committed Sep 10, 2024
1 parent a53a2f4 commit e50bfaf
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions dev/tykapi-ruleset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,13 @@ rules:
functionOptions:
match: '^(?!\s*$).+'

security-authentication:
description: |
The API specification must specify either JWT authentication or mutual TLS authentication.
message: |
Either `.enable_jwt` must be true or `use_mutual_tls_auth` must be true.
given: $ # Root level
check-auth-settings:
description: Ensure either `enable_jwt` or `use_mutual_tls_auth` is set to true
message: "Either `enable_jwt` or `use_mutual_tls_auth` must be set to true."
severity: error
given: "$"
then:
field: $ # Root level
function: anyOf
functionOptions:
criteria:
- field: $.enable_jwt
function: truthy
- field: $.use_mutual_tls_auth
function: truthy
severity: error
function: "truthy"
field: "enable_jwt"
or:
- field: "use_mutual_tls_auth"

0 comments on commit e50bfaf

Please sign in to comment.