ssrfs-up 0.0.13 → 0.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 65b5eb9f58b692e95c449880172276f8b749734d70e6152589d952df09be65e3
4
- data.tar.gz: 50ebf7be670a30131bb44a6359d216e66b153899bd7db89429cd9e15744457bd
3
+ metadata.gz: 79a89488772f10f51bacee766112aa17c601361a98ec04ef3fd881efbf416ba3
4
+ data.tar.gz: 0c35e3c62444e4b9331146c77ef6ce282ceeafcf9145e413b7dbcdf8365ae199
5
5
  SHA512:
6
- metadata.gz: f1ca68a924ad437d0ec6acad7a81060fb582928568dd32b32f7be336ea6777063637c9706041698f92f9499e9b9b3c2069fe6ba8c4ec539c6811a63f74124fa2
7
- data.tar.gz: 629ad3d4e3af052dc3f8c7f2c9117b2cb55086c5dc99e2c31eb4ba778e4ba67a6e2d49648c5c0619d873fd19005971b78fac2aa6bc21a59d6a19eaac8d800a5b
6
+ metadata.gz: '081d9147f84e5120a963d1f022347d5d6ab4c074420aad40e05e2be5725ff488a1df364fbb10c6e1c6374861cd96543edbcc0ce4993b88bb10b6d0bbe252fbf7'
7
+ data.tar.gz: d663b3859ca75bf3a762ca78ce85f3c286d17aa24c99cb6aa410d969996261addb3f411dbda78e22e25469c7f09eca9879b928fd71c7de3265598983e21380f6
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0-oas3-oas3-oas3
7
7
  Contact: jheath@chanzuckerberg.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.0.1
9
+ OpenAPI Generator version: 5.1.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0-oas3-oas3-oas3
7
7
  Contact: jheath@chanzuckerberg.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.0.1
9
+ OpenAPI Generator version: 5.1.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0-oas3-oas3-oas3
7
7
  Contact: jheath@chanzuckerberg.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.0.1
9
+ OpenAPI Generator version: 5.1.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0-oas3-oas3-oas3
7
7
  Contact: jheath@chanzuckerberg.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.0.1
9
+ OpenAPI Generator version: 5.1.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0-oas3-oas3-oas3
7
7
  Contact: jheath@chanzuckerberg.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.0.1
9
+ OpenAPI Generator version: 5.1.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0-oas3-oas3-oas3
7
7
  Contact: jheath@chanzuckerberg.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.0.1
9
+ OpenAPI Generator version: 5.1.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0-oas3-oas3-oas3
7
7
  Contact: jheath@chanzuckerberg.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.0.1
9
+ OpenAPI Generator version: 5.1.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0-oas3-oas3-oas3
7
7
  Contact: jheath@chanzuckerberg.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.0.1
9
+ OpenAPI Generator version: 5.1.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0-oas3-oas3-oas3
7
7
  Contact: jheath@chanzuckerberg.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.0.1
9
+ OpenAPI Generator version: 5.1.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0-oas3-oas3-oas3
7
7
  Contact: jheath@chanzuckerberg.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.0.1
9
+ OpenAPI Generator version: 5.1.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0-oas3-oas3-oas3
7
7
  Contact: jheath@chanzuckerberg.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.0.1
9
+ OpenAPI Generator version: 5.1.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0-oas3-oas3-oas3
7
7
  Contact: jheath@chanzuckerberg.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.0.1
9
+ OpenAPI Generator version: 5.1.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0-oas3-oas3-oas3
7
7
  Contact: jheath@chanzuckerberg.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.0.1
9
+ OpenAPI Generator version: 5.1.0
10
10
 
11
11
  =end
12
12
 
data/lib/ssrfs-up.rb CHANGED
@@ -2,6 +2,7 @@ require 'aws-sdk-lambda'
2
2
  require 'uri'
3
3
  require 'ssrfs-up/version'
4
4
  require 'ostruct'
5
+ require 'honeycomb-beeline'
5
6
 
6
7
  # Common files
7
8
  require 'openapi_client/lib/openapi_client/api_client'
@@ -20,12 +21,23 @@ require 'openapi_client/lib/openapi_client/models/response_success'
20
21
 
21
22
  # APIs
22
23
  require 'openapi_client/lib/openapi_client/api/default_api'
23
-
24
24
  ##
25
25
  # This module contains the AWS lambda client and helper methods to easily
26
26
  # make requests to it. All methods take a hostname or URI and a hash or options
27
27
  # for the request.
28
28
  module SSRFsUp
29
+ Honeycomb.configure do |config|
30
+ config.write_key = '0dc36d095b2c3aefb237dd04e13f580c'
31
+ config.dataset = 'ssrfs-up'
32
+ config.service_name = 'ssrfs-up-ruby-client'
33
+ config.presend_hook do |fields|
34
+ fields['aws.session_token'] = '[REDACTED]' if fields.has_key? 'aws.session_token'
35
+ fields['aws.access_key_id'] = '[REDACTED]' if fields.has_key? 'aws.access_key_id'
36
+ fields['aws.params.function_name'] = '[REDACTED]' if fields.has_key? 'aws.params.function_name'
37
+ fields['aws.params.payload'] = '[REDACTED]' if fields.has_key? 'aws.params.payload'
38
+ end
39
+ end
40
+
29
41
  class Configuration
30
42
  attr_accessor :func_name, :invoke_type, :log_type, :region, :test
31
43
 
@@ -96,9 +108,9 @@ module SSRFsUp
96
108
  # to be a hostname only.
97
109
  def parseAsUri(uri = '')
98
110
  uri = uri.to_s
99
- splits = uri.split '/'
100
- opts = { 'host' => splits[0] }
111
+ opts = { 'host' => uri.split('/')[0].split('?')[0].split('#')[0] }
101
112
  u = URI(uri)
113
+
102
114
  # if the scheme was present, we can parse most of the options from the URI.
103
115
  # otherwise, we can assume the URI was an actual hostname
104
116
  unless u.scheme.nil?
@@ -135,14 +147,26 @@ module SSRFsUp
135
147
  # related errors so developers should assume the data they receive back is straight
136
148
  # from the server they are speaking to.
137
149
  def invoke(host = nil, opts = {})
138
- opts = opts.merge(parseAsUri(host))
139
- resp = client.invoke({
140
- function_name: configuration.func_name,
141
- invocation_type: configuration.invoke_type,
142
- log_type: configuration.log_type,
143
- payload: payload(opts)
144
- })
145
-
150
+ resp = if !configuration.test
151
+ Honeycomb.start_span(name: 'invoke') do |span|
152
+ span.add_field('host', host)
153
+ opts = opts.merge(parseAsUri(host))
154
+ opts = opts.merge({ 'headers' => { 'X-Honeycomb-Trace' => span.to_trace_header } })
155
+ client.invoke({
156
+ function_name: configuration.func_name,
157
+ invocation_type: configuration.invoke_type,
158
+ log_type: configuration.log_type,
159
+ payload: payload(opts)
160
+ })
161
+ end
162
+ else
163
+ client.invoke({
164
+ function_name: configuration.func_name,
165
+ invocation_type: configuration.invoke_type,
166
+ log_type: configuration.log_type,
167
+ payload: payload(opts)
168
+ })
169
+ end
146
170
  if resp['status_code'] == 200
147
171
  OpenStruct.new(JSON.parse(resp&.payload&.string))
148
172
  else
@@ -1,3 +1,3 @@
1
1
  module SSRFsUp
2
- VERSION = '0.0.13'.freeze
2
+ VERSION = '0.0.14'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ssrfs-up
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jake Heath
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-18 00:00:00.000000000 Z
11
+ date: 2021-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-lambda
@@ -30,6 +30,26 @@ dependencies:
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
32
  version: '1'
33
+ - !ruby/object:Gem::Dependency
34
+ name: libhoney
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '1.18'
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: 1.18.0
43
+ type: :runtime
44
+ prerelease: false
45
+ version_requirements: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - "~>"
48
+ - !ruby/object:Gem::Version
49
+ version: '1.18'
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: 1.18.0
33
53
  - !ruby/object:Gem::Dependency
34
54
  name: typhoeus
35
55
  requirement: !ruby/object:Gem::Requirement
@@ -50,6 +70,26 @@ dependencies:
50
70
  - - ">="
51
71
  - !ruby/object:Gem::Version
52
72
  version: 1.0.1
73
+ - !ruby/object:Gem::Dependency
74
+ name: honeycomb-beeline
75
+ requirement: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - "~>"
78
+ - !ruby/object:Gem::Version
79
+ version: '2.4'
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: 2.4.0
83
+ type: :runtime
84
+ prerelease: false
85
+ version_requirements: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '2.4'
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ version: 2.4.0
53
93
  - !ruby/object:Gem::Dependency
54
94
  name: bundler
55
95
  requirement: !ruby/object:Gem::Requirement