Skip to content

Commit

Permalink
Docu
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Schneider committed Oct 28, 2021
1 parent 7c95a2d commit c6c78fb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ To access the HTTP status code of the `default` response use `backend_responses.
| `merge` | object or tuple | Deep-merges two or more of either objects or tuples. `null` arguments are ignored. A `null` attribute value in an object removes the previous attribute value. An attribute value with a different type than the current value is set as the new value. `merge()` with no parameters returns `null`. | `arg...` (object or tuple) | `merge(request.headers, { x-additional = "myval" })` |
| `beta_oauth_authorization_url` | string | Creates an OAuth2 authorization URL from a referenced [OAuth2 AC Block](#oauth2-ac-block-beta) or [OIDC Block](#oidc-block-beta). | `label` (string) | `beta_oauth_authorization_url("myOAuth2")` |
| `beta_oauth_verifier` | string | Creates a cryptographically random key as specified in RFC 7636, applicable for all verifier methods; e.g. to be set as a cookie and read into `verifier_value`. Multiple calls of this function in the same client request context return the same value. | | `beta_oauth_verifier()` |
| `relative_url` | string | Returns a relative URL from the absolute input URL `s`. The absolute input URL `s` must begin with `/`, `http://` or `https://`, otherwise an error is thrown. | s (string) | `relative_url("https://httpbin.org/anything")` |
| `relative_url` | string | Returns a relative URL by retaining `path`, `query` and `fragment` components. The input URL `s` must begin with `/<path>`, `//<authority>`, `http://` or `https://`, otherwise an error is thrown. | s (string) | `relative_url("https://httpbin.org/anything?query#fragment") // returns "/anything?query#fragment"` |
| `saml_sso_url` | string | Creates a SAML SingleSignOn URL (including the `SAMLRequest` parameter) from a referenced [SAML Block](#saml-block). | `label` (string) | `saml_sso_url("mySAML")` |
| `to_lower` | string | Converts a given string to lowercase. | `s` (string) | `to_lower(request.cookies.name)` |
| `to_upper` | string | Converts a given string to uppercase. | `s` (string) | `to_upper("CamelCase")` |
Expand Down
4 changes: 4 additions & 0 deletions eval/lib/url_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ func TestRelativeUrl(t *testing.T) {

// Valid
{"/abs", "/abs", ``},
{"//path", "/", ``},
{"///path", "/path", ``},
{"/abs:8080", "/abs:8080", ``},
{"https://abc.def:8443:9443", "/", ``},
{"http://", "/", ``},
Expand All @@ -80,6 +82,8 @@ func TestRelativeUrl(t *testing.T) {
{"https://abc.def:8443/path?q", "/path?q", ``},
{"https://abc.def:8443/path?q#f", "/path?q#f", ``},
{"https://user:pass@abc.def:8443/path?q#f", "/path?q#f", ``},
{"//user:pass@abc.def:8443/path?q#f", "/path?q#f", ``},
{"//abc.def:8443/path?q#f", "/path?q#f", ``},
} {
t.Run(tc.url, func(subT *testing.T) {
got, err := relativeUrlFunc.Call([]cty.Value{cty.StringVal(tc.url)})
Expand Down

0 comments on commit c6c78fb

Please sign in to comment.