credman 0.0.3 → 0.0.4

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: 7f3f7223fef1b2a86ff1cb2d922ceb13ab7be255564904e3d9c323ea8b01f8f2
4
- data.tar.gz: fb0930eea7b736c7205b9d395ea4798bd66bdc6fd16c8a16ffb88e8fbf101112
3
+ metadata.gz: 6388da4cf0f1f8567e5a14e214e1ed7db9143307d836286050a91fbeeaf03f16
4
+ data.tar.gz: 3a8b0e4e839371279e819463c659898556f81d171ba980da006b459f4e7812f4
5
5
  SHA512:
6
- metadata.gz: 8cab55b97eac2c2bde4b6a28e2d60866261aedf7359189b2c70c5feb5e8c58d4358ccb096271657532cb1108db5c7887d42044e5bed52aede92faa318363bbab
7
- data.tar.gz: 3e1b42772d70645693f918d87da78b9590a54a100b30b195ad284d067112d326bb36944a3a1635ed0d79b44bd1a9c61f6d0718e1512723612ce22d738a7a4b0a
6
+ metadata.gz: 605cb0d66f1a5c7889325e80ae3de4f604ab6958a0c08ceef401f35db8b6378d949030d4f58502ce91fe699563a206ffb7dac418315732d544b0d2eecf3cb262
7
+ data.tar.gz: 9cd6975ad0f9a1ebdfa69fac1807a27217a0a0fce7c6ebf66ee07c804e4a38e18631c6a0def1732fc4d5d61a817fb65edd62f48a225f875400795ca6b2d2d209
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [0.0.4] - 2022-09-06
2
+
3
+ - fix: list command failure when root key exists (PR #2)
4
+
1
5
  ## [0.0.3] - 2022-08-24
2
6
 
3
7
  - add `bin/rspec` binstubs
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- credman (0.0.3)
4
+ credman (0.0.4)
5
5
  activesupport (>= 6.0)
6
6
  dry-cli (~> 0.7)
7
7
  hash_diff (~> 1.0)
data/README.md CHANGED
@@ -1,28 +1,85 @@
1
- # Rails::Credentials::Manager
1
+ # Credman
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/rails/credentials/manager`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ Handy console command for developers to manage Rails credentials.
6
4
 
7
5
  ## Installation
8
6
 
9
7
  Add this line to your application's Gemfile:
10
8
 
11
9
  ```ruby
12
- gem 'credman'
10
+ group :development do
11
+ gem 'credman'
12
+ end
13
13
  ```
14
14
 
15
- And then execute:
15
+ ## Usage
16
+
17
+ List of all commands:
16
18
 
17
- $ bundle install
19
+ ### credman help
20
+ ```
21
+ bundle exec credman
22
+ or
23
+ bundle exec credman help
24
+ or
25
+ bundle exec credman usage
26
+ ```
18
27
 
19
- Or install it yourself as:
28
+ Details of any command:
20
29
 
21
- $ gem install credman
30
+ ```
31
+ bundle exec credman set -h
32
+ ```
22
33
 
23
- ## Usage
34
+ ### credman list
35
+ List all your keys for all environments.
36
+
37
+ ```
38
+ bundle exec credman list
39
+ ```
40
+
41
+ ### credman get
42
+ Getting a particular key's values.
43
+
44
+ ```
45
+ bundle exec credman get google.maps.api_key github.private_key
46
+ ```
47
+
48
+ ### credman set
49
+
50
+ Add/change a value for a particular key. `-e` attribute is mandatory for this command.
51
+
52
+
53
+ ```
54
+ bundle exec credman set new_service.super_key new_secret_value -e development,test,staging,production
55
+ ```
56
+
57
+ ### credman delete
58
+
59
+ Delete for keys. `-e` attribute is mandatory for this command.
60
+
61
+ ```
62
+ bundle exec credman delete new_service.super_key new_service.another_key -e development,test,staging,production
63
+ ```
64
+
65
+ ### credman diff
66
+
67
+ Shows all keys changed compared with `heroku` branch by default. You can specify any branch from origin you want to. For example `bin/earl diff my_branch`
68
+
69
+ ```
70
+ > bundle exec credman diff
71
+ development:
72
+ new_service.super_key: ADDED: "new_secret_value"
73
+ test:
74
+ new_service.super_key: ADDED: "new_secret_value"
75
+ staging:
76
+ new_service.super_key: ADDED: "new_secret_value"
77
+ production:
78
+ new_service.super_key: ADDED: "new_secret_value"
79
+ ```
24
80
 
25
- TODO: Write usage instructions here
81
+ ### credman conflicts
82
+ Run it if you have merge conflicts in `configs/credentials/*.yml.enc`. That interactive tool will help you resolve the conflict.
26
83
 
27
84
  ## Development
28
85
 
@@ -49,7 +49,7 @@ module Credman
49
49
  end
50
50
 
51
51
  class Delete < Dry::CLI::Command
52
- desc "Delete a key for given environments"
52
+ desc "Delete keys for given environments"
53
53
 
54
54
  argument :keys, type: :array, required: true, desc: "keys to delete"
55
55
 
data/lib/credman/list.rb CHANGED
@@ -5,7 +5,14 @@ module Credman
5
5
  puts pastel.green("#{env}:")
6
6
 
7
7
  config.each do |key, value|
8
- deep_print_key_and_value(value, [key])
8
+ if value.is_a?(Hash)
9
+ key_path = [key]
10
+ else
11
+ value = {key => value}
12
+ key_path = []
13
+ end
14
+
15
+ deep_print_key_and_value(value, key_path)
9
16
  end
10
17
  end
11
18
  end
@@ -1,3 +1,3 @@
1
1
  module Credman
2
- VERSION = "0.0.3".freeze
2
+ VERSION = "0.0.4".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: credman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergey Andronov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-24 00:00:00.000000000 Z
11
+ date: 2022-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport