-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Long Le
authored and
Long Le
committed
Sep 12, 2024
1 parent
1f15cf6
commit a6158ec
Showing
2 changed files
with
7 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
extends: 'spectral:oas' | ||
|
||
rules: | ||
check-authentication-methods: | ||
description: "At least one of 'enable_jwt' or 'use_mutual_tls_auth' must be true." | ||
given: "$.api_definition" | ||
then: | ||
- field: 'enable_jwt' | ||
- field: "enable_jwt" | ||
function: truthy | ||
- field: 'use_mutual_tls_auth' | ||
functionOptions: | ||
negation: true # Should not be false | ||
- field: "use_mutual_tls_auth" | ||
function: truthy | ||
functionOptions: | ||
negation: true # Should not be false | ||
severity: error | ||
message: "At least one of 'api_definition.enable_jwt' or 'api_definition.use_mutual_tls_auth' must be true." | ||
message: "At least one of 'api_definition.enable_jwt' or 'api_definition.use_mutual_tls_auth' must be true." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
extends: 'spectral:oas' | ||
|
||
rules: | ||
no-keyless-auth: | ||
description: APIs must not be keyless | ||
|