Skip to content

Commit 8d0595d

Browse files
NLB-6875: update R34 Directives
1 parent adac193 commit 8d0595d

File tree

4 files changed

+38
-16
lines changed

4 files changed

+38
-16
lines changed

analyze.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ const (
9898
ngxHTTPSifConf = 0x20000000 // http > server > if
9999
ngxHTTPLifConf = 0x40000000 // http > location > if
100100
ngxHTTPLmtConf = 0x80000000 // http > location > limit_except
101+
ngxHTTPOIDCConf = 0x100000000 // http > oidc_provider
101102
)
102103

103104
// helpful directive location alias describing "any" context
@@ -126,6 +127,7 @@ var contexts = map[string]uint{
126127
blockCtx{"http", "location", "if"}.key(): ngxHTTPLifConf,
127128
blockCtx{"http", "location", "limit_except"}.key(): ngxHTTPLmtConf,
128129
blockCtx{"mgmt"}.key(): ngxMgmtMainConf,
130+
blockCtx{"http", "oidc_provider"}.key(): ngxHTTPOIDCConf,
129131
}
130132

131133
func enterBlockCtx(stmt *Directive, ctx blockCtx) blockCtx {

analyze_nplus_R34_directives.gen.go

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

analyze_test.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2894,6 +2894,15 @@ func TestAnalyze_oidc(t *testing.T) {
28942894
blockCtx{"stream"},
28952895
true,
28962896
},
2897+
"client_id args not ok": {
2898+
&Directive{
2899+
Directive: "client_id",
2900+
Args: []string{},
2901+
Line: 5,
2902+
},
2903+
blockCtx{"http", "oidc_provider"},
2904+
true,
2905+
},
28972906
}
28982907

28992908
for name, tc := range testcases {
@@ -2917,4 +2926,4 @@ func TestAnalyze_oidc(t *testing.T) {
29172926
}
29182927
})
29192928
}
2920-
}
2929+
}

scripts/generate/configs/nplus_R34_config.json

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
["ngxMailMainConf", "ngxMailSrvConf", "ngxConfTake1"],
8787
["ngxMgmtMainConf", "ngxConfTake1"],
8888
["ngxStreamMainConf", "ngxStreamSrvConf", "ngxConfTake1"],
89-
["ngxConfTake1"]
89+
["ngxHTTPOIDCConf", "ngxConfTake1"]
9090
],
9191
"ssl_name": [["ngxMgmtMainConf", "ngxConfTake1"]],
9292
"ssl_password_file": [
@@ -107,7 +107,7 @@
107107
["ngxMailMainConf", "ngxMailSrvConf", "ngxConfTake1"],
108108
["ngxMgmtMainConf", "ngxConfTake1"],
109109
["ngxStreamMainConf", "ngxStreamSrvConf", "ngxConfTake1"],
110-
["ngxConfTake1"]
110+
["ngxHTTPOIDCConf", "ngxConfTake1"]
111111
],
112112
"ssl_verify": [["ngxMgmtMainConf", "ngxConfFlag"]],
113113
"ssl_verify_depth": [
@@ -127,7 +127,18 @@
127127
["ngxMgmtMainConf","ngxConfTake1"]
128128
],
129129
"proxy_username": [["ngxMgmtMainConf","ngxConfTake1"]],
130-
"proxy_password": [["ngxMgmtMainConf","ngxConfTake1"]]
130+
"proxy_password": [["ngxMgmtMainConf","ngxConfTake1"]],
131+
"client_id": [["ngxHTTPOIDCConf", "ngxConfTake1"]],
132+
"client_secret": [["ngxHTTPOIDCConf", "ngxConfTake1"]],
133+
"issuer": [["ngxHTTPOIDCConf", "ngxConfTake1"]],
134+
"config_url": [["ngxHTTPOIDCConf", "ngxConfTake1"]],
135+
"cookie_name": [["ngxHTTPOIDCConf", "ngxConfTake1"]],
136+
"extra_auth_args": [["ngxHTTPOIDCConf", "ngxConfTake1"]],
137+
"redirect_uri": [["ngxHTTPOIDCConf", "ngxConfTake1"]],
138+
"scope": [["ngxHTTPOIDCConf", "ngxConfTake1"]],
139+
"session_store": [["ngxHTTPOIDCConf", "ngxConfTake1"]],
140+
"session_timeout": [["ngxHTTPOIDCConf", "ngxConfTake1"]]
141+
131142
},
132143

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

0 commit comments

Comments
 (0)