Skip to content

Commit

Permalink
simplified regex thanks to @P0lip
Browse files Browse the repository at this point in the history
  • Loading branch information
philsturgeon committed Jan 22, 2024
1 parent f91036a commit 7f66fa8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion __tests__/owasp-api9-2023-inventory-access.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { DiagnosticSeverity } from "@stoplight/types";
import testRule from "./__helpers__/helper";

testRule("owasp:api8:2023-inventory-access", [
testRule("owasp:api9:2023-inventory-access", [
{
name: "valid case: declares x-internal as either true or false",
document: {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/owasp-api9-2023-inventory-environment.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { DiagnosticSeverity } from "@stoplight/types";
import testRule from "./__helpers__/helper";

testRule("owasp:api8:2023-inventory-environment", [
testRule("owasp:api9:2023-inventory-environment", [
{
name: "valid case: mentions one keyword in each server",
document: {
Expand Down
8 changes: 4 additions & 4 deletions src/ruleset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -858,13 +858,13 @@ export default {
* How to prevent
* - 🟠 Servers, define which environment is the API running in (e.g. production, staging, test, development)
* - ✅ Require servers use x-internal true/false to explicitly explain what is public or internal for documentation tools
* - 🟠 There is no retirement plan for each API version.
* - 🤷‍♂️ There is no retirement plan for each API version.
*/

/**
* @author: Phil Sturgeon <https://github.com/philsturgeon>
*/
"owasp:api8:2023-inventory-access": {
"owasp:api9:2023-inventory-access": {
message:
"Declare intended audience of every server by defining servers{{property}} as true/false.",
description:
Expand All @@ -881,7 +881,7 @@ export default {
/**
* @author: Phil Sturgeon <https://github.com/philsturgeon>
*/
"owasp:api8:2023-inventory-environment": {
"owasp:api9:2023-inventory-environment": {
message:
"Declare intended environment in server descriptions using terms like local, staging, production.",
description:
Expand All @@ -894,7 +894,7 @@ export default {
function: pattern,
functionOptions: {
match:
"((l|L)ocal|(a|A)lpha|(b|B)eta|(t|T)est|testing|stag|(s|S)taging|(p|P)rod|(p|P)roduction|(n|N)ext|(p|P)reprod)",
"/(local|alpha|beta|test|testing|stag|staging|prod|production|next|preprod)/i",
},
},
},
Expand Down

0 comments on commit 7f66fa8

Please sign in to comment.