contrast-agent-lib 0.1.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: '017349c168822728ffa9a1d6cb823c7f5ae8c58f155dd7271251882fb0fab155'
4
+ data.tar.gz: 0f03975b70fd85774a06214b979384dfe13c3fbb4515c87b687c27ba55a99d5b
5
+ SHA512:
6
+ metadata.gz: 01e99d555474e629b19527e40b446c13994575bcb5a6602d4fbf6b6c2d8cb65bd6b482a6127ede6564f49ed22952d918570a89a8170bbb60c3debb8a47bf7c9c
7
+ data.tar.gz: ad5f5bf289a8164d34c38803d46dfffe527a54376fc13b8d6b7f7aa2bfb0b189ed57eefe0970b45d80ff3fe7120cefe6eff95a07ac9b97eb02053dd0c83ebffd
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.0.0
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ # Copyright (c) 2022 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
2
+ # frozen_string_literal: true
3
+
4
+ source 'https://rubygems.org'
5
+
6
+ # Specify your gem's dependencies in contrast-agent-lib.gemspec
7
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,12 @@
1
+ Copyright: 2022 Contrast Security, Inc
2
+ Contact: support@contrastsecurity.com
3
+ License: Commercial
4
+
5
+ NOTICE: This Software and the patented inventions embodied within may only be
6
+ used as part of Contrast Security’s commercial offerings. Even though it is
7
+ made available through public repositories, use of this Software is subject to
8
+ the applicable End User Licensing Agreement found at
9
+ https://www.contrastsecurity.com/enduser-terms-0317a or as otherwise agreed
10
+ between Contrast Security and the End User. The Software may not be reverse
11
+ engineered, modified, repackaged, sold, redistributed or otherwise used in a
12
+ way not consistent with the End User License Agreement.
@@ -0,0 +1,37 @@
1
+ # Copyright (c) 2022 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
2
+ # frozen_string_literal: true
3
+
4
+ # Add the team as authors of the Gem
5
+ def self.add_authors spec
6
+ spec.authors = %w[
7
+ teodor.raychev@contrastsecurity.com
8
+ harold.mcginnis@contrastsecurity.com
9
+ kaloyan.kostadinov@contrastsecurity.com
10
+ chris.shepardson@contrastsecurity.com
11
+ stephen.rushe@contrastsecurity.com
12
+ ]
13
+ end
14
+
15
+ # Add dev dependencies
16
+ def self.add_development_dependencies spec
17
+ spec.add_development_dependency('ffi', '~> 1.15', '>= 1.15.5')
18
+ end
19
+
20
+ Gem::Specification.new do |spec|
21
+ spec.name = 'contrast-agent-lib'
22
+ spec.version = '0.1.0'
23
+ spec.summary = "This is the Ruby Interface for Rust Agent Library"
24
+ spec.description = "Gem including the interface for the Rust Agent Library, which will be used within the Ruby-Agent"
25
+ spec.email = %w[ruby@contrastsecurity.com]
26
+ spec.files = %w[lib/utils/os.rb lib/contrast-agent-lib.rb usage_files/libcontrast_c.dylib
27
+ usage_files/libcontrast_c.so scripts/build_gem.sh .ruby-version contrast-agent-lib.gemspec
28
+ Gemfile LICENSE.txt
29
+ ]
30
+ spec.require_paths = ['lib']
31
+ spec.homepage = 'https://www.contrastsecurity.com'
32
+ spec.license = 'CONTRAST SECURITY (see license file)'
33
+ spec.required_ruby_version = ['>= 2.7.0', '< 3.2.0']
34
+
35
+ add_authors(spec)
36
+ add_development_dependencies(spec)
37
+ end
@@ -0,0 +1,14 @@
1
+ # Copyright (c) 2022 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
2
+ # frozen_string_literal: true
3
+
4
+ require 'ffi'
5
+ require 'utils/os'
6
+
7
+ module ContrastAgentLib
8
+ include ContrastAgentLib::OS
9
+ LINUX_LIB = File.join(__dir__, '..', 'usage_files/libcontrast_c.so')
10
+ MAC_LIB = File.join(__dir__, '..', 'usage_files/libcontrast_c.dylib')
11
+ # Since we need two different extensions for each platform we
12
+ # need to detect the used OS before loading the dynamic library.
13
+ CONTRAST_C = ContrastAgentLib::OS.linux? ? LINUX_LIB : MAC_LIB
14
+ end
data/lib/utils/os.rb ADDED
@@ -0,0 +1,29 @@
1
+ # Copyright (c) 2022 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
2
+ # frozen_string_literal: true
3
+
4
+ module ContrastAgentLib
5
+ module OS
6
+ class << self
7
+ # Check current OS type
8
+ # returns true if check is correct or false if not
9
+ def windows?
10
+ return @_windows unless @_windows.nil?
11
+
12
+ @_windows = !(/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM).nil?
13
+ end
14
+
15
+ def mac?
16
+ @_mac = RUBY_PLATFORM.include? 'darwin' if @_mac.nil?
17
+ @_mac
18
+ end
19
+
20
+ def unix?
21
+ !windows?
22
+ end
23
+
24
+ def linux?
25
+ (unix? and !mac?)
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env bash
2
+
3
+ set -Eeuo pipefail
4
+ # Build Gem
5
+ gem build contrast-agent-lib.gemspec
6
+
7
+ # Push to RubyGems
8
+ # Preferably will be moved as pipeline step on tag only
9
+ #curl -u username https://rubygems.org/api/v1/api_key.yaml > ~/.gem/credentials;
10
+ #chmod 0600 ~/.gem/credentials
Binary file
Binary file
metadata ADDED
@@ -0,0 +1,80 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: contrast-agent-lib
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - teodor.raychev@contrastsecurity.com
8
+ - harold.mcginnis@contrastsecurity.com
9
+ - kaloyan.kostadinov@contrastsecurity.com
10
+ - chris.shepardson@contrastsecurity.com
11
+ - stephen.rushe@contrastsecurity.com
12
+ autorequire:
13
+ bindir: bin
14
+ cert_chain: []
15
+ date: 2022-05-16 00:00:00.000000000 Z
16
+ dependencies:
17
+ - !ruby/object:Gem::Dependency
18
+ name: ffi
19
+ requirement: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - "~>"
22
+ - !ruby/object:Gem::Version
23
+ version: '1.15'
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 1.15.5
27
+ type: :development
28
+ prerelease: false
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.15'
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: 1.15.5
37
+ description: Gem including the interface for the Rust Agent Library, which will be
38
+ used within the Ruby-Agent
39
+ email:
40
+ - ruby@contrastsecurity.com
41
+ executables: []
42
+ extensions: []
43
+ extra_rdoc_files: []
44
+ files:
45
+ - ".ruby-version"
46
+ - Gemfile
47
+ - LICENSE.txt
48
+ - contrast-agent-lib.gemspec
49
+ - lib/contrast-agent-lib.rb
50
+ - lib/utils/os.rb
51
+ - scripts/build_gem.sh
52
+ - usage_files/libcontrast_c.dylib
53
+ - usage_files/libcontrast_c.so
54
+ homepage: https://www.contrastsecurity.com
55
+ licenses:
56
+ - CONTRAST SECURITY (see license file)
57
+ metadata: {}
58
+ post_install_message:
59
+ rdoc_options: []
60
+ require_paths:
61
+ - lib
62
+ required_ruby_version: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ version: 2.7.0
67
+ - - "<"
68
+ - !ruby/object:Gem::Version
69
+ version: 3.2.0
70
+ required_rubygems_version: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ requirements: []
76
+ rubygems_version: 3.2.33
77
+ signing_key:
78
+ specification_version: 4
79
+ summary: This is the Ruby Interface for Rust Agent Library
80
+ test_files: []