You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**ngx\_header\_path\_auth** is a module for [nginx auth request module](http://nginx.org/en/docs/http/ngx_http_auth_request_module.html) that authorizes with the user name and path information set in the HTTP header.
4
+
**ngx\_header\_path\_auth** is a module for nginx [auth request module] that authorizes with the user name and path information set in the HTTP header.
4
5
5
6
## Error handling
6
7
@@ -19,7 +20,7 @@ start it via a process management system such as systemd.
19
20
20
21
## Configuration file format
21
22
22
-
See the [auth request module documentation](http://nginx.org/en/docs/http/ngx_http_auth_request_module.html) for how to configure nginx.
23
+
See the [auth request module] documentation for how to configure nginx.
23
24
24
25
The **ngx\_header\_path\_auth** configuration file is in TOML format, and the following is a sample configuration file.
25
26
@@ -39,6 +40,22 @@ default_right = "*/
39
40
40
41
[authz.path_right]
41
42
"test" = "@dev"
43
+
44
+
#[response.ok]
45
+
#code=200
46
+
#message="Authorized"
47
+
48
+
#[response.forbidden]
49
+
#code=403
50
+
#message="Forbidden"
51
+
52
+
#[response.nopath]
53
+
#code=403
54
+
#message="No path header"
55
+
56
+
#[response.nouser]
57
+
#code=403
58
+
#message="No user header"
42
59
```
43
60
44
61
Each parameter of the configuration file is as follows.
@@ -49,7 +66,9 @@ Each parameter of the configuration file is as follows.
49
66
| :--- | :--- |
50
67
| **socket\_type** | Set this parameter to tcp(TCP socket) or unix(UNIX domain socket). |
51
68
| **socket\_path** | Set the IP address and port number for tcp, and UNIX domain socket file path for unix. |
52
-
| **cache\_seconds** | The cache duration in seconds to pass to nginx. However, if its value is 0, it will not use the cache.<br>See [Authentication Cache Control](proxy_cache.md) for details.|
69
+
| **cache\_seconds** | Cache duration in seconds passed to nginx upon successful authentication. If the value is 0, cache will not be used. <br>See [Authentication Cache Control](proxy_cache.md) for details. |
70
+
| **neg\_cache\_seconds** | Cache duration in seconds passed to nginx upon failed authentication. If the value is 0, cache will not be used. <br>See [Authentication Cache Control](proxy_cache.md) for details. |
71
+
| **use\_etag** | Set to `true` if you want to validate the cache using the `ETag` tag. <br>See [Authentication Cache Control](proxy_cache.md) for details. |
53
72
| **path\_header** | A HTTP header that sets the path used for authorization processing. The default value is `X-Authz-Path`. In the appropriate place of the nginx configuration file, use `proxy_set_header` directive to set the HTTP header. (Eg `proxy_set_header X-Authz-Path $request_uri;`) |
54
73
| **user\_header** | A HTTP header to set the user name. The default value is `X-Forwarded-User`. In the appropriate place of the nginx configuration file, use `proxy_set_header` directive to set the HTTP header. (Eg `proxy_set_header X-Forwarded-User $remote_user;`) |
55
74
@@ -64,6 +83,34 @@ Each parameter of the configuration file is as follows.
64
83
| **default\_right** | Authorization rights when it matches the **path\_pattern**の regular expression and is not specified in **path\_right**. For more information on authorization rights, see "_Authorization rights details_". |
65
84
| **path\_right** | Authorization rights map for each extracted string when matching **path\_pattern** regular expression. Specify the extraction string as the key. For more information on authorization rights, see "_Authorization rights details_" section. |
66
85
86
+
### **\[response.ok\]** part
87
+
88
+
| Parameter | Description |
89
+
| :--- | :--- |
90
+
| **code** | The HTTP response status code indicates authorized requests. (Default value: `200`)<br>This value is used by the [auth request module]. Therefore, Malfunctions may be caused by the incorrect setting value. |
| **code** | The HTTP response status code indicates failed authorization requests. (Default value: `403`)<br>This value is used by the [auth request module]. Therefore, Malfunctions may be caused by the incorrect setting value. |
| **code** | The HTTP response status code indicates an unexpected HTTP header in **path\_header**. (Default value: `403`)<br>This value is used by the [auth request module]. Therefore, Malfunctions may be caused by the incorrect setting value. |
105
+
| **message** | The HTTP response message indicates an unexpected HTTP header in **path\_header**. (Default value: `"No path header"`) |
106
+
107
+
### **\[response.nouser\]** part
108
+
109
+
| Parameter | Description |
110
+
| :--- | :--- |
111
+
| **code** | The HTTP response status code indicates an unexpected HTTP header in **user\_header**. (Default value: `403`)<br>This value is used by the [auth request module]. Therefore, Malfunctions may be caused by the incorrect setting value. |
112
+
| **message** | The HTTP response message indicates an unexpected HTTP header in **user\_header**. (Default value: `"No user header"`) |
113
+
67
114
## Authorization rights details
68
115
69
116
In **\[authz\]** part, **nomatch\_right**, **default\_right**, and **path\_right** table value specify a character string that combines the following judgment descriptions with `|`. The combined judgment process is calculated by logical disjunction("OR"). If the result is true, it is authorized.
@@ -73,8 +120,8 @@ In **\[authz\]** part, **nomatch\_right**, **default\_right**, and **path\_right
73
120
| empty string | Always considers true regardless of the user name. |
74
121
| `!` | Always considers false regardless of the user name. |
75
122
| `*` | If the user name exists, it is considered true. |
76
-
| `@groupname` | The character string after @ is treated as a group name. True if the group contains users. Groups are defined in the **user_map** file. |
77
-
| `@` (no group name) | True if the user is described in the **user_map** file. |
123
+
| `@groupname` | The character string after @ is treated as a group name. True if the group contains users. Groups are defined in the **user\_map** file. |
124
+
| `@` (no group name) | True if the user is described in the **user\_map** file. |
**ngx\_ldap\_auth** is a module for [nginx auth request module](http://nginx.org/en/docs/http/ngx_http_auth_request_module.html) that authenticates using an LDAP bind operation.
4
+
**ngx\_ldap\_auth** is a module for nginx [auth request module](http://nginx.org/en/docs/http/ngx_http_auth_request_module.html) that authenticates using an LDAP bind operation.
4
5
5
6
## Error handling
6
7
@@ -9,7 +10,7 @@ On error, the process terminates with an unsuccessful status.
Each parameter of the configuration file is as follows.
49
59
60
+
### Root part
61
+
50
62
| Parameter | Description |
51
63
| :--- | :--- |
52
64
|**socket\_type**| Set this parameter to tcp(TCP socket) or unix(UNIX domain socket). |
53
65
|**socket\_path**| Set the IP address and port number for tcp, and UNIX domain socket file path for unix. |
54
-
|**cache\_seconds**| The cache duration in seconds to pass to nginx. However, if its value is 0, it will not use the cache.<br>See [Authentication Cache Control](proxy_cache.md) for details.|
55
-
|**use_etag**| Set to `true` to enable cache validation using `ETag` tags.<br>See [Authentication Cache Control](proxy_cache.md) for details.|
66
+
|**cache\_seconds**| Cache duration in seconds passed to nginx upon successful authentication. If the value is 0, cache will not be used. <br>See [Authentication Cache Control](proxy_cache.md) for details. |
67
+
|**neg\_cache\_seconds**| Cache duration in seconds passed to nginx upon failed authentication. If the value is 0, cache will not be used. <br>See [Authentication Cache Control](proxy_cache.md) for details. |
68
+
|**use\_etag**| Set to `true` if you want to validate the cache using the `ETag` tag. <br>See [Authentication Cache Control](proxy_cache.md) for details. |
69
+
|**use\_serialized\_auth**| Set to `true` if you want authentication to be serialized for each account. <br>When authentications for the same account conflict, the authentication will be blocked and delayed. |
56
70
|**auth\_realm**| HTTP realm string. |
57
71
|**host\_url**| The URL of the LDAP server connection address. The pass part is not used. |
58
72
|**start\_tls**| Set to 1 when using TLS STARTTLS. |
@@ -62,3 +76,17 @@ Each parameter of the configuration file is as follows.
62
76
|**bind\_dn**| This is the bind DN when performing LDAP bind processing. Rewrite `%s` as the remote user name and `%%` as `%`. |
63
77
|**uniq\_filter**| Only if this value is set, search with this value filter. If the search result is one DN, the authentication will be successful. |
64
78
|**timeout**| Communication timeout(unit: ms) with the LDAP server. |
79
+
80
+
### **\[response.ok\]** part
81
+
82
+
| Parameter | Description |
83
+
| :--- | :--- |
84
+
|**code**| The HTTP response status code indicates authorized requests. (Default value: `200`)<br>This value is used by the [auth request module]. Therefore, Malfunctions may be caused by the incorrect setting value. |
|**code**| The HTTP response status code indicates unauthenticated requests. (Default value: `401`)<br>This value is used by the [auth request module]. Therefore, Malfunctions may be caused by the incorrect setting value. |
**ngx\_ldap\_path2ldap\_auth** is a module for is a module for [nginx auth request module](http://nginx.org/en/docs/http/ngx_http_auth_request_module.html) that authenticates using an LDAP bind operation, and authorizes by file path and LDAP information.
4
+
**ngx\_ldap\_path2ldap\_auth** is a module for is a module for nginx [auth request module] that authenticates using an LDAP bind operation, and authorizes by file path and LDAP information.
4
5
5
6
## Error handling
6
7
@@ -19,15 +20,16 @@ start it via a process management system such as systemd.
19
20
20
21
## Configuration file format
21
22
22
-
See the [auth request module documentation](http://nginx.org/en/docs/http/ngx_http_auth_request_module.html) for how to configure nginx.
23
+
See the [auth request module] documentation for how to configure nginx.
23
24
24
25
The **ngx\_ldap\_path2ldap\_auth** configuration file is in TOML format, and the following is a sample configuration file.
Each parameter of the configuration file is as follows.
@@ -64,8 +82,10 @@ Each parameter of the configuration file is as follows.
64
82
| :--- | :--- |
65
83
|**socket\_type**| Set this parameter to tcp(TCP socket) or unix(UNIX domain socket). |
66
84
|**socket\_path**| Set the IP address and port number for tcp, and UNIX domain socket file path for unix. |
67
-
|**cache\_seconds**| The cache duration in seconds to pass to nginx. However, if its value is 0, it will not use the cache.<br>See [Authentication Cache Control](proxy_cache.md) for details.|
68
-
|**use_etag**| Set to `true` to enable cache validation using `ETag` tags.<br>See [Authentication Cache Control](proxy_cache.md) for details.|
85
+
|**cache\_seconds**| Cache duration in seconds passed to nginx upon successful authentication. If the value is 0, cache will not be used. <br>See [Authentication Cache Control](proxy_cache.md) for details. |
86
+
|**neg\_cache\_seconds**| Cache duration in seconds passed to nginx upon failed authentication. If the value is 0, cache will not be used. <br>See [Authentication Cache Control](proxy_cache.md) for details. |
87
+
|**use\_etag**| Set to `true` if you want to validate the cache using the `ETag` tag. <br>See [Authentication Cache Control](proxy_cache.md) for details. |
88
+
|**use\_serialized\_auth**| Set to `true` if you want authentication to be serialized for each account. <br>When authentications for the same account conflict, the authentication will be blocked and delayed. |
69
89
|**auth\_realm**| HTTP realm string. |
70
90
|**path\_header**| A HTTP header that sets the path used for authorization processing. The default value is `X-Authz-Path`. In the appropriate place of the nginx configuration file, use `proxy_set_header` directive to set the HTTP header. (Eg `proxy_set_header X-Authz-Path $request_uri;`) |
71
91
@@ -86,8 +106,36 @@ Each parameter of the configuration file is as follows.
86
106
87
107
| Parameter | Description |
88
108
| :--- | :--- |
89
-
|**path\_pattern**| A regular expression that extracts the authorization judgment string from the path of the header specified by **path_header**. The extracted string is used for the key in **path\_filter**. Use the `()` subexpression regular expression only once to specify the extraction location. |
109
+
|**path\_pattern**| A regular expression that extracts the authorization judgment string from the path of the header specified by **path\_header**. The extracted string is used for the key in **path\_filter**. Use the `()` subexpression regular expression only once to specify the extraction location. |
90
110
|**ban\_nomatch**| If true, authorization will fail if the **path\_pattern** regular expression does not match. (As a result, **nomatch\_filter** is disabled.) |
91
111
|**nomatch\_filter**| LDAP filter for authorization when the **path\_pattern** regular expression is not matched. **nomatch\_filter** results is processed in the same way as **uniq\_filter**. |
92
112
|**ban\_default**| If true, authorization will fail if the **path\_pattern** regular expression does not match. (As a result, **default\_filter** is disabled.) |
93
113
|**default\_filter**| LDAP filter for authorization rights when it matches the **path\_pattern** regular expression and is not specified in **path\_filter**. **default\_filter** results is processed in the same way as **uniq\_filter**. |
114
+
115
+
### **\[response.ok\]** part
116
+
117
+
| Parameter | Description |
118
+
| :--- | :--- |
119
+
|**code**| The HTTP response status code indicates authorized requests. (Default value: `200`)<br>This value is used by the [auth request module]. Therefore, Malfunctions may be caused by the incorrect setting value. |
|**code**| The HTTP response status code indicates unauthenticated requests. (Default value: `401`)<br>This value is used by the [auth request module]. Therefore, Malfunctions may be caused by the incorrect setting value. |
|**code**| The HTTP response status code indicates failed authorization requests. (Default value: `403`)<br>This value is used by the [auth request module]. Therefore, Malfunctions may be caused by the incorrect setting value. |
|**code**| The HTTP response status code indicates an unexpected HTTP header in **path\_header**. (Default value: `403`)<br>This value is used by the [auth request module]. Therefore, Malfunctions may be caused by the incorrect setting value. |
141
+
|**message**| The HTTP response message indicates an unexpected HTTP header in **path\_header**. (Default value: `"No path header"`) |
0 commit comments