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 +4 -4
- data/lib/openapi_client/lib/openapi_client.rb +1 -1
- data/lib/openapi_client/lib/openapi_client/api/default_api.rb +1 -1
- data/lib/openapi_client/lib/openapi_client/api_client.rb +1 -1
- data/lib/openapi_client/lib/openapi_client/api_error.rb +1 -1
- data/lib/openapi_client/lib/openapi_client/configuration.rb +1 -1
- data/lib/openapi_client/lib/openapi_client/models/content_type.rb +1 -1
- data/lib/openapi_client/lib/openapi_client/models/method.rb +1 -1
- data/lib/openapi_client/lib/openapi_client/models/redirect.rb +1 -1
- data/lib/openapi_client/lib/openapi_client/models/request.rb +1 -1
- data/lib/openapi_client/lib/openapi_client/models/response.rb +1 -1
- data/lib/openapi_client/lib/openapi_client/models/response_error.rb +1 -1
- data/lib/openapi_client/lib/openapi_client/models/response_success.rb +1 -1
- data/lib/openapi_client/lib/openapi_client/version.rb +1 -1
- data/lib/ssrfs-up.rb +35 -11
- data/lib/ssrfs-up/version.rb +1 -1
- metadata +42 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 79a89488772f10f51bacee766112aa17c601361a98ec04ef3fd881efbf416ba3
|
4
|
+
data.tar.gz: 0c35e3c62444e4b9331146c77ef6ce282ceeafcf9145e413b7dbcdf8365ae199
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '081d9147f84e5120a963d1f022347d5d6ab4c074420aad40e05e2be5725ff488a1df364fbb10c6e1c6374861cd96543edbcc0ce4993b88bb10b6d0bbe252fbf7'
|
7
|
+
data.tar.gz: d663b3859ca75bf3a762ca78ce85f3c286d17aa24c99cb6aa410d969996261addb3f411dbda78e22e25469c7f09eca9879b928fd71c7de3265598983e21380f6
|
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
|
-
|
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
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
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
|
data/lib/ssrfs-up/version.rb
CHANGED
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.
|
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-
|
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
|