gratan 0.3.0 → 0.3.1.beta
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/README.md +3 -0
- data/bin/gratan +25 -24
- data/lib/gratan/client.rb +7 -1
- data/lib/gratan/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ca40421121d00c6d6087897bb19f9ae256cfe1c
|
4
|
+
data.tar.gz: b9d46d7d998cd85733f40af7e348d0bf5768b932
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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')
|
34
|
-
opt.on('' , '--port PORT', Integer)
|
35
|
-
opt.on('' , '--socket SOCKET')
|
36
|
-
opt.on('' , '--username USERNAME')
|
37
|
-
opt.on('' , '--password PASSWORD')
|
38
|
-
opt.on('' , '--database DATABASE')
|
39
|
-
opt.on('-a', '--apply')
|
40
|
-
opt.on('-f', '--file FILE')
|
41
|
-
opt.on('' , '--dry-run')
|
42
|
-
opt.on('-e', '--export')
|
43
|
-
opt.on('' , '--with-identifier')
|
44
|
-
opt.on('' , '--split')
|
45
|
-
opt.on('' , '--chunk-by-user')
|
46
|
-
opt.on('-o', '--output FILE')
|
47
|
-
opt.on('' , '--ignore-user REGEXP')
|
48
|
-
opt.on('' , '--target-user REGEXP')
|
49
|
-
opt.on('' , '--ignore-object REGEXP')
|
50
|
-
opt.on('' , '--enable-expired')
|
51
|
-
opt.on('' , '--ignore-not-exist')
|
52
|
-
opt.on('' , '--
|
53
|
-
opt.on('' , '--
|
54
|
-
opt.on('' , '--
|
55
|
-
opt.on('' , '--
|
56
|
-
opt.on('' , '--
|
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)
|
data/lib/gratan/client.rb
CHANGED
@@ -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
|
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
|
data/lib/gratan/version.rb
CHANGED
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.
|
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:
|
222
|
+
version: 1.3.1
|
223
223
|
requirements: []
|
224
224
|
rubyforge_project:
|
225
225
|
rubygems_version: 2.4.5.1
|