ldap_tools 0.9.2 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tapjoy/ldap/cli/user/create.rb +4 -4
- data/lib/tapjoy/ldap/cli/user/delete.rb +2 -2
- data/lib/tapjoy/ldap/cli/user/show.rb +1 -1
- data/lib/tapjoy/ldap/key/add.rb +1 -1
- data/lib/tapjoy/ldap/key/remove.rb +2 -2
- data/lib/tapjoy/ldap/key/show.rb +1 -1
- data/lib/tapjoy/ldap/version.rb +2 -2
- 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: 77c2a1ba62f8b9af254527701c000784be6ad2aa
|
4
|
+
data.tar.gz: f266faabe57587a073eb0c408e1f3b5f50532d3a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 283eb45c5746a225bc09abcd5458f3c9b4d1c7728b71b7f13c8b9f5bc379be2bf93d4458590d64ee1be31b8f6ebbef8ce5885974b16d1d4c46b51e92a1656230
|
7
|
+
data.tar.gz: dcf7fe4b7cf6014883d311b645b4d5e10c8bfadfa41765a963031b3236d0eb5a8c411a5e01d4541a63f0f0879ec0a23931e8a9edebde9bd5ccd026b635c7a84a
|
@@ -8,7 +8,7 @@ module Tapjoy
|
|
8
8
|
# Make the API call to create an LDAP user
|
9
9
|
def create
|
10
10
|
verify_arguments
|
11
|
-
fname, lname = opts[:
|
11
|
+
fname, lname = opts[:name]
|
12
12
|
puts Tapjoy::LDAP::API::User.create(fname, lname,
|
13
13
|
opts[:type], opts[:group])
|
14
14
|
end
|
@@ -20,10 +20,10 @@ module Tapjoy
|
|
20
20
|
usage 'user create [options]'
|
21
21
|
synopsis "\nThis command is for creating new LDAP users"
|
22
22
|
|
23
|
-
#
|
23
|
+
# Name is two arguments
|
24
24
|
# Trollop will accept more, but we will only parse two later
|
25
25
|
# TODO: support given names that include a space
|
26
|
-
opt :
|
26
|
+
opt :name, "Specify user's first and last name", type: :strings, required: true
|
27
27
|
|
28
28
|
# Groupname is a single string, for primary group setting
|
29
29
|
opt :group, 'Specify name of primary group', type: :string, required: true
|
@@ -32,7 +32,7 @@ module Tapjoy
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def verify_arguments
|
35
|
-
Trollop.die :
|
35
|
+
Trollop.die :name, 'argument count must be two' if opts[:name].size != 2
|
36
36
|
Trollop.die :type, "argument must be 'user' or 'service'" unless %w(user service).include?(opts[:type])
|
37
37
|
end
|
38
38
|
end
|
@@ -9,7 +9,7 @@ module Tapjoy
|
|
9
9
|
def delete
|
10
10
|
verify_arguments
|
11
11
|
confirm unless opts[:force]
|
12
|
-
puts Tapjoy::LDAP::API::User.destroy(opts[:
|
12
|
+
puts Tapjoy::LDAP::API::User.destroy(opts[:username], opts[:type])
|
13
13
|
end
|
14
14
|
|
15
15
|
private
|
@@ -18,7 +18,7 @@ module Tapjoy
|
|
18
18
|
# Set help message
|
19
19
|
usage "user delete [options]"
|
20
20
|
|
21
|
-
opt :
|
21
|
+
opt :username, 'Specify username', type: :string, required: true
|
22
22
|
opt :force, 'Force delete'
|
23
23
|
opt :type, 'Specfy if this is a user or service account', type: :string, default: 'user'
|
24
24
|
end
|
data/lib/tapjoy/ldap/key/add.rb
CHANGED
@@ -20,7 +20,7 @@ module Tapjoy
|
|
20
20
|
usage 'key add [options]'
|
21
21
|
synopsis "\nThis command is for adding user keys to a given user's profile"
|
22
22
|
|
23
|
-
opt :
|
23
|
+
opt :username, 'Specify username to add key to', type: :string,
|
24
24
|
required: true
|
25
25
|
opt :filename, 'File to load keys from', type: :string
|
26
26
|
end
|
@@ -6,7 +6,7 @@ module Tapjoy
|
|
6
6
|
# Remove key from LDAP
|
7
7
|
def remove
|
8
8
|
keys # Get keys first
|
9
|
-
Tapjoy::LDAP::Key.verify_user(opts[:
|
9
|
+
Tapjoy::LDAP::Key.verify_user(opts[:username], results)
|
10
10
|
|
11
11
|
confirm unless opts[:force]
|
12
12
|
Tapjoy::LDAP.client.replace_attribute(
|
@@ -20,7 +20,7 @@ module Tapjoy
|
|
20
20
|
usage 'key remove [options]'
|
21
21
|
synopsis "\nThis command is for removing a user's SSH key(s)"
|
22
22
|
|
23
|
-
opt :
|
23
|
+
opt :username, 'Specify username to delete key from', type: :string,
|
24
24
|
required: true
|
25
25
|
opt :filename, 'File to load key deletion list from', type: :string
|
26
26
|
opt :force, 'Force delete', short: '-F'
|
data/lib/tapjoy/ldap/key/show.rb
CHANGED
@@ -17,7 +17,7 @@ module Tapjoy
|
|
17
17
|
usage 'key show [options]'
|
18
18
|
synopsis "\nThis command is for showing a specific user's SSH keys"
|
19
19
|
|
20
|
-
opt :
|
20
|
+
opt :username, 'Specify username', type: :string, required: true
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
data/lib/tapjoy/ldap/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ldap_tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ali Tayarani
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: trollop
|