manageiq-password 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 169673824deb748589d388452d71ade309bf678d35a30be8e88493cdfd9058c7
4
- data.tar.gz: 49c0b253a7ec7a1212ebce03d2e83f3b407b6e6bcad0c49d44cb4889e5968cb2
3
+ metadata.gz: e2afb4581105b776ca6285b4324b2e228774c2f4f6ef0bb19c1947a56fa481ea
4
+ data.tar.gz: 53e56209872207f7e03656b95a0973000404bbcf79bc3d84690742481503a6e6
5
5
  SHA512:
6
- metadata.gz: 0b72cf25be15763836db8d0779da31bb69c45116a44602a61ad4a7bece0083ae57d60c59fe4c295f26c059c4d1b1c01181efce56fb25ad45d2f731095410f77f
7
- data.tar.gz: ca33b0b6939a2a8671f04905ab00d2ba4c48bcc7b7a48611f968fa3f626a25b08f4b21a8b9e3c285c54410820c3432f44aab0153dd62094bb20da67f881f5ce6
6
+ metadata.gz: 919c5faa8a027cb296296c37a93fdd684a19614dc733aae01d11852ffef98f5d56ae91c4600b5f412fea42d23bdb30273a9858ddedc497a899310adca4959475
7
+ data.tar.gz: '0383c3dc4e538f1928c2f485786e8b1e12409d0a6f3726b013bed1c3b2907791db70d16d1c146cd38635ebe6b8e08235d384c752cd48b5a26bae2741d6652c47'
@@ -0,0 +1,33 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+ schedule:
7
+ - cron: '0 0 * * 0'
8
+
9
+ jobs:
10
+ ci:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ ruby-version:
15
+ - '2.7'
16
+ - '3.0'
17
+ - '3.1'
18
+ env:
19
+ CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
20
+ steps:
21
+ - uses: actions/checkout@v4
22
+ - name: Set up Ruby
23
+ uses: ruby/setup-ruby@v1
24
+ with:
25
+ ruby-version: ${{ matrix.ruby-version }}
26
+ bundler-cache: true
27
+ timeout-minutes: 30
28
+ - name: Run tests
29
+ run: bundle exec rake
30
+ - name: Report code coverage
31
+ if: ${{ github.ref == 'refs/heads/master' && matrix.ruby-version == '3.0' }}
32
+ continue-on-error: true
33
+ uses: paambaati/codeclimate-action@v5
data/.rspec CHANGED
@@ -1,3 +1,3 @@
1
- --format progress
2
- --color
3
1
  --require spec_helper
2
+ --color
3
+ --order random
data/.whitesource ADDED
@@ -0,0 +1,3 @@
1
+ {
2
+ "settingsInheritedFrom": "ManageIQ/whitesource-config@master"
3
+ }
data/CHANGELOG.md CHANGED
@@ -4,6 +4,16 @@ This project adheres to [Semantic Versioning](http://semver.org/).
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [1.2.0] - 2023-10-12
8
+ ### Added
9
+ - Add Ruby 3.1 support including ruby 3.1's psych 4 default of safe_load [[#37](https://github.com/ManageIQ/manageiq-password/pull/37)]
10
+
11
+ ### Changed
12
+ - Change .to_s to use a regular attr_reader [[#34](https://github.com/ManageIQ/manageiq-password/pull/34)]
13
+
14
+ ### Removed
15
+ - Removed support for Ruby 2.5 and 2.6 [[#37](https://github.com/ManageIQ/manageiq-password/pull/37)]
16
+
7
17
  ## [1.1.0] - 2021-11-08
8
18
  ### Added
9
19
  - Add manageiq-password CLI [[#23](https://github.com/ManageIQ/manageiq-password/pull/23)]
@@ -22,6 +32,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
22
32
  key
23
33
  - **BREAKING**: Drop deprecated methods [[#16](https://github.com/ManageIQ/manageiq-password/pull/16)]
24
34
 
25
- [Unreleased]: https://github.com/ManageIQ/more_core_extensions/compare/v1.1.0...HEAD
26
- [1.1.0]: https://github.com/ManageIQ/more_core_extensions/compare/v1.1.0...v1.0.0
27
- [1.0.0]: https://github.com/ManageIQ/more_core_extensions/compare/v1.0.0...v0.3.0
35
+ [Unreleased]: https://github.com/ManageIQ/manageiq-password/compare/v1.2.0...HEAD
36
+ [1.2.0]: https://github.com/ManageIQ/manageiq-password/compare/v1.1.0...v1.2.0
37
+ [1.1.0]: https://github.com/ManageIQ/manageiq-password/compare/v1.0.0...v1.1.0
38
+ [1.0.0]: https://github.com/ManageIQ/manageiq-password/compare/v0.3.0...v1.0.0
data/README.md CHANGED
@@ -1,8 +1,9 @@
1
1
  # ManageIQ Password
2
2
 
3
- [![Build Status](https://travis-ci.com/ManageIQ/manageiq-password.svg)](https://travis-ci.com/ManageIQ/manageiq-password)
4
- [![Maintainability](https://api.codeclimate.com/v1/badges/85064711d083dea96636/maintainability)](https://codeclimate.com/github/ManageIQ/manageiq-password/maintainability)
5
- [![Test Coverage](https://api.codeclimate.com/v1/badges/85064711d083dea96636/test_coverage)](https://codeclimate.com/github/ManageIQ/manageiq-password/test_coverage)
3
+ [![Gem Version](https://badge.fury.io/rb/manageiq-password.svg)](http://badge.fury.io/rb/manageiq-password)
4
+ [![CI](https://github.com/ManageIQ/manageiq-password/actions/workflows/ci.yaml/badge.svg)](https://github.com/ManageIQ/manageiq-password/actions/workflows/ci.yaml)
5
+ [![Code Climate](https://codeclimate.com/github/ManageIQ/manageiq-password.svg)](https://codeclimate.com/github/ManageIQ/manageiq-password)
6
+ [![Test Coverage](https://codeclimate.com/github/ManageIQ/manageiq-password/badges/coverage.svg)](https://codeclimate.com/github/ManageIQ/manageiq-password/coverage)
6
7
 
7
8
  A simple encryption util for storing passwords in a database.
8
9
 
@@ -1,5 +1,5 @@
1
1
  module ManageIQ
2
2
  class Password
3
- VERSION = "1.1.0".freeze
3
+ VERSION = "1.2.0".freeze
4
4
  end
5
5
  end
@@ -157,7 +157,8 @@ module ManageIQ
157
157
  filename = File.expand_path(filename, key_root) unless File.exist?(filename)
158
158
  return nil unless File.exist?(filename)
159
159
 
160
- Key.new(*YAML.load_file(filename).values_at(:algorithm, :key, :iv))
160
+ # Switch to YAML.safe_load_file when we drop ruby 2.7. Psych 3.2.1 added it.
161
+ Key.new(*YAML.safe_load(File.read(filename), :permitted_classes => [Symbol, Time]).values_at(:algorithm, :key, :iv))
161
162
  end
162
163
 
163
164
  private_class_method def self.remove_erb(str)
@@ -175,6 +176,9 @@ module ManageIQ
175
176
  Base64.strict_encode64(Digest::SHA256.digest("#{password}#{salt}")[0, GENERATED_KEY_SIZE])
176
177
  end
177
178
 
179
+ attr_reader :key
180
+ alias to_s key
181
+
178
182
  def initialize(algorithm = nil, key = nil, iv = nil)
179
183
  @algorithm = algorithm || "aes-256-cbc"
180
184
  @key = key || generate_key
@@ -199,10 +203,6 @@ module ManageIQ
199
203
  decrypt(Base64.decode64(str))
200
204
  end
201
205
 
202
- def to_s
203
- @key
204
- end
205
-
206
206
  def to_h
207
207
  {
208
208
  :algorithm => @algorithm,
@@ -23,5 +23,5 @@ Gem::Specification.new do |spec|
23
23
  spec.add_development_dependency "manageiq-style"
24
24
  spec.add_development_dependency "rake", ">= 12.3.3"
25
25
  spec.add_development_dependency "rspec", "~> 3.0"
26
- spec.add_development_dependency "simplecov"
26
+ spec.add_development_dependency "simplecov", ">= 0.21.2"
27
27
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: manageiq-password
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ManageIQ Authors
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-11-08 00:00:00.000000000 Z
11
+ date: 2023-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: awesome_spawn
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: '0'
89
+ version: 0.21.2
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
- version: '0'
96
+ version: 0.21.2
97
97
  description:
98
98
  email:
99
99
  executables:
@@ -102,12 +102,13 @@ extensions: []
102
102
  extra_rdoc_files: []
103
103
  files:
104
104
  - ".codeclimate.yml"
105
+ - ".github/workflows/ci.yaml"
105
106
  - ".gitignore"
106
107
  - ".rspec"
107
108
  - ".rubocop.yml"
108
109
  - ".rubocop_cc.yml"
109
110
  - ".rubocop_local.yml"
110
- - ".travis.yml"
111
+ - ".whitesource"
111
112
  - CHANGELOG.md
112
113
  - CODE_OF_CONDUCT.md
113
114
  - Gemfile
@@ -144,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
145
  - !ruby/object:Gem::Version
145
146
  version: '0'
146
147
  requirements: []
147
- rubygems_version: 3.1.6
148
+ rubygems_version: 3.2.33
148
149
  signing_key:
149
150
  specification_version: 4
150
151
  summary: A simple encryption util for storing passwords in a database.
data/.travis.yml DELETED
@@ -1,14 +0,0 @@
1
- ---
2
- language: ruby
3
- dist: bionic
4
- cache: bundler
5
- rvm:
6
- - 2.6.7
7
- - 2.7.3
8
- - 3.0.1
9
- before_script:
10
- - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
11
- - chmod +x ./cc-test-reporter
12
- - "./cc-test-reporter before-build"
13
- after_script:
14
- - "./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT"