git.iko.soy/typeable/oauth2-proxy
on master help sign in
Clarify what rewriteTarget means for a file: upstream
16f032bIan Roberts
docs/docs/configuration/alpha_config.md+1−1
@@ -524,7 +524,7 @@ Requests will be proxied to this upstream if the path matches the request path.
524| ----- | ---- | ----------- |
524| ----- | ---- | ----------- |
525| `id` | _string_ | ID should be a unique identifier for the upstream.<br/>This value is required for all upstreams. |
525| `id` | _string_ | ID should be a unique identifier for the upstream.<br/>This value is required for all upstreams. |
526| `path` | _string_ | Path is used to map requests to the upstream server.<br/>The closest match will take precedence and all Paths must be unique.<br/>Path can also take a pattern when used with RewriteTarget.<br/>Path segments can be captured and matched using regular experessions.<br/>Eg:<br/>- `^/foo$`: Match only the explicit path `/foo`<br/>- `^/bar/$`: Match any path prefixed with `/bar/`<br/>- `^/baz/(.*)$`: Match any path prefixed with `/baz` and capture the remaining path for use with RewriteTarget |
526| `path` | _string_ | Path is used to map requests to the upstream server.<br/>The closest match will take precedence and all Paths must be unique.<br/>Path can also take a pattern when used with RewriteTarget.<br/>Path segments can be captured and matched using regular experessions.<br/>Eg:<br/>- `^/foo$`: Match only the explicit path `/foo`<br/>- `^/bar/$`: Match any path prefixed with `/bar/`<br/>- `^/baz/(.*)$`: Match any path prefixed with `/baz` and capture the remaining path for use with RewriteTarget |
527−| `rewriteTarget` | _string_ | RewriteTarget allows users to rewrite the request path before it is sent to<br/>the upstream server.<br/>Use the Path to capture segments for reuse within the rewrite target.<br/>Eg: With a Path of `^/baz/(.*)`, a RewriteTarget of `/foo/$1` would rewrite<br/>the request `/baz/abc/123` to `/foo/abc/123` before proxying to the<br/>upstream server. |
527+| `rewriteTarget` | _string_ | RewriteTarget allows users to rewrite the request path before it is sent to<br/>the upstream server (for an HTTP/HTTPS upstream) or mapped to the filesystem<br/>(for a `file:` upstream).<br/>Use the Path to capture segments for reuse within the rewrite target.<br/>Eg: With a Path of `^/baz/(.*)`, a RewriteTarget of `/foo/$1` would rewrite<br/>the request `/baz/abc/123` to `/foo/abc/123` before proxying to the<br/>upstream server. Or if the upstream were `file:///app`, a request for<br/>`/baz/info.html` would return the contents of the file `/app/foo/info.html`. |
528| `uri` | _string_ | The URI of the upstream server. This may be an HTTP(S) server of a File<br/>based URL. It may include a path, in which case all requests will be served<br/>under that path.<br/>Eg:<br/>- http://localhost:8080<br/>- https://service.localhost<br/>- https://service.localhost/path<br/>- file://host/path<br/>If the URI's path is "/base" and the incoming request was for "/dir",<br/>the upstream request will be for "/base/dir". |
528| `uri` | _string_ | The URI of the upstream server. This may be an HTTP(S) server of a File<br/>based URL. It may include a path, in which case all requests will be served<br/>under that path.<br/>Eg:<br/>- http://localhost:8080<br/>- https://service.localhost<br/>- https://service.localhost/path<br/>- file://host/path<br/>If the URI's path is "/base" and the incoming request was for "/dir",<br/>the upstream request will be for "/base/dir". |
529| `insecureSkipTLSVerify` | _bool_ | InsecureSkipTLSVerify will skip TLS verification of upstream HTTPS hosts.<br/>This option is insecure and will allow potential Man-In-The-Middle attacks<br/>between OAuth2 Proxy and the upstream server.<br/>Defaults to false. |
529| `insecureSkipTLSVerify` | _bool_ | InsecureSkipTLSVerify will skip TLS verification of upstream HTTPS hosts.<br/>This option is insecure and will allow potential Man-In-The-Middle attacks<br/>between OAuth2 Proxy and the upstream server.<br/>Defaults to false. |
530| `static` | _bool_ | Static will make all requests to this upstream have a static response.<br/>The response will have a body of "Authenticated" and a response code<br/>matching StaticCode.<br/>If StaticCode is not set, the response will return a 200 response. |
530| `static` | _bool_ | Static will make all requests to this upstream have a static response.<br/>The response will have a body of "Authenticated" and a response code<br/>matching StaticCode.<br/>If StaticCode is not set, the response will return a 200 response. |
pkg/apis/options/upstreams.go+4−2
@@ -39,11 +39,13 @@ type Upstream struct {
39 Path string `json:"path,omitempty"`
39 Path string `json:"path,omitempty"`
40
40
41 // RewriteTarget allows users to rewrite the request path before it is sent to
41 // RewriteTarget allows users to rewrite the request path before it is sent to
42− // the upstream server.
42+ // the upstream server (for an HTTP/HTTPS upstream) or mapped to the filesystem
43+ // (for a `file:` upstream).
43 // Use the Path to capture segments for reuse within the rewrite target.
44 // Use the Path to capture segments for reuse within the rewrite target.
44 // Eg: With a Path of `^/baz/(.*)`, a RewriteTarget of `/foo/$1` would rewrite
45 // Eg: With a Path of `^/baz/(.*)`, a RewriteTarget of `/foo/$1` would rewrite
45 // the request `/baz/abc/123` to `/foo/abc/123` before proxying to the
46 // the request `/baz/abc/123` to `/foo/abc/123` before proxying to the
46− // upstream server.
47+ // upstream server. Or if the upstream were `file:///app`, a request for
48+ // `/baz/info.html` would return the contents of the file `/app/foo/info.html`.
47 RewriteTarget string `json:"rewriteTarget,omitempty"`
49 RewriteTarget string `json:"rewriteTarget,omitempty"`
48
50
49 // The URI of the upstream server. This may be an HTTP(S) server of a File
51 // The URI of the upstream server. This may be an HTTP(S) server of a File