gratan 0.3.0 → 0.3.1.beta

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
  SHA1:
3
- metadata.gz: fc17c06094ffc516ac6e865ddfd975041a394b26
4
- data.tar.gz: b66dd554edc0a1a00744af8656bb00ccd660515f
3
+ metadata.gz: 7ca40421121d00c6d6087897bb19f9ae256cfe1c
4
+ data.tar.gz: b9d46d7d998cd85733f40af7e348d0bf5768b932
5
5
  SHA512:
6
- metadata.gz: 8bdfd0e5139ee628fa605d919353ca669ebc53e1c38af4b626e3521256907015043528925587df564eb3bbed350024c4dc363dd027cc17c03f52af50b7b558e2
7
- data.tar.gz: f0fa8d845ebdf84355ee7c620f6910e869284d983cffcee6be70d078a0392277e2702628f6ee6cdc656a2f849d2a1e1dcdf0d8dfe11102757d488f7d4f6cd9fd
6
+ metadata.gz: c4a143638231edc72f93d998204470b49ae3044240c18040d7b7d4a357bcb5ea800537e6e48e33f51ceb78749cf21d96a95fe975634bbd0e3e8616c154eb13b9
7
+ data.tar.gz: 0b45942f3d858620e8c3c3990c1e972d7018e89d6ba39d56b3684a551fc5294dd9f9c1da152f5f0b24794091390cc552073369a111707f4ab32472e80e21b33b
data/README.md CHANGED
@@ -12,6 +12,8 @@ It defines the state of MySQL permissions using Ruby DSL, and updates permission
12
12
 
13
13
  * `>= 0.3.0`
14
14
  * Support template
15
+ * `>= 0.3.1`
16
+ * Fix `<secret>` password
15
17
 
16
18
  ## Installation
17
19
 
@@ -61,6 +63,7 @@ Usage: gratan [options]
61
63
  --ignore-object REGEXP
62
64
  --enable-expired
63
65
  --ignore-not-exist
66
+ --ignore-password-secret
64
67
  --skip-disable-log-bin
65
68
  --no-color
66
69
  --debug
data/bin/gratan CHANGED
@@ -30,30 +30,31 @@ options = {
30
30
 
31
31
  ARGV.options do |opt|
32
32
  begin
33
- opt.on('' , '--host HOST') {|v| mysql_options[:host] = v }
34
- opt.on('' , '--port PORT', Integer) {|v| mysql_options[:port] = v }
35
- opt.on('' , '--socket SOCKET') {|v| mysql_options[:socket] = v }
36
- opt.on('' , '--username USERNAME') {|v| mysql_options[:username] = v }
37
- opt.on('' , '--password PASSWORD') {|v| mysql_options[:password] = v }
38
- opt.on('' , '--database DATABASE') {|v| mysql_options[:database] = v }
39
- opt.on('-a', '--apply') { mode = :apply }
40
- opt.on('-f', '--file FILE') {|v| file = v }
41
- opt.on('' , '--dry-run') { options[:dry_run] = true }
42
- opt.on('-e', '--export') { mode = :export }
43
- opt.on('' , '--with-identifier') { options[:with_identifier] = true }
44
- opt.on('' , '--split') { split = true }
45
- opt.on('' , '--chunk-by-user') { options[:chunk_by_user] = true }
46
- opt.on('-o', '--output FILE') {|v| output_file = v }
47
- opt.on('' , '--ignore-user REGEXP') {|v| options[:ignore_user] = Regexp.new(v) }
48
- opt.on('' , '--target-user REGEXP') {|v| options[:target_user] = Regexp.new(v) }
49
- opt.on('' , '--ignore-object REGEXP') {|v| options[:ignore_object] = Regexp.new(v) }
50
- opt.on('' , '--enable-expired') { options[:enable_expired] = true }
51
- opt.on('' , '--ignore-not-exist') {|v| options[:ignore_not_exist] = true }
52
- opt.on('' , '--skip-disable-log-bin') { options[:skip_disable_log_bin] = true }
53
- opt.on('' , '--no-color') { options[:color] = false }
54
- opt.on('' , '--debug') { options[:debug] = true }
55
- opt.on('' , '--auto-identify OUTPUT') {|v| options[:identifier] = Gratan::Identifier::Auto.new(v, options) }
56
- opt.on('' , '--csv-identify CSV') {|v| options[:identifier] = Gratan::Identifier::CSV.new(v, options) }
33
+ opt.on('' , '--host HOST') {|v| mysql_options[:host] = v }
34
+ opt.on('' , '--port PORT', Integer) {|v| mysql_options[:port] = v }
35
+ opt.on('' , '--socket SOCKET') {|v| mysql_options[:socket] = v }
36
+ opt.on('' , '--username USERNAME') {|v| mysql_options[:username] = v }
37
+ opt.on('' , '--password PASSWORD') {|v| mysql_options[:password] = v }
38
+ opt.on('' , '--database DATABASE') {|v| mysql_options[:database] = v }
39
+ opt.on('-a', '--apply') { mode = :apply }
40
+ opt.on('-f', '--file FILE') {|v| file = v }
41
+ opt.on('' , '--dry-run') { options[:dry_run] = true }
42
+ opt.on('-e', '--export') { mode = :export }
43
+ opt.on('' , '--with-identifier') { options[:with_identifier] = true }
44
+ opt.on('' , '--split') { split = true }
45
+ opt.on('' , '--chunk-by-user') { options[:chunk_by_user] = true }
46
+ opt.on('-o', '--output FILE') {|v| output_file = v }
47
+ opt.on('' , '--ignore-user REGEXP') {|v| options[:ignore_user] = Regexp.new(v) }
48
+ opt.on('' , '--target-user REGEXP') {|v| options[:target_user] = Regexp.new(v) }
49
+ opt.on('' , '--ignore-object REGEXP') {|v| options[:ignore_object] = Regexp.new(v) }
50
+ opt.on('' , '--enable-expired') { options[:enable_expired] = true }
51
+ opt.on('' , '--ignore-not-exist') {|v| options[:ignore_not_exist] = true }
52
+ opt.on('' , '--ignore-password-secret') {|v| options[:ignore_password_secret] = true }
53
+ opt.on('' , '--skip-disable-log-bin') { options[:skip_disable_log_bin] = true }
54
+ opt.on('' , '--no-color') { options[:color] = false }
55
+ opt.on('' , '--debug') { options[:debug] = true }
56
+ opt.on('' , '--auto-identify OUTPUT') {|v| options[:identifier] = Gratan::Identifier::Auto.new(v, options) }
57
+ opt.on('' , '--csv-identify CSV') {|v| options[:identifier] = Gratan::Identifier::CSV.new(v, options) }
57
58
 
58
59
  opt.on('' , '--mysql2-options JSON') do |json|
59
60
  json = JSON.parse(json)
@@ -1,4 +1,6 @@
1
1
  class Gratan::Client
2
+ include Gratan::Logger::Helper
3
+
2
4
  def initialize(options = {})
3
5
  @options = options
4
6
  @options[:identifier] ||= Gratan::Identifier::Null.new
@@ -130,7 +132,11 @@ class Gratan::Client
130
132
  end
131
133
 
132
134
  def walk_identified(user, host, expected_identified, actual_identified)
133
- if expected_identified != actual_identified
135
+ if actual_identified == 'PASSWORD <secret>'
136
+ unless @options[:ignore_password_secret]
137
+ log(:warn, "cannot change the password (`PASSWORD <secret>`)", :color => :yellow)
138
+ end
139
+ elsif expected_identified != actual_identified
134
140
  @driver.identify(user, host, expected_identified)
135
141
  update!
136
142
  end
@@ -1,3 +1,3 @@
1
1
  module Gratan
2
- VERSION = '0.3.0'
2
+ VERSION = '0.3.1.beta'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gratan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1.beta
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genki Sugawara
@@ -217,9 +217,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
217
217
  version: '0'
218
218
  required_rubygems_version: !ruby/object:Gem::Requirement
219
219
  requirements:
220
- - - ">="
220
+ - - ">"
221
221
  - !ruby/object:Gem::Version
222
- version: '0'
222
+ version: 1.3.1
223
223
  requirements: []
224
224
  rubyforge_project:
225
225
  rubygems_version: 2.4.5.1