diffend-monitor 0.2.28 → 0.2.30

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.
@@ -0,0 +1,59 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'json'
4
+
5
+ module Diffend
6
+ # Module responsible for fetching diffend verdict on local context
7
+ module RequestVerdict
8
+ class << self
9
+ # @param command [String] either install or update
10
+ # @param definition [Bundler::Definition] definition for your source
11
+ # @param config [OpenStruct] diffend config
12
+ def call(command, config, definition)
13
+ payload = Diffend::LocalContext.call(command, config.project_id, definition)
14
+
15
+ response = Diffend::Request.call(
16
+ build_request_object(command, config, payload)
17
+ )
18
+
19
+ JSON.parse(response.body)
20
+ rescue Bundler::GemNotFound
21
+ raise ::Diffend::Errors::DependenciesResolveException
22
+ rescue StandardError => e
23
+ Diffend::HandleErrors::Report.call(
24
+ exception: e,
25
+ payload: payload || {},
26
+ config: config,
27
+ message: :unhandled_exception,
28
+ report: true
29
+ )
30
+ end
31
+
32
+ # @param command [String] either install or update
33
+ # @param config [OpenStruct] diffend config
34
+ # @param payload [Hash]
35
+ #
36
+ # @return [Diffend::RequestObject]
37
+ def build_request_object(command, config, payload)
38
+ Diffend::RequestObject.new(
39
+ config: config,
40
+ url: commands_url(command, config.project_id),
41
+ payload: payload,
42
+ request_method: :post
43
+ )
44
+ end
45
+
46
+ # Provides diffend command endpoint url
47
+ #
48
+ # @param command [String] either install or update
49
+ # @param project_id [String] diffend project_id
50
+ #
51
+ # @return [String] diffend endpoint
52
+ def commands_url(command, project_id)
53
+ return ENV['DIFFEND_COMMAND_URL'] if ENV.key?('DIFFEND_COMMAND_URL')
54
+
55
+ "https://my.diffend.io/api/projects/#{project_id}/bundle/#{command}"
56
+ end
57
+ end
58
+ end
59
+ end
@@ -11,7 +11,7 @@ module Diffend
11
11
  # Initialize tracking
12
12
  def initialize
13
13
  @mutex = Mutex.new
14
- @config = fetch_config
14
+ @config = Diffend::Config.call
15
15
  end
16
16
 
17
17
  # Start tracking
@@ -50,15 +50,7 @@ module Diffend
50
50
 
51
51
  # Perform an exec request
52
52
  def exec_request
53
- Diffend::Voting.call(
54
- Diffend::Commands::EXEC,
55
- @config,
56
- Diffend::BuildBundlerDefinition.call(
57
- Diffend::Commands::EXEC,
58
- Bundler.default_gemfile,
59
- Bundler.default_lockfile
60
- )
61
- )
53
+ Diffend::Execute.call(Diffend::Commands::EXEC, @config)
62
54
  end
63
55
 
64
56
  # Perform a track request
@@ -82,17 +74,6 @@ module Diffend
82
74
  ).freeze
83
75
  end
84
76
 
85
- # Fetch diffend config file
86
- #
87
- # @return [OpenStruct, nil] configuration object
88
- #
89
- # @raise [Errors::MissingConfigurationFile] when no config file
90
- def fetch_config
91
- Config::Fetcher.call(
92
- File.expand_path('..', Bundler.bin_path)
93
- )
94
- end
95
-
96
77
  # @param project_id [String] diffend project_id
97
78
  # @param request_id [String]
98
79
  #
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Diffend
4
+ # Current version
5
+ VERSION = '0.2.30'
6
+ end
data/plugins.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'diffend'
3
+ require 'diffend/plugin'
4
4
 
5
- Diffend.register
5
+ Diffend::Plugin.register
@@ -3,7 +3,6 @@
3
3
  require 'byebug'
4
4
  require 'diffend'
5
5
 
6
-
7
6
  command = 'install'
8
7
  project_id = nil
9
8
 
@@ -12,4 +11,4 @@ lockfile = ARGV[1]
12
11
 
13
12
  definition = Diffend::BuildBundlerDefinition.call(command, gemfile lockfile)
14
13
 
15
- pp Diffend::Voting::Versions::Remote.payload(command, project_id, definition)
14
+ pp Diffend::LocalContext.call(command, project_id, definition)
metadata CHANGED
@@ -1,41 +1,40 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: diffend-monitor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.28
4
+ version: 0.2.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomasz Pajor
8
- - Maciej Mensfeld
9
- autorequire:
8
+ autorequire:
10
9
  bindir: bin
11
10
  cert_chain:
12
11
  - |
13
12
  -----BEGIN CERTIFICATE-----
14
- MIIEODCCAqCgAwIBAgIBATANBgkqhkiG9w0BAQsFADAjMSEwHwYDVQQDDBhtYWNp
15
- ZWovREM9bWVuc2ZlbGQvREM9cGwwHhcNMjAwODExMDkxNTM3WhcNMjEwODExMDkx
16
- NTM3WjAjMSEwHwYDVQQDDBhtYWNpZWovREM9bWVuc2ZlbGQvREM9cGwwggGiMA0G
17
- CSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQDCpXsCgmINb6lHBXXBdyrgsBPSxC4/
18
- 2H+weJ6L9CruTiv2+2/ZkQGtnLcDgrD14rdLIHK7t0o3EKYlDT5GhD/XUVhI15JE
19
- N7IqnPUgexe1fbZArwQ51afxz2AmPQN2BkB2oeQHXxnSWUGMhvcEZpfbxCCJH26w
20
- hS0Ccsma8yxA6hSlGVhFVDuCr7c2L1di6cK2CtIDpfDaWqnVNJEwBYHIxrCoWK5g
21
- sIGekVt/admS9gRhIMaIBg+Mshth5/DEyWO2QjteTodItlxfTctrfmiAl8X8T5JP
22
- VXeLp5SSOJ5JXE80nShMJp3RFnGw5fqjX/ffjtISYh78/By4xF3a25HdWH9+qO2Z
23
- tx0wSGc9/4gqNM0APQnjN/4YXrGZ4IeSjtE+OrrX07l0TiyikzSLFOkZCAp8oBJi
24
- Fhlosz8xQDJf7mhNxOaZziqASzp/hJTU/tuDKl5+ql2icnMv5iV/i6SlmvU29QNg
25
- LCV71pUv0pWzN+OZbHZKWepGhEQ3cG9MwvkCAwEAAaN3MHUwCQYDVR0TBAIwADAL
26
- BgNVHQ8EBAMCBLAwHQYDVR0OBBYEFImGed2AXS070ohfRidiCEhXEUN+MB0GA1Ud
27
- EQQWMBSBEm1hY2llakBtZW5zZmVsZC5wbDAdBgNVHRIEFjAUgRJtYWNpZWpAbWVu
28
- c2ZlbGQucGwwD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tGOMBTA==
37
36
  -----END CERTIFICATE-----
38
- date: 2020-09-19 00:00:00.000000000 Z
37
+ date: 2020-09-21 00:00:00.000000000 Z
39
38
  dependencies:
40
39
  - !ruby/object:Gem::Dependency
41
40
  name: bundler
@@ -65,7 +64,7 @@ dependencies:
65
64
  - - ">="
66
65
  - !ruby/object:Gem::Version
67
66
  version: '0'
68
- description:
67
+ description:
69
68
  email:
70
69
  - contact@diffend.io
71
70
  executables: []
@@ -95,28 +94,35 @@ files:
95
94
  - lib/diffend.rb
96
95
  - lib/diffend/build_bundler_definition.rb
97
96
  - lib/diffend/commands.rb
97
+ - lib/diffend/config.rb
98
98
  - lib/diffend/config/fetcher.rb
99
99
  - lib/diffend/config/file_finder.rb
100
100
  - lib/diffend/config/validator.rb
101
101
  - lib/diffend/errors.rb
102
+ - lib/diffend/execute.rb
102
103
  - lib/diffend/handle_errors/build_exception_payload.rb
103
104
  - lib/diffend/handle_errors/display_to_stdout.rb
104
105
  - lib/diffend/handle_errors/messages.rb
105
106
  - lib/diffend/handle_errors/report.rb
107
+ - lib/diffend/local_context.rb
108
+ - lib/diffend/local_context/diffend.rb
109
+ - lib/diffend/local_context/host.rb
110
+ - lib/diffend/local_context/packages.rb
111
+ - lib/diffend/local_context/platform.rb
106
112
  - lib/diffend/monitor.rb
113
+ - lib/diffend/plugin.rb
107
114
  - lib/diffend/request.rb
108
115
  - lib/diffend/request_object.rb
116
+ - lib/diffend/request_verdict.rb
109
117
  - lib/diffend/track.rb
110
- - lib/diffend/voting.rb
111
- - lib/diffend/voting/versions/local.rb
112
- - lib/diffend/voting/versions/remote.rb
118
+ - lib/diffend/version.rb
113
119
  - plugins.rb
114
120
  - scripts/generate_payload_for_file.rb
115
121
  homepage: https://diffend.io
116
122
  licenses:
117
123
  - Prosperity Public License
118
124
  metadata: {}
119
- post_install_message:
125
+ post_install_message:
120
126
  rdoc_options: []
121
127
  require_paths:
122
128
  - lib
@@ -124,15 +130,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
124
130
  requirements:
125
131
  - - ">="
126
132
  - !ruby/object:Gem::Version
127
- version: '0'
133
+ version: 2.5.0
128
134
  required_rubygems_version: !ruby/object:Gem::Requirement
129
135
  requirements:
130
136
  - - ">="
131
137
  - !ruby/object:Gem::Version
132
138
  version: '0'
133
139
  requirements: []
134
- rubygems_version: 3.1.4
135
- signing_key:
140
+ rubygems_version: 3.1.2
141
+ signing_key:
136
142
  specification_version: 4
137
- summary: OSS supply chain security and management platform.
143
+ summary: OSS supply chain security and management platform
138
144
  test_files: []
metadata.gz.sig CHANGED
Binary file
@@ -1,304 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Diffend
4
- module Voting
5
- # Module responsible for handling both local and remote gem versions
6
- module Versions
7
- # Module responsible for preparing current or current/new versions of gems
8
- class Local
9
- # Definition of a local path, if it matches it means that we are the source
10
- ME_PATH = '.'
11
- # Sources that we expect to match ourselves too
12
- ME_SOURCES = [
13
- Bundler::Source::Gemspec,
14
- Bundler::Source::Path
15
- ].freeze
16
- # List of dependency types
17
- DEPENDENCIES_TYPES = {
18
- direct: 0,
19
- dependency: 1
20
- }.freeze
21
- # List of sources types
22
- SOURCES_TYPES = {
23
- valid: 0,
24
- multiple_primary: 1
25
- }.freeze
26
- # List of gem sources types
27
- GEM_SOURCES_TYPES = {
28
- local: 0,
29
- gemfile_source: 1,
30
- gemfile_git: 2,
31
- gemfile_path: 3
32
- }.freeze
33
-
34
- class << self
35
- # @param command [String] either install or update
36
- # @param definition [Bundler::Definition] definition for your source
37
- def call(command, definition)
38
- Bundler.ui.silence { definition.resolve_remotely! }
39
-
40
- instance = new(definition)
41
-
42
- case command
43
- when Commands::INSTALL, Commands::EXEC then instance.build_install
44
- when Commands::UPDATE then instance.build_update
45
- else
46
- raise ArgumentError, "invalid command: #{command}"
47
- end
48
- end
49
- end
50
-
51
- # @param definition [Bundler::Definition] definition for your source
52
- #
53
- # @return [Hash] local dependencies
54
- def initialize(definition)
55
- @definition = definition
56
- @direct_dependencies = Hash[definition.dependencies.map { |val| [val.name, val] }]
57
- # Support case without Gemfile.lock
58
- @locked_specs = @definition.locked_gems ? @definition.locked_gems.specs : []
59
- end
60
-
61
- # Build install specification
62
- #
63
- # @return [Hash]
64
- def build_install
65
- hash = build_main
66
-
67
- @definition.specs.each do |spec|
68
- next if skip?(spec.source)
69
-
70
- locked_spec = @locked_specs.find { |s| s.name == spec.name }
71
-
72
- hash['dependencies'][spec.name] = {
73
- 'platform' => build_spec_platform(spec, locked_spec),
74
- 'source' => build_spec_source(spec),
75
- 'type' => build_dependency_type(spec.name),
76
- 'versions' => build_versions(spec, locked_spec)
77
- }
78
- end
79
-
80
- hash
81
- end
82
-
83
- # Build update specification
84
- #
85
- # @return [Hash]
86
- def build_update
87
- hash = build_main
88
-
89
- @definition.specs.each do |spec|
90
- next if skip?(spec.source)
91
-
92
- locked_spec = @locked_specs.find { |s| s.name == spec.name }
93
-
94
- hash['dependencies'][spec.name] = {
95
- 'platform' => build_spec_platform(spec, locked_spec),
96
- 'source' => build_spec_source(spec),
97
- 'type' => build_dependency_type(spec.name),
98
- 'versions' => build_versions(spec, locked_spec)
99
- }
100
- end
101
-
102
- hash
103
- end
104
-
105
- private
106
-
107
- # Build default specification
108
- #
109
- # @return [Hash]
110
- def build_main
111
- {
112
- 'dependencies' => {},
113
- 'sources' => build_sources,
114
- 'plugins' => {},
115
- 'platforms' => @definition.platforms.map(&:to_s)
116
- }
117
- end
118
-
119
- # Build gem versions
120
- #
121
- # @param spec [Bundler::StubSpecification, Bundler::LazySpecification, Gem::Specification]
122
- # @param locked_spec [Bundler::LazySpecification, Gem::Specification, NilClass]
123
- #
124
- # @return [Array<String>]
125
- def build_versions(spec, locked_spec = nil)
126
- if locked_spec && locked_spec.version.to_s != spec.version.to_s
127
- [locked_spec.version.to_s, spec.version.to_s]
128
- else
129
- [spec.version.to_s]
130
- end
131
- end
132
-
133
- # @param specs [Array] specs that are direct dependencies
134
- # @param name [String] spec name
135
- #
136
- # @return [Boolean] dependency type
137
- def build_dependency_type(name)
138
- if @direct_dependencies.key?(name)
139
- DEPENDENCIES_TYPES[:direct]
140
- else
141
- DEPENDENCIES_TYPES[:dependency]
142
- end
143
- end
144
-
145
- # Build gem platform
146
- #
147
- # @param spec [Bundler::StubSpecification, Bundler::LazySpecification, Gem::Specification]
148
- # @param locked_spec [Bundler::LazySpecification, Gem::Specification, NilClass]
149
- #
150
- # @return [String]
151
- def build_spec_platform(spec, locked_spec)
152
- parse_platform(
153
- spec.platform || locked_spec&.platform || spec.send(:generic_local_platform)
154
- )
155
- end
156
-
157
- # Parse gem platform
158
- #
159
- # @param platform [String, Gem::Platform]
160
- #
161
- # @return [String]
162
- def parse_platform(platform)
163
- case platform
164
- when String then platform
165
- when Gem::Platform then platform.os
166
- end
167
- end
168
-
169
- # Build gem source type
170
- #
171
- # @param source [Bundler::Source] gem source type
172
- #
173
- # @return [Integer] internal gem source type
174
- def build_spec_gem_source_type(source)
175
- case source
176
- when Bundler::Source::Metadata
177
- GEM_SOURCES_TYPES[:local]
178
- when Bundler::Source::Rubygems, Bundler::Source::Rubygems::Remote
179
- GEM_SOURCES_TYPES[:gemfile_source]
180
- when Bundler::Source::Git
181
- GEM_SOURCES_TYPES[:gemfile_git]
182
- when Bundler::Source::Path
183
- GEM_SOURCES_TYPES[:gemfile_path]
184
- else
185
- raise ArgumentError, "unknown source #{source.class}"
186
- end
187
- end
188
-
189
- # Build gem source
190
- #
191
- # @param spec [Bundler::StubSpecification, Bundler::LazySpecification, Gem::Specification]
192
- #
193
- # @return [Hash]
194
- def build_spec_source(spec)
195
- source = source_for_spec(spec)
196
-
197
- {
198
- 'type' => build_spec_gem_source_type(source),
199
- 'value' => source_name_from_source(source)
200
- }
201
- end
202
-
203
- # Figure out source for gem
204
- #
205
- # @param spec [Bundler::StubSpecification, Bundler::LazySpecification, Gem::Specification]
206
- #
207
- # @return [Bundler::Source] gem source type
208
- def source_for_spec(spec)
209
- return spec.remote if spec.remote
210
-
211
- case spec.source
212
- when Bundler::Source::Rubygems
213
- spec
214
- .source
215
- .send(:remote_specs)
216
- .search(Bundler::Dependency.new(spec.name, spec.version))
217
- .last
218
- .remote
219
- when Bundler::Source::Metadata, Bundler::Source::Git, Bundler::Source::Path
220
- spec.source
221
- else
222
- raise ArgumentError, "unknown source #{spec.source.class}"
223
- end
224
- end
225
-
226
- # Build gem source name
227
- #
228
- # @param source [Bundler::Source] gem source type
229
- #
230
- # @return [String]
231
- def source_name_from_source(source)
232
- case source
233
- when Bundler::Source::Metadata
234
- ''
235
- when Bundler::Source::Rubygems::Remote
236
- source_name(source.anonymized_uri)
237
- when Bundler::Source::Git
238
- source.instance_variable_get(:@safe_uri)
239
- when Bundler::Source::Path
240
- source.path
241
- else
242
- raise ArgumentError, "unknown source #{source.class}"
243
- end
244
- end
245
-
246
- # @param uri [Bundler::URI]
247
- #
248
- # @return [String]
249
- def source_name(uri)
250
- uri.to_s[0...-1]
251
- end
252
-
253
- # Build sources used in the Gemfile
254
- #
255
- # @return [Array<Hash>]
256
- def build_sources
257
- sources = @definition.send(:sources).rubygems_sources
258
- hash = {}
259
-
260
- sources.each do |source|
261
- type = build_source_type(source.remotes)
262
-
263
- source.remotes.each do |src|
264
- hash[source_name(src)] = type
265
- end
266
- end
267
-
268
- hash.map { |name, type| { 'name' => name, 'type' => type } }
269
- end
270
-
271
- # Build gem source type
272
- #
273
- # @param remotes [Array<Bundler::URI>]
274
- #
275
- # @return [Integer] internal source type
276
- def build_source_type(remotes)
277
- remotes.count > 1 ? SOURCES_TYPES[:multiple_primary] : SOURCES_TYPES[:valid]
278
- end
279
-
280
- # Checks if we should skip a source
281
- #
282
- # @param source [Bundler::Source] gem source type
283
- #
284
- # @return [Boolean] true if we should skip this source, false otherwise
285
- def skip?(source)
286
- return true if me?(source)
287
-
288
- false
289
- end
290
-
291
- # Checks if it's a self source, this happens for repositories that are a gem
292
- #
293
- # @param source [Bundler::Source] gem source type
294
- #
295
- # @return [Boolean] true if it's a self source, false otherwise
296
- def me?(source)
297
- return false unless ME_SOURCES.include?(source.class)
298
-
299
- source.path.to_s == ME_PATH
300
- end
301
- end
302
- end
303
- end
304
- end