asherah 0.5.2-x86_64-darwin → 0.7.0-x86_64-darwin
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/.env.secrets.example +9 -0
- data/.rubocop.yml +84 -12
- data/CHANGELOG.md +14 -0
- data/Gemfile +4 -4
- data/README.md +2 -0
- data/Rakefile +1 -1
- data/asherah.gemspec +1 -1
- data/ext/asherah/checksums.yml +5 -5
- data/lib/asherah/config.rb +4 -5
- data/lib/asherah/native/libasherah-x64.dylib +0 -0
- data/lib/asherah/version.rb +1 -1
- data/lib/asherah.rb +10 -2
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 67d0ddf5cdcdb3832e11c7fd8e179b42942559d816ef025999fa04a34d2dc29b
|
4
|
+
data.tar.gz: 91bec2d92493b084819fe22a3593e0a5fcf1b9c876679227e7cbbe70c21de859
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 804fcc3aef5504bae82fa29e3a793e320b28393c76d8dff7844bf5d96205abc2f2f130859a2ffb98840fb2066ca62af9641985aab340802aa736b3d13dc38fd8
|
7
|
+
data.tar.gz: 6dc7162a35f715b88a6573ac4e6f64e5554123bb9f5ec878033ab03445f5c2fabf53a28d5f8d9d2d755d3bfdb73d0839b20b1a22d2bd9124bab2a94d48b30b18
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# Example secrets file for KMS integration tests
|
2
|
+
# Copy this file to .env.secrets and fill in actual values
|
3
|
+
#
|
4
|
+
# IMPORTANT: Never commit .env.secrets to version control
|
5
|
+
# The .env.secrets file is already in .gitignore
|
6
|
+
|
7
|
+
# AWS KMS Key ARN for integration tests (optional)
|
8
|
+
# Only needed if running spec/kms_spec.rb
|
9
|
+
# KMS_KEY_ARN=arn:aws:kms:us-west-2:123456789012:key/12345678-1234-1234-1234-123456789012
|
data/.rubocop.yml
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
AllCops:
|
2
|
-
TargetRubyVersion: 2.
|
2
|
+
TargetRubyVersion: 2.7
|
3
3
|
NewCops: enable
|
4
4
|
SuggestExtensions: false
|
5
5
|
Exclude:
|
@@ -9,29 +9,101 @@ AllCops:
|
|
9
9
|
Layout/LineLength:
|
10
10
|
Max: 120
|
11
11
|
|
12
|
+
# Metrics cops with reasonable limits
|
12
13
|
Metrics/BlockLength:
|
13
|
-
|
14
|
+
Max: 25
|
15
|
+
Exclude:
|
16
|
+
- 'spec/**/*'
|
17
|
+
- '*.gemspec'
|
18
|
+
- 'Rakefile'
|
14
19
|
|
15
20
|
Metrics/MethodLength:
|
16
|
-
|
21
|
+
Max: 15
|
22
|
+
Exclude:
|
23
|
+
- 'spec/**/*'
|
24
|
+
- 'tasks/**/*'
|
25
|
+
|
26
|
+
Metrics/AbcSize:
|
27
|
+
Max: 20
|
28
|
+
Exclude:
|
29
|
+
- 'spec/**/*'
|
30
|
+
- 'tasks/**/*'
|
31
|
+
|
32
|
+
Metrics/CyclomaticComplexity:
|
33
|
+
Max: 10
|
34
|
+
Exclude:
|
35
|
+
- 'spec/**/*'
|
36
|
+
|
37
|
+
Metrics/PerceivedComplexity:
|
38
|
+
Max: 10
|
39
|
+
Exclude:
|
40
|
+
- 'spec/**/*'
|
41
|
+
|
42
|
+
Metrics/ClassLength:
|
43
|
+
Max: 150
|
44
|
+
Exclude:
|
45
|
+
- 'spec/**/*'
|
46
|
+
|
47
|
+
Metrics/ModuleLength:
|
48
|
+
Max: 150
|
49
|
+
Exclude:
|
50
|
+
- 'spec/**/*'
|
17
51
|
|
52
|
+
# Style cops that were disabled but should be enabled
|
18
53
|
Style/WordArray:
|
19
|
-
|
54
|
+
MinSize: 3
|
55
|
+
EnforcedStyle: brackets
|
20
56
|
|
21
57
|
Style/SymbolArray:
|
22
|
-
|
58
|
+
MinSize: 3
|
59
|
+
EnforcedStyle: brackets
|
23
60
|
|
24
61
|
Style/MultilineBlockChain:
|
25
|
-
Enabled:
|
62
|
+
Enabled: true
|
63
|
+
Exclude:
|
64
|
+
- 'spec/**/*'
|
26
65
|
|
27
66
|
Style/BlockDelimiters:
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
67
|
+
EnforcedStyle: semantic
|
68
|
+
FunctionalMethods:
|
69
|
+
- let
|
70
|
+
- let!
|
71
|
+
- subject
|
72
|
+
- before
|
73
|
+
- after
|
74
|
+
Exclude:
|
75
|
+
- 'asherah.gemspec'
|
76
|
+
- 'ext/asherah/native_file.rb'
|
32
77
|
|
33
78
|
Style/GuardClause:
|
34
|
-
|
79
|
+
MinBodyLength: 3
|
80
|
+
Exclude:
|
81
|
+
- 'ext/asherah/native_file.rb'
|
35
82
|
|
83
|
+
# Naming cop adjustment
|
36
84
|
Naming/AccessorMethodName:
|
37
|
-
|
85
|
+
Exclude:
|
86
|
+
- 'lib/asherah.rb' # set_env is intentionally named
|
87
|
+
|
88
|
+
# Documentation cops
|
89
|
+
Style/Documentation:
|
90
|
+
Enabled: true
|
91
|
+
Exclude:
|
92
|
+
- 'spec/**/*'
|
93
|
+
- 'features/**/*'
|
94
|
+
|
95
|
+
Style/DocumentationMethod:
|
96
|
+
Enabled: false # YARD comments are optional
|
97
|
+
|
98
|
+
# Additional cops for code quality
|
99
|
+
Lint/UnusedMethodArgument:
|
100
|
+
Enabled: true
|
101
|
+
|
102
|
+
Lint/UnusedBlockArgument:
|
103
|
+
Enabled: true
|
104
|
+
|
105
|
+
Security/Eval:
|
106
|
+
Enabled: true
|
107
|
+
|
108
|
+
Security/JSONLoad:
|
109
|
+
Enabled: true
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,19 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
## [0.7.0] - 2025-08-15
|
4
|
+
|
5
|
+
- Fix memory leak risks in buffer management
|
6
|
+
- Fix inconsistent NotInitialized error handling across all methods
|
7
|
+
- Fix overly permissive RuboCop configuration
|
8
|
+
- Add Dependabot configuration for automated dependency updates
|
9
|
+
- Update dependencies and Github actions
|
10
|
+
- Update Go version to 1.24 for cross-language tests
|
11
|
+
|
12
|
+
## [0.6.0] - 2025-03-19
|
13
|
+
|
14
|
+
- Upgrade to use asherah-cobhan v0.4.35
|
15
|
+
- Requires minimum GLIBC 2.32 version
|
16
|
+
|
3
17
|
## [0.5.2] - 2024-01-15
|
4
18
|
|
5
19
|
- Upgrade to use asherah-cobhan v0.4.32
|
data/Gemfile
CHANGED
@@ -5,10 +5,10 @@ source 'https://rubygems.org'
|
|
5
5
|
# Specify your gem's dependencies in asherah.gemspec
|
6
6
|
gemspec
|
7
7
|
|
8
|
-
gem 'cucumber', '~>
|
9
|
-
gem 'dotenv', '~> 2.
|
8
|
+
gem 'cucumber', '~> 9.2.1'
|
9
|
+
gem 'dotenv', '~> 2.8.1'
|
10
10
|
gem 'rake', '~> 13.0'
|
11
|
-
gem 'rspec', '~> 3.
|
11
|
+
gem 'rspec', '~> 3.13.1'
|
12
12
|
gem 'rubocop', '~> 1.7'
|
13
|
-
gem 'simplecov', '~> 0.
|
13
|
+
gem 'simplecov', '~> 0.22.0'
|
14
14
|
gem 'simplecov-console', '~> 0.9.1'
|
data/README.md
CHANGED
@@ -67,6 +67,8 @@ puts decrypted_data
|
|
67
67
|
|
68
68
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
69
69
|
|
70
|
+
For tests requiring secrets (AWS KMS, database credentials), copy `.env.secrets.example` to `.env.secrets` and fill in the required values. The `.env.secrets` file is already in `.gitignore` to prevent accidental commits.
|
71
|
+
|
70
72
|
To install this gem onto your local machine, run `rake install`.
|
71
73
|
|
72
74
|
To release a new version, update the version number in `version.rb`, create and push a version tag:
|
data/Rakefile
CHANGED
data/asherah.gemspec
CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
|
|
16
16
|
|
17
17
|
spec.homepage = 'https://github.com/godaddy/asherah-ruby'
|
18
18
|
spec.license = 'MIT'
|
19
|
-
spec.required_ruby_version = '>= 2.
|
19
|
+
spec.required_ruby_version = '>= 2.7.0'
|
20
20
|
|
21
21
|
spec.metadata['homepage_uri'] = spec.homepage
|
22
22
|
spec.metadata['source_code_uri'] = 'https://github.com/godaddy/asherah-ruby'
|
data/ext/asherah/checksums.yml
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
version: v0.4.
|
2
|
-
libasherah-arm64.so:
|
3
|
-
libasherah-x64.so:
|
4
|
-
libasherah-arm64.dylib:
|
5
|
-
libasherah-x64.dylib:
|
1
|
+
version: v0.4.35
|
2
|
+
libasherah-arm64.so: fad23a38e68e126374075adf197f0f431720aea9852deebe5f62d9240c935a66
|
3
|
+
libasherah-x64.so: 8c52fc000df2c02fb2d1430afc3cd68e997f47f04b60d61481f8c4b201958ef8
|
4
|
+
libasherah-arm64.dylib: 315bc41c85177a2b0c97f32e0af8e2694f393928678cbe648fdd8c16b8fe062a
|
5
|
+
libasherah-x64.dylib: 848d3635713373e0482223087f454ff8464e36e7695e0ed19f830737288adaa9
|
data/lib/asherah/config.rb
CHANGED
@@ -105,11 +105,10 @@ module Asherah
|
|
105
105
|
end
|
106
106
|
|
107
107
|
def validate_kms_attributes
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
end
|
108
|
+
return unless kms == 'aws'
|
109
|
+
raise Error::ConfigError, 'config.region_map not set' if region_map.nil?
|
110
|
+
raise Error::ConfigError, 'config.region_map must be a Hash' unless region_map.is_a?(Hash)
|
111
|
+
raise Error::ConfigError, 'config.preferred_region not set' if preferred_region.nil?
|
113
112
|
end
|
114
113
|
end
|
115
114
|
end
|
Binary file
|
data/lib/asherah/version.rb
CHANGED
data/lib/asherah.rb
CHANGED
@@ -37,6 +37,8 @@ module Asherah
|
|
37
37
|
|
38
38
|
result = SetEnv(env_buffer)
|
39
39
|
Error.check_result!(result, 'SetEnv failed')
|
40
|
+
ensure
|
41
|
+
env_buffer&.free
|
40
42
|
end
|
41
43
|
|
42
44
|
# Configures Asherah
|
@@ -56,6 +58,8 @@ module Asherah
|
|
56
58
|
result = SetupJson(config_buffer)
|
57
59
|
Error.check_result!(result, 'SetupJson failed')
|
58
60
|
@initialized = true
|
61
|
+
ensure
|
62
|
+
config_buffer&.free
|
59
63
|
end
|
60
64
|
|
61
65
|
# Encrypts data for a given partition_id and returns DataRowRecord in JSON format.
|
@@ -74,6 +78,8 @@ module Asherah
|
|
74
78
|
# @param data [String]
|
75
79
|
# @return [String], DataRowRecord in JSON format
|
76
80
|
def encrypt(partition_id, data)
|
81
|
+
raise Asherah::Error::NotInitialized unless @initialized
|
82
|
+
|
77
83
|
partition_id_buffer = string_to_cbuffer(partition_id)
|
78
84
|
data_buffer = string_to_cbuffer(data)
|
79
85
|
estimated_buffer_bytesize = estimate_buffer(data.bytesize, partition_id.bytesize)
|
@@ -84,7 +90,7 @@ module Asherah
|
|
84
90
|
|
85
91
|
cbuffer_to_string(output_buffer)
|
86
92
|
ensure
|
87
|
-
[partition_id_buffer, data_buffer, output_buffer].
|
93
|
+
[partition_id_buffer, data_buffer, output_buffer].compact.each(&:free)
|
88
94
|
end
|
89
95
|
|
90
96
|
# Decrypts a DataRowRecord in JSON format for a partition_id and returns decrypted data.
|
@@ -93,6 +99,8 @@ module Asherah
|
|
93
99
|
# @param json [String], DataRowRecord in JSON format
|
94
100
|
# @return [String], Decrypted data
|
95
101
|
def decrypt(partition_id, json)
|
102
|
+
raise Asherah::Error::NotInitialized unless @initialized
|
103
|
+
|
96
104
|
partition_id_buffer = string_to_cbuffer(partition_id)
|
97
105
|
data_buffer = string_to_cbuffer(json)
|
98
106
|
output_buffer = allocate_cbuffer(json.bytesize)
|
@@ -102,7 +110,7 @@ module Asherah
|
|
102
110
|
|
103
111
|
cbuffer_to_string(output_buffer)
|
104
112
|
ensure
|
105
|
-
[partition_id_buffer, data_buffer, output_buffer].
|
113
|
+
[partition_id_buffer, data_buffer, output_buffer].compact.each(&:free)
|
106
114
|
end
|
107
115
|
|
108
116
|
# Stop the Asherah instance
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asherah
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: x86_64-darwin
|
6
6
|
authors:
|
7
7
|
- GoDaddy
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-08-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cobhan
|
@@ -35,6 +35,7 @@ extensions:
|
|
35
35
|
- ext/asherah/extconf.rb
|
36
36
|
extra_rdoc_files: []
|
37
37
|
files:
|
38
|
+
- ".env.secrets.example"
|
38
39
|
- ".rspec"
|
39
40
|
- ".rubocop.yml"
|
40
41
|
- ".ruby-version"
|
@@ -71,14 +72,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
71
72
|
requirements:
|
72
73
|
- - ">="
|
73
74
|
- !ruby/object:Gem::Version
|
74
|
-
version: 2.
|
75
|
+
version: 2.7.0
|
75
76
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
76
77
|
requirements:
|
77
78
|
- - ">="
|
78
79
|
- !ruby/object:Gem::Version
|
79
80
|
version: '0'
|
80
81
|
requirements: []
|
81
|
-
rubygems_version: 3.4.
|
82
|
+
rubygems_version: 3.4.19
|
82
83
|
signing_key:
|
83
84
|
specification_version: 4
|
84
85
|
summary: Application Layer Encryption SDK
|