Skip to content

Commit

Permalink
removed custom ruleset
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 72fac80 commit 7d8f34e
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions dev/tykapi-ruleset.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
extends: default

rules:
no-keyless-auth:
description: APIs must not be keyless
Expand Down Expand Up @@ -37,19 +35,19 @@ rules:
- true
message: Either 'JWT' or 'mutualTLS' must be enabled.
# Custom rule logic to ensure that at least one of the fields is true
custom:
function: |
function validate(context) {
const enableJwt = context.targetObj.enable_jwt;
const mutualTlsAuth = context.targetObj.auth_configs?.use_mutual_tls_auth;
# custom:
# function: |
# function validate(context) {
# const enableJwt = context.targetObj.enable_jwt;
# const mutualTlsAuth = context.targetObj.auth_configs?.use_mutual_tls_auth;

if (enableJwt !== true && mutualTlsAuth !== true) {
context.report({
message: "Either 'JWT' or 'mutualTLS' must be enabled.",
path: context.path,
});
}
}
return {
validate,
}
# if (enableJwt !== true && mutualTlsAuth !== true) {
# context.report({
# message: "Either 'JWT' or 'mutualTLS' must be enabled.",
# path: context.path,
# });
# }
# }
# return {
# validate,
# }

0 comments on commit 7d8f34e

Please sign in to comment.