posgra 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -0
- data/lib/posgra/cli/helper.rb +1 -1
- data/lib/posgra/driver.rb +6 -1
- data/lib/posgra/identifier/auto.rb +14 -1
- data/lib/posgra/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 45bd0c913db79c0e2a8dfceec4ef29a7e50d1091
|
4
|
+
data.tar.gz: 608f5d5835f1ef67ed1eec25d13e929115b83819
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0dee75ac4f30b22324282b739a9c5c9d1da5780f3ac8ae6a6459dfb6928e54d4fd880ea02e5874058f8d66f5404bdf0ee1acd5a86a62f529393017a58bcd1d75
|
7
|
+
data.tar.gz: 7ea2c5b16447487660a6373cba514e385bee0f2b42c0abefb44091e98c975412dd0f4e8f6d3e93e23ba54c114c67f4fb8374e87dd71ee8ab3d89de27216fa7a8
|
data/README.md
CHANGED
data/lib/posgra/cli/helper.rb
CHANGED
@@ -31,7 +31,7 @@ module Posgra::CLI::Helper
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
-
client_options[:identifier] = Posgra::Identifier::Auto.new(options['account-output'])
|
34
|
+
client_options[:identifier] = Posgra::Identifier::Auto.new(options['account-output'], client_options)
|
35
35
|
Posgra::Client.new(client_options)
|
36
36
|
end
|
37
37
|
end
|
data/lib/posgra/driver.rb
CHANGED
@@ -2,7 +2,8 @@ class Posgra::Driver
|
|
2
2
|
include Posgra::Logger::Helper
|
3
3
|
include Posgra::Utils::Helper
|
4
4
|
|
5
|
-
|
5
|
+
DEFAULT_ACL_PRIVS = ENV['POSGRA_DEFAULT_ACL_PRIVS'] || 'arwdDxt'
|
6
|
+
DEFAULT_ACL = "{%s=#{DEFAULT_ACL_PRIVS}/%s}"
|
6
7
|
|
7
8
|
PRIVILEGE_TYPES = {
|
8
9
|
'a' => 'INSERT',
|
@@ -13,6 +14,10 @@ class Posgra::Driver
|
|
13
14
|
'x' => 'REFERENCES',
|
14
15
|
't' => 'TRIGGER',
|
15
16
|
'U' => 'USAGE',
|
17
|
+
'R' => 'RULE',
|
18
|
+
'X' => 'EXECUTE',
|
19
|
+
'C' => 'CREATE',
|
20
|
+
'T' => 'TEMPORARY',
|
16
21
|
}
|
17
22
|
|
18
23
|
def initialize(client, options = {})
|
@@ -13,7 +13,20 @@ class Posgra::Identifier::Auto
|
|
13
13
|
private
|
14
14
|
|
15
15
|
def mkpasswd(len = 8)
|
16
|
-
|
16
|
+
sources = [
|
17
|
+
(1..9).to_a,
|
18
|
+
('A'..'Z').to_a,
|
19
|
+
('a'..'z').to_a,
|
20
|
+
].shuffle
|
21
|
+
|
22
|
+
passwd = []
|
23
|
+
|
24
|
+
len.times do |i|
|
25
|
+
src = sources[i % sources.length]
|
26
|
+
passwd << src.shuffle.shift
|
27
|
+
end
|
28
|
+
|
29
|
+
passwd.join
|
17
30
|
end
|
18
31
|
|
19
32
|
def puts_password(user, password)
|
data/lib/posgra/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: posgra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- winebarrel
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-01-
|
11
|
+
date: 2016-01-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|