Skip to content

Commit 787a2e7

Browse files
committed
add NAP into go generate
1 parent 1d9d21d commit 787a2e7

7 files changed

+206
-102
lines changed

analyze.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
package crossplane
99

10+
// Upgrade for .gen.go files. If you don't have access to some private modules,
11+
// please use -skip options to skip them. e.g. go generate -skip="nap".
12+
1013
// Update for headersmore
1114
//go:generate sh -c "sh ./scripts/generate/generate.sh --url https://github.com/openresty/headers-more-nginx-module.git --config-path ./scripts/generate/configs/headersmore_config.json > ./analyze_headersMore_directives.gen.go"
1215

@@ -26,6 +29,15 @@ package crossplane
2629
// Otel provides its own config handler for some directives and they don't have context. Currently we don't support them.
2730
//go:generate sh -c "sh ./scripts/generate/generate.sh --url https://github.com/nginxinc/nginx-otel.git --config-path ./scripts/generate/configs/otel_config.json --branch main > ./analyze_otel_directives.gen.go"
2831

32+
// Update for NAP v4 and v5.
33+
// NAP is a private module. Please ensure you have correct access and put the url.
34+
// and branch of it in environment variable NAP_URL, NAP_V4_BRANCH, and NAP_V5_BRANCH.
35+
// Override is for flag dirctives. NAP used ngxConfTake1 for flag directives, we change them to ngxConfFlag in crossplane.
36+
// NAP v4
37+
//go:generate sh -c "sh ./scripts/generate/generate.sh --url $NAP_URL --config-path ./scripts/generate/configs/nap_v4_config.json --branch $NAP_V4_BRANCH --path ./src > analyze_appProtectWAFv4_directives.gen.go"
38+
// NAP v5
39+
//go:generate sh -c "sh ./scripts/generate/generate.sh --url $NAP_URL --config-path ./scripts/generate/configs/nap_v5_config.json --branch $NAP_V5_BRANCH --path ./src > analyze_appProtectWAFv5_directives.gen.go"
40+
2941
import (
3042
"fmt"
3143
)

analyze_appProtectWAFv4_directives.gen.go

Lines changed: 88 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

analyze_appProtectWAFv4_directives.go

Lines changed: 0 additions & 51 deletions
This file was deleted.

analyze_appProtectWAFv5_directives.gen.go

Lines changed: 88 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

analyze_appProtectWAFv5_directives.go

Lines changed: 0 additions & 51 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"directiveMapName":"appProtectWAFv4Directives",
3+
"matchFuncName":"MatchAppProtectWAFv4",
4+
"matchFuncComment":"MatchAppProtectWAFv4 is a MatchFunc for App Protect v4 module.",
5+
"override":{
6+
"app_protect_enable":[["ngxHTTPMainConf", "ngxHTTPSrvConf" , "ngxHTTPLocConf", "ngxConfFlag"]],
7+
"app_protect_security_log_enable":[["ngxHTTPMainConf", "ngxHTTPSrvConf", "ngxHTTPLocConf", "ngxConfFlag"]]
8+
}
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"directiveMapName":"appProtectWAFv5Directives",
3+
"matchFuncName":"MatchAppProtectWAFv5",
4+
"matchFuncComment":"MatchAppProtectWAFv5 is a MatchFunc for App Protect v5 module.",
5+
"override":{
6+
"app_protect_enable":[["ngxHTTPMainConf", "ngxHTTPSrvConf" , "ngxHTTPLocConf", "ngxConfFlag"]],
7+
"app_protect_security_log_enable":[["ngxHTTPMainConf", "ngxHTTPSrvConf", "ngxHTTPLocConf", "ngxConfFlag"]]
8+
}
9+
}

0 commit comments

Comments
 (0)