Skip to content

Commit 75a3c97

Browse files
committed
feat: override ssl_ocsp in code generator config
1 parent 687b76b commit 75a3c97

File tree

6 files changed

+24
-12
lines changed

6 files changed

+24
-12
lines changed

analyze.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,20 @@ package crossplane
1919
// Update for OSS, filter in config is the directives not in https://nginx.org/en/docs/dirindex.html but in source code.
2020
// Override in config is for the "if" directive. We create a bitmask ngxConfExpr for it in crossplane, which is not in source code.
2121
//go:generate sh -c "sh ./scripts/generate/generate.sh --url https://github.com/nginx/nginx.git --config-path ./scripts/generate/configs/oss_latest_config.json > ./analyze_oss_latest_directives.gen.go"
22-
//go:generate sh -c "sh ./scripts/generate/generate.sh --url https://github.com/nginx/nginx.git --config-path ./scripts/generate/configs/oss_126_config.json --branch branches/stable-1.26 > ./analyze_oss_126_directives.gen.go"
23-
//go:generate sh -c "sh ./scripts/generate/generate.sh --url https://github.com/nginx/nginx.git --config-path ./scripts/generate/configs/oss_124_config.json --branch branches/stable-1.24 > ./analyze_oss_124_directives.gen.go"
22+
//go:generate sh -c "sh ./scripts/generate/generate.sh --url https://github.com/nginx/nginx.git --config-path ./scripts/generate/configs/oss_126_config.json --branch stable-1.26 > ./analyze_oss_126_directives.gen.go"
23+
//go:generate sh -c "sh ./scripts/generate/generate.sh --url https://github.com/nginx/nginx.git --config-path ./scripts/generate/configs/oss_124_config.json --branch stable-1.24 > ./analyze_oss_124_directives.gen.go"
2424

2525
// Update for lua, override is for the lua block directives, see https://github.com/nginxinc/nginx-go-crossplane/pull/86.
2626
//go:generate sh -c "sh ./scripts/generate/generate.sh --url https://github.com/openresty/lua-nginx-module.git --config-path ./scripts/generate/configs/lua_config.json --path ./src > ./analyze_lua_directives.gen.go"
2727

28-
// Update for otel. Filter is for some directives withou context.
28+
// Update for otel. Filter is for some directives without context.
2929
// Otel provides its own config handler for some directives and they don't have context. Currently we don't support them.
3030
//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"
3131

3232
// Update for NAP v4 and v5.
3333
// NAP is a private module. Please ensure you have correct access and put the url.
3434
// 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.
35+
// Override is for flag directives. NAP used ngxConfTake1 for flag directives, we change them to ngxConfFlag in crossplane.
3636
// NAP v4
3737
//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"
3838
// NAP v5

scripts/generate/configs/nplus_R33_config.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,11 @@
119119
"enforce_initial_report": [["ngxMgmtMainConf","ngxConfFlag"]],
120120
"license_token": [["ngxMgmtMainConf","ngxConfTake1"]],
121121
"state_path": [["ngxMgmtMainConf","ngxConfTake1"]],
122-
"zone_sync": [["ngxStreamSrvConf","ngxConfNoArgs"]]
122+
"zone_sync": [["ngxStreamSrvConf","ngxConfNoArgs"]],
123+
"ssl_ocsp": [
124+
["ngxHTTPMainConf", "ngxHTTPSrvConf", "ngxConfTake1"],
125+
["ngxStreamMainConf", "ngxStreamSrvConf", "ngxConfTake1"]
126+
]
123127
},
124128

125129
"matchFuncComment":"MatchNginxPlusR33 contains directives in Nginx Plus R33 source code(including GEOIP, Perl, and XSLT)"

scripts/generate/configs/nplus_R34_config.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,11 @@
137137
"redirect_uri": [["ngxHTTPOIDCConf", "ngxConfTake1"]],
138138
"scope": [["ngxHTTPOIDCConf", "ngxConfTake1"]],
139139
"session_store": [["ngxHTTPOIDCConf", "ngxConfTake1"]],
140-
"session_timeout": [["ngxHTTPOIDCConf", "ngxConfTake1"]]
141-
140+
"session_timeout": [["ngxHTTPOIDCConf", "ngxConfTake1"]],
141+
"ssl_ocsp": [
142+
["ngxHTTPMainConf", "ngxHTTPSrvConf", "ngxConfTake1"],
143+
["ngxStreamMainConf", "ngxStreamSrvConf", "ngxConfTake1"]
144+
]
142145
},
143146

144147
"matchFuncComment":"MatchNginxPlusR34 contains directives in Nginx Plus R34 source code(including GEOIP, Perl, and XSLT)"

scripts/generate/configs/nplus_R35_config.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,12 @@
142142
"logout_token_hint": [["ngxHTTPOIDCConf", "ngxConfFlag"]],
143143
"logout_uri": [["ngxHTTPOIDCConf", "ngxConfTake1"]],
144144
"post_logout_uri": [["ngxHTTPOIDCConf", "ngxConfTake1"]],
145-
"userinfo": [["ngxHTTPOIDCConf", "ngxConfTake1"]]
146-
147-
},
145+
"userinfo": [["ngxHTTPOIDCConf", "ngxConfTake1"]],
146+
"ssl_ocsp": [
147+
["ngxHTTPMainConf", "ngxHTTPSrvConf", "ngxConfTake1"],
148+
["ngxStreamMainConf", "ngxStreamSrvConf", "ngxConfTake1"]
149+
]
150+
},
148151

149152
"matchFuncComment":"MatchNginxPlusR35 contains directives in Nginx Plus R35 source code(including GEOIP, Perl, and XSLT)"
150153
}

scripts/generate/configs/oss_124_config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
"gzip_no_buffer"
3939
],
4040
"override":{
41-
"if":[[ "ngxHTTPSrvConf", "ngxHTTPLocConf", "ngxConfBlock", "ngxConfExpr", "ngxConf1More"]]
41+
"if":[[ "ngxHTTPSrvConf", "ngxHTTPLocConf", "ngxConfBlock", "ngxConfExpr", "ngxConf1More"]],
42+
"ssl_ocsp": [["ngxHTTPMainConf", "ngxHTTPSrvConf", "ngxConfTake1"]]
4243
},
4344
"matchFuncComment":"MatchOss124 contains directives in OSS 1.2.4 source code(including GEOIP, Perl, and XSLT)"
4445
}

scripts/generate/configs/oss_126_config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
"gzip_no_buffer"
3939
],
4040
"override":{
41-
"if":[[ "ngxHTTPSrvConf", "ngxHTTPLocConf", "ngxConfBlock", "ngxConfExpr", "ngxConf1More"]]
41+
"if":[[ "ngxHTTPSrvConf", "ngxHTTPLocConf", "ngxConfBlock", "ngxConfExpr", "ngxConf1More"]],
42+
"ssl_ocsp": [["ngxHTTPMainConf", "ngxHTTPSrvConf", "ngxConfTake1"]]
4243
},
4344
"matchFuncComment":"MatchOss126 contains directives in OSS 1.2.6 source code(including GEOIP, Perl, and XSLT)"
4445
}

0 commit comments

Comments
 (0)