Skip to content

Commit

Permalink
Update mock files after fixes in httptest2 > 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jmaspons committed Apr 26, 2024
1 parent 2baf223 commit dc13a02
Show file tree
Hide file tree
Showing 38 changed files with 60 additions and 289 deletions.
2 changes: 1 addition & 1 deletion inst/httptest2/redact.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function(response) {
# simplify = FALSE
response <- httptest2::redact_headers(
response,
headers = c("x-request-id", "date", "Authorization", "x-amz-id-2", "x-amz-request-id")
headers = c("x-request-id", "date", "x-amz-id-2", "x-amz-request-id")
)

return(response)
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
300706
357503
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4348975122
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4348975121

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4305223441
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4306500960

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
structure(list(method = "GET", url = "https://openstreetmap-gps-traces.s3.dualstack.eu-west-1.amazonaws.com/0j780j5aldkjjd07uk4jbg3lco3t?response-content-disposition=attachment%3B%20filename%3D%223458743.gpx%22%3B%20filename%2A%3DUTF-8%27%273458743.gpx&response-content-type=application%2Fgpx%2Bxml&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIASQUXHPE7AMJQRFOS%2F20240425%2Feu-west-1%2Fs3%2Faws4_request&X-Amz-Date=20240425T084725Z&X-Amz-Expires=300&X-Amz-SignedHeaders=host&X-Amz-Signature=f3492c3e7af80ec0d26ee2910ec883457cbb0aafc7eb5531874c2299a4a9821f",
status_code = 200L, headers = structure(list(`x-amz-id-2` = "REDACTED",
`x-amz-request-id` = "REDACTED", Date = "REDACTED", `x-amz-replication-status` = "COMPLETED",
`Last-Modified` = "Wed, 02 Mar 2022 22:41:40 GMT", ETag = "\"05a29542ae0f0181b1187b68a2b98535\"",
`Cache-Control` = "public, max-age=31536000, immutable",
structure(list(method = "GET", url = "https://openstreetmap-gps-traces.s3.dualstack.eu-west-1.amazonaws.com/0j780j5aldkjjd07uk4jbg3lco3t?response-content-disposition=attachment%3B%20filename%3D%223458743.gpx%22%3B%20filename%2A%3DUTF-8%27%273458743.gpx&response-content-type=application%2Fgpx%2Bxml&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIASQUXHPE7AMJQRFOS%2F20240426%2Feu-west-1%2Fs3%2Faws4_request&X-Amz-Date=20240426T102812Z&X-Amz-Expires=300&X-Amz-SignedHeaders=host&X-Amz-Signature=aa140fc459ac049d9a22cd0940415e03f005a272de358ebf6e013e68b3fb1ea4",
status_code = 200L, headers = structure(list(`x-amz-id-2` = "8K25LubAjNTPqBq0P6UnjGK9h9WzTp68joIhBescwAHL0vvcBzbnYDF1uQEw2g4WsJLuw44gbsQ=",
`x-amz-request-id` = "AZ9FE54K9F9B77BN", Date = "REDACTED",
`x-amz-replication-status` = "COMPLETED", `Last-Modified` = "Wed, 02 Mar 2022 22:41:40 GMT",
ETag = "\"05a29542ae0f0181b1187b68a2b98535\"", `Cache-Control` = "public, max-age=31536000, immutable",
`Content-Disposition` = "attachment; filename=\"3458743.gpx\"; filename*=UTF-8''3458743.gpx",
`x-amz-version-id` = "lS5bf7hjJ8dTACfw8_yLzrg7TnQ4rDKC",
`Accept-Ranges` = "bytes", `Content-Type` = "application/gpx+xml",
Expand Down Expand Up @@ -6259,26 +6259,4 @@ structure(list(method = "GET", url = "https://openstreetmap-gps-traces.s3.dualst
0x72, 0x6b, 0x70, 0x74, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20,
0x3c, 0x2f, 0x74, 0x72, 0x6b, 0x73, 0x65, 0x67, 0x3e, 0x0a,
0x20, 0x20, 0x3c, 0x2f, 0x74, 0x72, 0x6b, 0x3e, 0x0a, 0x3c,
0x2f, 0x67, 0x70, 0x78, 0x3e)), request = structure(list(
url = "https://api.openstreetmap.org/api/0.6/gpx/3458743/data",
method = "GET", headers = structure(list(Authorization = "Bearer kcV3MYRNTBJOt-1Tqd5Yfv-jaAUEbDcbmynR0TdZ5ek"), redact = "Authorization"),
body = NULL, fields = list(), options = list(useragent = "osmapiR (https://github.com/jmaspons/osmapiR)"),
policies = list(retry_max_tries = 10L, error_body = function (resp)
{
out <- switch(httr2::resp_content_type(resp), `text/plain` = httr2::resp_body_string(resp),
`text/html` = parse_html_error(resp), httr2::resp_headers(resp)$status)
return(out)
}, auth_oauth = list(cache = list(get = function ()
env_get(the$token_cache, key, default = NULL), set = function (token)
env_poke(the$token_cache, key, token), clear = function ()
env_unbind(the$token_cache, key)), flow = "oauth_flow_auth_code",
flow_params = list(client = structure(list(name = "osmapiR",
id = "cxMGJjSNnEGiKHAdp0pGq54XtQPTSyuTOu-nVJ4P6FE",
secret = structure("L9o3QNmMC-rn8Hl6qcJrCpkty2QUCJPAWoiB2lIwawoZup_gfImaV9iUfGSZIeZSLP_s89qiFrbAH_Y", class = "httr2_obfuscated"),
key = NULL, token_url = "https://www.openstreetmap.org/oauth2/token",
auth = "oauth_client_req_auth_header", auth_params = list()), class = "httr2_oauth_client"),
auth_url = "https://www.openstreetmap.org/oauth2/authorize",
scope = "read_prefs write_prefs write_api read_gpx write_gpx write_notes",
pkce = TRUE, auth_params = list(), token_params = list(),
redirect_uri = "http://127.0.0.1:14149")))), class = "httr2_request"),
cache = new.env(parent = emptyenv())), class = "httr2_response")
0x2f, 0x67, 0x70, 0x78, 0x3e)), cache = new.env(parent = emptyenv())), class = "httr2_response")
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ structure(list(method = "GET", url = "osm.org/api/0.6/gpx/3458743/data.gpx",
`content-language` = "en", `x-request-id` = "REDACTED",
`content-disposition` = "attachment; filename=\"3458743.gpx\"; filename*=UTF-8''3458743.gpx",
`x-download-options` = "noopen", `content-transfer-encoding` = "binary",
`x-runtime` = "0.252595", `x-frame-options` = "sameorigin",
`x-runtime` = "0.250427", `x-frame-options` = "sameorigin",
`x-content-type-options` = "nosniff", `content-security-policy` = "default-src 'self'; child-src 'self'; connect-src 'self' matomo.openstreetmap.org; font-src 'none'; form-action 'self'; frame-ancestors 'self'; frame-src 'self'; img-src 'self' data: www.gravatar.com *.wp.com tile.openstreetmap.org *.tile.openstreetmap.org *.tile.thunderforest.com tile.tracestrack.com *.openstreetmap.fr matomo.openstreetmap.org https://openstreetmap-user-avatars.s3.dualstack.eu-west-1.amazonaws.com https://openstreetmap-gps-images.s3.dualstack.eu-west-1.amazonaws.com; manifest-src 'self'; media-src 'none'; object-src 'self'; script-src 'self' matomo.openstreetmap.org; style-src 'self'; worker-src 'none'",
date = "REDACTED", `x-powered-by` = "Phusion Passenger(R) 6.0.20",
`strict-transport-security` = "max-age=31536000; includeSubDomains; preload",
Expand Down Expand Up @@ -6263,26 +6263,4 @@ structure(list(method = "GET", url = "osm.org/api/0.6/gpx/3458743/data.gpx",
0x72, 0x6b, 0x70, 0x74, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20,
0x3c, 0x2f, 0x74, 0x72, 0x6b, 0x73, 0x65, 0x67, 0x3e, 0x0a,
0x20, 0x20, 0x3c, 0x2f, 0x74, 0x72, 0x6b, 0x3e, 0x0a, 0x3c,
0x2f, 0x67, 0x70, 0x78, 0x3e)), request = structure(list(
url = "https://api.openstreetmap.org/api/0.6/gpx/3458743/data.gpx",
method = "GET", headers = structure(list(Authorization = "Bearer kcV3MYRNTBJOt-1Tqd5Yfv-jaAUEbDcbmynR0TdZ5ek"), redact = "Authorization"),
body = NULL, fields = list(), options = list(useragent = "osmapiR (https://github.com/jmaspons/osmapiR)"),
policies = list(retry_max_tries = 10L, error_body = function (resp)
{
out <- switch(httr2::resp_content_type(resp), `text/plain` = httr2::resp_body_string(resp),
`text/html` = parse_html_error(resp), httr2::resp_headers(resp)$status)
return(out)
}, auth_oauth = list(cache = list(get = function ()
env_get(the$token_cache, key, default = NULL), set = function (token)
env_poke(the$token_cache, key, token), clear = function ()
env_unbind(the$token_cache, key)), flow = "oauth_flow_auth_code",
flow_params = list(client = structure(list(name = "osmapiR",
id = "cxMGJjSNnEGiKHAdp0pGq54XtQPTSyuTOu-nVJ4P6FE",
secret = structure("L9o3QNmMC-rn8Hl6qcJrCpkty2QUCJPAWoiB2lIwawoZup_gfImaV9iUfGSZIeZSLP_s89qiFrbAH_Y", class = "httr2_obfuscated"),
key = NULL, token_url = "https://www.openstreetmap.org/oauth2/token",
auth = "oauth_client_req_auth_header", auth_params = list()), class = "httr2_oauth_client"),
auth_url = "https://www.openstreetmap.org/oauth2/authorize",
scope = "read_prefs write_prefs write_api read_gpx write_gpx write_notes",
pkce = TRUE, auth_params = list(), token_params = list(),
redirect_uri = "http://127.0.0.1:44392")))), class = "httr2_request"),
cache = new.env(parent = emptyenv())), class = "httr2_response")
0x2f, 0x67, 0x70, 0x78, 0x3e)), cache = new.env(parent = emptyenv())), class = "httr2_response")
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
357506
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<osm version="0.6" generator="CGImap 0.10.0.2404251208 (012345 ******.openstreetmap.org)" copyright="OpenStreetMap and contributors" attribution="http://www.openstreetmap.org/copyright" license="http://opendatacommons.org/licenses/odbl/1-0/">
<node id="4348975125" visible="true" version="1" changeset="357506" timestamp="2024-04-26T09:59:08Z" user="jmaspons" uid="12141" lat="0.0000000" lon="0.0000000">
<tag k="name" v="Test redaction."/>
</node>
</osm>
Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4348975125

This file was deleted.

Empty file.

This file was deleted.

Empty file.

This file was deleted.

Loading

0 comments on commit dc13a02

Please sign in to comment.