asherah 0.9.1 → 0.10.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.
data/asherah.gemspec DELETED
@@ -1,39 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'lib/asherah/version'
4
-
5
- Gem::Specification.new do |spec|
6
- spec.name = 'asherah'
7
- spec.version = Asherah::VERSION
8
- spec.authors = ['GoDaddy']
9
- spec.email = ['oss@godaddy.com']
10
-
11
- spec.summary = 'Application Layer Encryption SDK'
12
- spec.description = <<~DESCRIPTION
13
- Asherah is an application-layer encryption SDK that provides advanced
14
- encryption features and defense in depth against compromise.
15
- DESCRIPTION
16
-
17
- spec.homepage = 'https://github.com/godaddy/asherah-ruby'
18
- spec.license = 'MIT'
19
- spec.required_ruby_version = '>= 2.7.0'
20
-
21
- spec.metadata['homepage_uri'] = spec.homepage
22
- spec.metadata['source_code_uri'] = 'https://github.com/godaddy/asherah-ruby'
23
- spec.metadata['changelog_uri'] = 'https://github.com/godaddy/asherah-ruby/blob/main/CHANGELOG.md'
24
- spec.metadata['rubygems_mfa_required'] = 'true'
25
-
26
- # Specify which files should be added to the gem when it is released.
27
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
28
- spec.files = Dir.chdir(File.expand_path(__dir__)) do
29
- `git ls-files -z`.split("\x0").reject do |f|
30
- (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features|tasks)/|\.(?:git|travis|circleci)|appveyor)})
31
- end
32
- end
33
- spec.bindir = 'exe'
34
- spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
35
- spec.require_paths = ['lib']
36
- spec.extensions = ['ext/asherah/extconf.rb']
37
-
38
- spec.add_dependency 'cobhan', '~> 0.2.0'
39
- end
@@ -1,5 +0,0 @@
1
- version: v0.6.90
2
- libasherah-arm64.so: 2b9c3adae88f6b407d643bb0ad6342fb55ec259d5f91861006dceea67d3d41fb
3
- libasherah-x64.so: 9c230df5bd722214b3216da1e4ab61e559c9afd10b3d9836e6adf600c69dcf4a
4
- libasherah-arm64.dylib: eb8a19e797ef1e1e2b3e06aeb6117074f671d8a60b6c92d42ad73c04edbc731b
5
- libasherah-x64.dylib: 804d68949d0be5a2531838127d5767ff8dcd99fd30d9c45155a16baa17f20f48
@@ -1,64 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'open-uri'
4
- require 'fileutils'
5
- require 'digest'
6
- require 'yaml'
7
- require 'cobhan'
8
-
9
- # Downloads native file and verifies checksum
10
- class NativeFile
11
- LIB_NAME = 'libasherah'
12
- ROOT_DIR = File.expand_path('../../', __dir__)
13
- CHECKSUMS_FILE = File.expand_path('checksums.yml', __dir__)
14
- CHECKSUMS = YAML.load_file(CHECKSUMS_FILE)
15
- VERSION = CHECKSUMS.fetch('version')
16
- RETRIES = 3
17
- RETRY_DELAY = 1
18
-
19
- class << self
20
- def download(
21
- file_name: Class.new.extend(Cobhan).library_file_name(LIB_NAME),
22
- dir: File.join(ROOT_DIR, 'lib/asherah/native')
23
- )
24
- file_path = File.join(dir, file_name)
25
- if File.exist?(file_path)
26
- puts "#{file_path} already exists ... skipping download"
27
- return
28
- end
29
-
30
- checksum = CHECKSUMS.fetch(file_name) do
31
- abort "Unsupported platform #{RUBY_PLATFORM}"
32
- end
33
-
34
- content = download_content(file_name)
35
-
36
- sha256 = Digest::SHA256.hexdigest(content)
37
- abort "Could not verify checksum of #{file_name}" if sha256 != checksum
38
-
39
- FileUtils.mkdir_p(dir)
40
- File.binwrite(file_path, content)
41
- end
42
-
43
- private
44
-
45
- def download_content(file_name)
46
- tries = 0
47
-
48
- begin
49
- tries += 1
50
- url = "https://github.com/godaddy/asherah-ffi/releases/download/#{VERSION}/#{file_name}"
51
- puts "Downloading #{url}"
52
- URI.parse(url).open.read
53
- rescue Net::OpenTimeout, Net::ReadTimeout => e
54
- if tries <= RETRIES
55
- puts "Got #{e.class}... retrying in #{RETRY_DELAY} seconds"
56
- sleep RETRY_DELAY
57
- retry
58
- else
59
- raise e
60
- end
61
- end
62
- end
63
- end
64
- end