-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 20240311-01 Commit * 20240311-02 Commit - added regexp checks for names * 20240311-02 Commit - added regexp checks for names * 20240327 - Refactored API Gateway auxfiles * 20240327-01 commit Refactored API Gateway configuration files Regexp check for object descriptions
- Loading branch information
1 parent
327de21
commit 912854e
Showing
35 changed files
with
236 additions
and
2,049 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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"policy": { | ||
"name": "prod-policy", | ||
"template": { | ||
"name": "POLICY_TEMPLATE_NGINX_BASE" | ||
}, | ||
"applicationLanguage": "utf-8", | ||
"enforcementMode": "blocking", | ||
"signature-sets": [ | ||
{ | ||
"name": "All Signatures", | ||
"block": true, | ||
"alarm": true | ||
} | ||
], | ||
"signatures": [ | ||
{ | ||
"signatureId": 200001834, | ||
"enabled": false | ||
}, | ||
{ | ||
"signatureId": 200001475, | ||
"enabled": false | ||
}, | ||
{ | ||
"signatureId": 200000098, | ||
"enabled": false | ||
}, | ||
{ | ||
"signatureId": 200001088, | ||
"enabled": false | ||
}, | ||
{ | ||
"signatureId": 200101609, | ||
"enabled": false | ||
} | ||
] | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"policy": { | ||
"name": "prod-policy", | ||
"template": { | ||
"name": "POLICY_TEMPLATE_NGINX_BASE" | ||
}, | ||
"applicationLanguage": "utf-8", | ||
"enforcementMode": "blocking", | ||
"signature-sets": [ | ||
{ | ||
"name": "All Signatures", | ||
"block": true, | ||
"alarm": true | ||
} | ||
], | ||
"signatures": [ | ||
{ | ||
"signatureId": 200001834, | ||
"enabled": false | ||
} | ||
] | ||
} | ||
} |
92 changes: 73 additions & 19 deletions
92
contrib/postman/NGINX Declarative API.postman_collection.json
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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,34 +0,0 @@ | ||
""" | ||
API Gateway support functions | ||
""" | ||
|
||
import json | ||
import base64 | ||
|
||
import v4_0.GitOps | ||
import v4_0.MiscUtils | ||
from v4_0.OpenAPIParser import OpenAPIParser | ||
|
||
|
||
# Builds the declarative JSON for the API Gateway configuration | ||
# Return a tuple: status, description. If status = 200 things were successful | ||
def createAPIGateway(locationDeclaration: dict): | ||
apiGwDeclaration = {} | ||
|
||
if locationDeclaration['apigateway']['openapi_schema']: | ||
status, apiSchemaString = v4_0.GitOps.getObjectFromRepo(content=locationDeclaration['apigateway']['openapi_schema'], base64Encode=False) | ||
|
||
if v4_0.MiscUtils.yaml_or_json(apiSchemaString) == 'yaml': | ||
# YAML to JSON conversion | ||
apiSchemaString = v4_0.MiscUtils.yaml_to_json(apiSchemaString) | ||
|
||
apiSchema = OpenAPIParser(json.loads(apiSchemaString)) | ||
|
||
apiGwDeclaration = {} | ||
apiGwDeclaration['location'] = locationDeclaration | ||
apiGwDeclaration['info'] = apiSchema.info() | ||
apiGwDeclaration['servers'] = apiSchema.servers() | ||
apiGwDeclaration['paths'] = apiSchema.paths() | ||
apiGwDeclaration['version'] = apiSchema.version() | ||
|
||
return 200, apiGwDeclaration | ||
Oops, something went wrong.