socialcast 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/lib/socialcast.rb +7 -2
- data/lib/socialcast/command_line/cli.rb +2 -2
- data/lib/socialcast/command_line/provision.rb +61 -28
- data/lib/socialcast/command_line/version.rb +1 -1
- data/spec/fixtures/credentials.yml +1 -1
- data/spec/fixtures/custom_credentials.yml +4 -0
- data/spec/fixtures/ldap_with_blank_basedn.yml +50 -0
- data/spec/fixtures/ldap_without_filter.yml +50 -0
- data/spec/socialcast/command_line/cli_spec.rb +4 -22
- data/spec/socialcast/command_line/provision_spec.rb +97 -5
- data/spec/socialcast/socialcast_spec.rb +33 -0
- metadata +37 -5
- checksums.yaml +0 -15
data/README.md
CHANGED
data/lib/socialcast.rb
CHANGED
@@ -8,19 +8,23 @@ module Socialcast
|
|
8
8
|
FileUtils.mkdir config_dir, :mode => 0700 unless File.exist?(config_dir)
|
9
9
|
config_dir
|
10
10
|
end
|
11
|
+
|
11
12
|
def self.credentials_file
|
12
|
-
File.join
|
13
|
+
ENV['SC_CREDENTIALS_FILE'] || File.join(config_dir, 'credentials.yml')
|
13
14
|
end
|
15
|
+
|
14
16
|
def self.credentials
|
15
17
|
fail 'Unknown Socialcast credentials. Run `socialcast authenticate` to initialize' unless File.exist?(credentials_file)
|
16
|
-
|
18
|
+
YAML.load_file(credentials_file)
|
17
19
|
end
|
20
|
+
|
18
21
|
def self.credentials=(options)
|
19
22
|
File.open(credentials_file, "w") do |f|
|
20
23
|
f.write(options.to_yaml)
|
21
24
|
end
|
22
25
|
File.chmod 0600, credentials_file
|
23
26
|
end
|
27
|
+
|
24
28
|
# configure restclient for api call
|
25
29
|
def self.resource_for_path(path, options = {}, debug = true)
|
26
30
|
RestClient.log = Logger.new(STDOUT) if debug
|
@@ -28,5 +32,6 @@ module Socialcast
|
|
28
32
|
url = ['https://', credentials[:domain], path].join
|
29
33
|
RestClient::Resource.new url, options.merge({ :user => credentials[:user], :password => credentials[:password] })
|
30
34
|
end
|
35
|
+
|
31
36
|
end
|
32
37
|
end
|
@@ -33,7 +33,7 @@ module Socialcast
|
|
33
33
|
include Thor::Actions
|
34
34
|
|
35
35
|
method_option :trace, :type => :boolean, :aliases => '-v'
|
36
|
-
def initialize(*args); super
|
36
|
+
def initialize(*args); super; end
|
37
37
|
|
38
38
|
desc "authenticate", "Authenticate using your Socialcast credentials"
|
39
39
|
method_option :user, :type => :string, :aliases => '-u', :desc => 'email address for the authenticated user'
|
@@ -47,7 +47,7 @@ module Socialcast
|
|
47
47
|
|
48
48
|
url = ['https://', domain, '/api/authentication'].join
|
49
49
|
say "Authenticating #{user} to #{url}"
|
50
|
-
params = {:email => user, :password => password }
|
50
|
+
params = { :email => user, :password => password }
|
51
51
|
RestClient.log = Logger.new(STDOUT) if options[:trace]
|
52
52
|
RestClient.proxy = options[:proxy] if options[:proxy]
|
53
53
|
resource = RestClient::Resource.new url
|
@@ -25,6 +25,27 @@ module Socialcast
|
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
+
def fetch_user_hash(identifier, options = {})
|
29
|
+
identifying_field = options.delete(:identifying_field) || 'unique_identifier'
|
30
|
+
|
31
|
+
each_ldap_connection do |connection_name, connection_config, ldap|
|
32
|
+
filter = if connection_config['filter'].present?
|
33
|
+
Net::LDAP::Filter.construct(connection_config['filter'])
|
34
|
+
else
|
35
|
+
Net::LDAP::Filter.pres("objectclass")
|
36
|
+
end
|
37
|
+
|
38
|
+
attr_mappings = attribute_mappings(connection_name)
|
39
|
+
|
40
|
+
filter = filter & Net::LDAP::Filter.construct("#{attr_mappings[identifying_field]}=#{identifier}")
|
41
|
+
|
42
|
+
search(ldap, :base => connection_config['basedn'], :filter => filter, :attributes => ldap_search_attributes(connection_name), :size => 1) do |entry, connection|
|
43
|
+
return build_user_hash_from_mappings(ldap, entry, attr_mappings, permission_mappings(connection_name))
|
44
|
+
end
|
45
|
+
end
|
46
|
+
nil
|
47
|
+
end
|
48
|
+
|
28
49
|
def provision
|
29
50
|
http_config = @ldap_config.fetch 'http', {}
|
30
51
|
|
@@ -46,8 +67,8 @@ module Socialcast
|
|
46
67
|
|
47
68
|
if @options[:sanity_check]
|
48
69
|
puts "Sanity checking users currently marked as needing to be terminated"
|
49
|
-
each_ldap_connection do |
|
50
|
-
attr_mappings = attribute_mappings(
|
70
|
+
each_ldap_connection do |connection_name, connection_config, ldap|
|
71
|
+
attr_mappings = attribute_mappings(connection_name)
|
51
72
|
(current_socialcast_users(http_config) - user_whitelist).each do |user_identifiers|
|
52
73
|
combined_filters = []
|
53
74
|
['email', 'unique_identifier', 'employee_number'].each_with_index do |identifier, index|
|
@@ -55,8 +76,8 @@ module Socialcast
|
|
55
76
|
end
|
56
77
|
combined_filters.compact!
|
57
78
|
filter = ((combined_filters.size > 1) ? '(|%s)' : '%s') % combined_filters.join(' ')
|
58
|
-
filter = Net::LDAP::Filter.construct(filter) & Net::LDAP::Filter.construct(
|
59
|
-
ldap_result = ldap.search(:return_result => true, :base =>
|
79
|
+
filter = Net::LDAP::Filter.construct(filter) & Net::LDAP::Filter.construct(connection_config["filter"])
|
80
|
+
ldap_result = ldap.search(:return_result => true, :base => connection_config["basedn"], :filter => filter, :attributes => ldap_search_attributes(connection_name))
|
60
81
|
raise ProvisionError.new "Found user marked for termination that should not be terminated: #{user_identifiers}" unless ldap_result.blank?
|
61
82
|
end
|
62
83
|
end
|
@@ -85,8 +106,8 @@ module Socialcast
|
|
85
106
|
def sync_photos
|
86
107
|
http_config = @ldap_config.fetch 'http', {}
|
87
108
|
|
88
|
-
@ldap_config["connections"].keys.each do |
|
89
|
-
attribute_mappings(
|
109
|
+
@ldap_config["connections"].keys.each do |connection_name|
|
110
|
+
attribute_mappings(connection_name).fetch('profile_photo')
|
90
111
|
end
|
91
112
|
|
92
113
|
search_users_resource = Socialcast::CommandLine.resource_for_path '/api/users/search', http_config
|
@@ -129,14 +150,29 @@ module Socialcast
|
|
129
150
|
|
130
151
|
private
|
131
152
|
|
132
|
-
def dereference_mail(entry,
|
153
|
+
def dereference_mail(entry, ldap, dn_field, mail_attribute)
|
133
154
|
dn = grab(entry, dn_field)
|
134
|
-
|
155
|
+
ldap.search(:base => dn, :scope => Net::LDAP::SearchScope_BaseObject) do |manager_entry|
|
135
156
|
return grab(manager_entry, mail_attribute)
|
136
157
|
end
|
137
158
|
end
|
138
159
|
|
139
|
-
def
|
160
|
+
def search(ldap, search_options)
|
161
|
+
options_for_search = if search_options[:base].present?
|
162
|
+
Array.wrap(search_options)
|
163
|
+
else
|
164
|
+
distinguished_names = Array.wrap(ldap.search_root_dse.namingcontexts)
|
165
|
+
options_for_search = distinguished_names.map { |dn| search_options.merge(:base => dn ) }
|
166
|
+
end
|
167
|
+
|
168
|
+
options_for_search.each do |options|
|
169
|
+
ldap.search(options) do |entry|
|
170
|
+
yield(entry)
|
171
|
+
end
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
175
|
+
def build_user_hash_from_mappings(ldap, entry, attr_mappings, perm_mappings)
|
140
176
|
user_hash = HashWithIndifferentAccess.new
|
141
177
|
primary_attributes = %w{unique_identifier first_name last_name employee_number}
|
142
178
|
primary_attributes.each do |attribute|
|
@@ -156,7 +192,7 @@ module Socialcast
|
|
156
192
|
user_hash['custom_fields'] = []
|
157
193
|
custom_attributes.each do |attribute|
|
158
194
|
if attribute == 'manager'
|
159
|
-
user_hash['custom_fields'] << { 'id' => 'manager_email', 'label' => 'manager_email', 'value' => dereference_mail(entry,
|
195
|
+
user_hash['custom_fields'] << { 'id' => 'manager_email', 'label' => 'manager_email', 'value' => dereference_mail(entry, ldap, attr_mappings[attribute], attr_mappings['email']) }
|
160
196
|
else
|
161
197
|
user_hash['custom_fields'] << { 'id' => attribute, 'label' => attribute, 'value' => grab(entry, attr_mappings[attribute]) }
|
162
198
|
end
|
@@ -185,14 +221,13 @@ module Socialcast
|
|
185
221
|
user_hash
|
186
222
|
end
|
187
223
|
|
188
|
-
|
189
224
|
def each_ldap_entry(&block)
|
190
225
|
count = 0
|
191
226
|
|
192
|
-
each_ldap_connection do |
|
193
|
-
attr_mappings = attribute_mappings(
|
194
|
-
perm_mappings = permission_mappings(
|
195
|
-
|
227
|
+
each_ldap_connection do |connection_name, connection_config, ldap|
|
228
|
+
attr_mappings = attribute_mappings(connection_name)
|
229
|
+
perm_mappings = permission_mappings(connection_name)
|
230
|
+
search(ldap, :return_result => false, :filter => connection_config["filter"], :base => connection_config["basedn"], :attributes => ldap_search_attributes(connection_name)) do |entry|
|
196
231
|
if grab(entry, attr_mappings["email"]).present? || (attr_mappings.has_key?("unique_identifier") && grab(entry, attr_mappings["unique_identifier"]).present?)
|
197
232
|
yield ldap, entry, attr_mappings, perm_mappings
|
198
233
|
end
|
@@ -204,26 +239,24 @@ module Socialcast
|
|
204
239
|
puts "Finished scanning #{count} users"
|
205
240
|
end
|
206
241
|
|
207
|
-
|
208
242
|
def each_ldap_connection
|
209
|
-
@ldap_config["connections"].each_pair do |
|
210
|
-
puts "Connecting to #{
|
211
|
-
ldap = create_ldap_instance(
|
212
|
-
|
213
|
-
yield ldap_connection_name, connection, ldap
|
243
|
+
@ldap_config["connections"].each_pair do |connection_name, connection_config|
|
244
|
+
puts "Connecting to #{connection_name} at #{[connection_config["host"], connection_config["port"]].join(':')} with base DN #{connection_config['basedn']} and filter #{connection_config['filter']}"
|
245
|
+
ldap = create_ldap_instance(connection_config)
|
246
|
+
yield connection_name, connection_config, ldap
|
214
247
|
end
|
215
248
|
end
|
216
249
|
|
217
|
-
def create_ldap_instance(
|
218
|
-
ldap = Net::LDAP.new :host =>
|
219
|
-
ldap.encryption
|
220
|
-
ldap.auth
|
250
|
+
def create_ldap_instance(connection_config)
|
251
|
+
ldap = Net::LDAP.new :host => connection_config["host"], :port => connection_config["port"], :base => connection_config["basedn"]
|
252
|
+
ldap.encryption connection_config['encryption'].to_sym if connection_config['encryption']
|
253
|
+
ldap.auth connection_config["username"], connection_config["password"]
|
221
254
|
ldap
|
222
255
|
end
|
223
256
|
|
224
|
-
def ldap_search_attributes(
|
225
|
-
attr_mappings = attribute_mappings(
|
226
|
-
perm_mappings = permission_mappings(
|
257
|
+
def ldap_search_attributes(connection_name)
|
258
|
+
attr_mappings = attribute_mappings(connection_name)
|
259
|
+
perm_mappings = permission_mappings(connection_name)
|
227
260
|
|
228
261
|
membership_attribute = perm_mappings.fetch 'attribute_name', 'memberof'
|
229
262
|
attributes = attr_mappings.values.map do |mapping_value|
|
@@ -0,0 +1,50 @@
|
|
1
|
+
---
|
2
|
+
# LDAP connections
|
3
|
+
connections:
|
4
|
+
example_connection_1:
|
5
|
+
username: "cn=Directory Manager"
|
6
|
+
password: "test"
|
7
|
+
host: localhost
|
8
|
+
port: 1389
|
9
|
+
basedn:
|
10
|
+
filter: "(mail=*)"
|
11
|
+
|
12
|
+
|
13
|
+
# LDAP attribute mappings
|
14
|
+
mappings:
|
15
|
+
first_name: givenName
|
16
|
+
last_name: sn
|
17
|
+
email: mail
|
18
|
+
# only use employee_number if the email is unknown
|
19
|
+
# employee_number: emp_id
|
20
|
+
# only use unique_identifier if you do not wish to use email as the main user identification method
|
21
|
+
# unique_identifier: samaccountname
|
22
|
+
|
23
|
+
|
24
|
+
# Map LDAP Group Memberships to Socialcast Permissions
|
25
|
+
permission_mappings:
|
26
|
+
# configure LDAP field for group memberships (ex: memberof, isMemberOf, etc)
|
27
|
+
attribute_name: isMemberOf
|
28
|
+
account_types:
|
29
|
+
external: "cn=External,dc=example,dc=com"
|
30
|
+
roles:
|
31
|
+
tenant_admin: "cn=Admins,dc=example,dc=com"
|
32
|
+
sbi_admin: "cn=SbiAdmins,dc=example,dc=com"
|
33
|
+
reach_admin: "cn=ReachAdmins,dc=example,dc=com"
|
34
|
+
town_hall_admin: "cn=TownHallAdmins,dc=example,dc=com"
|
35
|
+
|
36
|
+
|
37
|
+
# general script options
|
38
|
+
options:
|
39
|
+
# cleanup the extracted ldap data file after run is complete
|
40
|
+
delete_users_file: false
|
41
|
+
# skip sending emails to newly activated users
|
42
|
+
skip_emails: true
|
43
|
+
# do not actually provision accounts
|
44
|
+
# useful during testing
|
45
|
+
test: true
|
46
|
+
|
47
|
+
|
48
|
+
# http options for connecting to Socialcast servers
|
49
|
+
http:
|
50
|
+
timeout: 660
|
@@ -0,0 +1,50 @@
|
|
1
|
+
---
|
2
|
+
# LDAP connections
|
3
|
+
connections:
|
4
|
+
example_connection_1:
|
5
|
+
username: "cn=Directory Manager"
|
6
|
+
password: "test"
|
7
|
+
host: localhost
|
8
|
+
port: 1389
|
9
|
+
basedn: "dc=example,dc=com"
|
10
|
+
filter:
|
11
|
+
|
12
|
+
|
13
|
+
# LDAP attribute mappings
|
14
|
+
mappings:
|
15
|
+
first_name: givenName
|
16
|
+
last_name: sn
|
17
|
+
email: mail
|
18
|
+
# only use employee_number if the email is unknown
|
19
|
+
# employee_number: emp_id
|
20
|
+
# only use unique_identifier if you do not wish to use email as the main user identification method
|
21
|
+
# unique_identifier: samaccountname
|
22
|
+
|
23
|
+
|
24
|
+
# Map LDAP Group Memberships to Socialcast Permissions
|
25
|
+
permission_mappings:
|
26
|
+
# configure LDAP field for group memberships (ex: memberof, isMemberOf, etc)
|
27
|
+
attribute_name: isMemberOf
|
28
|
+
account_types:
|
29
|
+
external: "cn=External,dc=example,dc=com"
|
30
|
+
roles:
|
31
|
+
tenant_admin: "cn=Admins,dc=example,dc=com"
|
32
|
+
sbi_admin: "cn=SbiAdmins,dc=example,dc=com"
|
33
|
+
reach_admin: "cn=ReachAdmins,dc=example,dc=com"
|
34
|
+
town_hall_admin: "cn=TownHallAdmins,dc=example,dc=com"
|
35
|
+
|
36
|
+
|
37
|
+
# general script options
|
38
|
+
options:
|
39
|
+
# cleanup the extracted ldap data file after run is complete
|
40
|
+
delete_users_file: false
|
41
|
+
# skip sending emails to newly activated users
|
42
|
+
skip_emails: true
|
43
|
+
# do not actually provision accounts
|
44
|
+
# useful during testing
|
45
|
+
test: true
|
46
|
+
|
47
|
+
|
48
|
+
# http options for connecting to Socialcast servers
|
49
|
+
http:
|
50
|
+
timeout: 660
|
@@ -12,11 +12,14 @@ describe Socialcast::CommandLine::CLI do
|
|
12
12
|
let(:ldap_with_profile_photo_config) { YAML.load_file(ldap_with_profile_photo_config_file) }
|
13
13
|
let(:ldap_without_permission_mappings_config) { YAML.load_file(File.join(File.dirname(__FILE__), '..', '..', 'fixtures', 'ldap_without_permission_mappings.yml')) }
|
14
14
|
|
15
|
+
before do
|
16
|
+
Socialcast::CommandLine.stub(:credentials).and_return(credentials)
|
17
|
+
end
|
18
|
+
|
15
19
|
describe '#share' do
|
16
20
|
# Expects -u=emily@socialcast.com -p=demo --domain=demo.socialcast.com
|
17
21
|
context 'with a basic message' do
|
18
22
|
before do
|
19
|
-
Socialcast::CommandLine.stub(:credentials).and_return(credentials)
|
20
23
|
stub_request(:post, "https://ryan%40socialcast.com:foo@test.staging.socialcast.com/api/messages.json").
|
21
24
|
with(:body => { "message" => { "body" => "testing", "url" => nil, "message_type" => nil, "attachment_ids" => [], "group_id" => nil }}).
|
22
25
|
with(:headers => {'Accept' => 'application/json'}).
|
@@ -31,7 +34,6 @@ describe Socialcast::CommandLine::CLI do
|
|
31
34
|
|
32
35
|
context 'with a message_type message' do
|
33
36
|
before do
|
34
|
-
Socialcast::CommandLine.stub(:credentials).and_return(credentials)
|
35
37
|
stub_request(:post, "https://ryan%40socialcast.com:foo@test.staging.socialcast.com/api/messages.json").
|
36
38
|
with(:body => /message\_type\"\:review\_request/).
|
37
39
|
with(:body => /please\sreview/).
|
@@ -46,7 +48,6 @@ describe Socialcast::CommandLine::CLI do
|
|
46
48
|
end
|
47
49
|
context 'with a group_id param' do
|
48
50
|
before do
|
49
|
-
Socialcast::CommandLine.stub(:credentials).and_return(credentials)
|
50
51
|
stub_request(:post, "https://ryan%40socialcast.com:foo@test.staging.socialcast.com/api/messages.json").
|
51
52
|
with(:body => /group\_id\"\:123/).
|
52
53
|
with(:headers => {'Accept' => 'application/json'}).
|
@@ -60,7 +61,6 @@ describe Socialcast::CommandLine::CLI do
|
|
60
61
|
end
|
61
62
|
context "with a proxy" do
|
62
63
|
before do
|
63
|
-
Socialcast::CommandLine.stub(:credentials).and_return(credentials)
|
64
64
|
stub_request(:post, "https://ryan%40socialcast.com:foo@test.staging.socialcast.com/api/messages.json").
|
65
65
|
with(:body => /message\_type\"\:null/).
|
66
66
|
with(:body => /testing/).
|
@@ -93,7 +93,6 @@ describe Socialcast::CommandLine::CLI do
|
|
93
93
|
@entry[:jpegPhoto] = photo_data
|
94
94
|
Net::LDAP.any_instance.stub(:search).and_yield(@entry)
|
95
95
|
|
96
|
-
Socialcast::CommandLine.stub(:credentials).and_return(credentials)
|
97
96
|
user_search_resource = double(:user_search_resource)
|
98
97
|
search_api_response = {
|
99
98
|
'users' => [
|
@@ -131,7 +130,6 @@ describe Socialcast::CommandLine::CLI do
|
|
131
130
|
@entry[:jpegPhoto] = photo_data
|
132
131
|
Net::LDAP.any_instance.stub(:search).and_yield(@entry)
|
133
132
|
|
134
|
-
Socialcast::CommandLine.stub(:credentials).and_return(credentials)
|
135
133
|
user_search_resource = double(:user_search_resource)
|
136
134
|
search_api_response = {
|
137
135
|
'users' => [
|
@@ -165,7 +163,6 @@ describe Socialcast::CommandLine::CLI do
|
|
165
163
|
@entry[:jpegPhoto] = "\x89PNGabc"
|
166
164
|
Net::LDAP.any_instance.stub(:search).and_yield(@entry)
|
167
165
|
|
168
|
-
Socialcast::CommandLine.stub(:credentials).and_return(credentials)
|
169
166
|
user_search_resource = double(:user_search_resource)
|
170
167
|
search_api_response = {
|
171
168
|
'users' => [
|
@@ -202,7 +199,6 @@ describe Socialcast::CommandLine::CLI do
|
|
202
199
|
|
203
200
|
@result = ''
|
204
201
|
Zlib::GzipWriter.stub(:open).and_yield(@result)
|
205
|
-
Socialcast::CommandLine.stub(:credentials).and_return(credentials)
|
206
202
|
Socialcast::CommandLine::CLI.any_instance.should_receive(:ldap_config).and_return(ldap_without_permission_mappings_config)
|
207
203
|
File.stub(:open).with(/users.xml.gz/, anything).and_yield(@result)
|
208
204
|
|
@@ -218,7 +214,6 @@ describe Socialcast::CommandLine::CLI do
|
|
218
214
|
|
219
215
|
@result = ''
|
220
216
|
Zlib::GzipWriter.stub(:open).and_yield(@result)
|
221
|
-
Socialcast::CommandLine.stub(:credentials).and_return(credentials)
|
222
217
|
Socialcast::CommandLine::CLI.any_instance.should_receive(:ldap_config).and_return(ldap_without_permission_mappings_config)
|
223
218
|
|
224
219
|
File.stub(:open).with(/users.xml.gz/, anything).and_yield(@result)
|
@@ -235,7 +230,6 @@ describe Socialcast::CommandLine::CLI do
|
|
235
230
|
|
236
231
|
@result = ''
|
237
232
|
Zlib::GzipWriter.stub(:open).and_yield(@result)
|
238
|
-
Socialcast::CommandLine.stub(:credentials).and_return(credentials)
|
239
233
|
Socialcast::CommandLine::CLI.any_instance.should_receive(:ldap_config).and_return(ldap_without_permission_mappings_config)
|
240
234
|
|
241
235
|
File.stub(:open).with(/users.xml.gz/, anything).and_yield(@result)
|
@@ -256,7 +250,6 @@ describe Socialcast::CommandLine::CLI do
|
|
256
250
|
|
257
251
|
@result = ''
|
258
252
|
Zlib::GzipWriter.stub(:open).and_yield(@result)
|
259
|
-
Socialcast::CommandLine.stub(:credentials).and_return(credentials)
|
260
253
|
Socialcast::CommandLine::CLI.any_instance.should_receive(:ldap_config).with(hash_including('config' => '/my/path/to/ldap.yml')).and_return(ldap_without_permission_mappings_config)
|
261
254
|
File.stub(:open).with(/users.xml.gz/, anything).and_yield(@result)
|
262
255
|
RestClient::Resource.any_instance.stub(:post)
|
@@ -273,7 +266,6 @@ describe Socialcast::CommandLine::CLI do
|
|
273
266
|
|
274
267
|
@result = ''
|
275
268
|
Zlib::GzipWriter.stub(:open).and_yield(@result)
|
276
|
-
Socialcast::CommandLine.stub(:credentials).and_return(credentials)
|
277
269
|
Socialcast::CommandLine::CLI.any_instance.should_receive(:ldap_config).and_return(ldap_without_permission_mappings_config)
|
278
270
|
File.stub(:open).with(/users.xml.gz/, anything).and_yield(@result)
|
279
271
|
RestClient::Resource.any_instance.stub(:post)
|
@@ -292,7 +284,6 @@ describe Socialcast::CommandLine::CLI do
|
|
292
284
|
|
293
285
|
@result = ''
|
294
286
|
Zlib::GzipWriter.stub(:open).and_yield(@result)
|
295
|
-
Socialcast::CommandLine.stub(:credentials).and_return(credentials)
|
296
287
|
Socialcast::CommandLine::CLI.any_instance.should_receive(:ldap_config).and_return(ldap_with_plugin_mapping_config)
|
297
288
|
File.stub(:open).with(/users.xml.gz/, anything).and_yield(@result)
|
298
289
|
RestClient::Resource.any_instance.stub(:post)
|
@@ -312,7 +303,6 @@ describe Socialcast::CommandLine::CLI do
|
|
312
303
|
|
313
304
|
@result = ''
|
314
305
|
Zlib::GzipWriter.stub(:open).and_yield(@result)
|
315
|
-
Socialcast::CommandLine.stub(:credentials).and_return(credentials)
|
316
306
|
Socialcast::CommandLine::CLI.any_instance.should_receive(:ldap_config).and_return(ldap_without_permission_mappings_config)
|
317
307
|
File.stub(:open).with(/users.xml.gz/, anything).and_yield(@result)
|
318
308
|
|
@@ -334,7 +324,6 @@ describe Socialcast::CommandLine::CLI do
|
|
334
324
|
|
335
325
|
@result = ''
|
336
326
|
Zlib::GzipWriter.stub(:open).and_yield(@result)
|
337
|
-
Socialcast::CommandLine.stub(:credentials).and_return(credentials)
|
338
327
|
Socialcast::CommandLine::CLI.any_instance.should_receive(:ldap_config).and_return(ldap_default_config)
|
339
328
|
File.stub(:open).with(/users.xml.gz/, anything).and_yield(@result)
|
340
329
|
|
@@ -356,7 +345,6 @@ describe Socialcast::CommandLine::CLI do
|
|
356
345
|
|
357
346
|
@result = ''
|
358
347
|
Zlib::GzipWriter.stub(:open).and_yield(@result)
|
359
|
-
Socialcast::CommandLine.stub(:credentials).and_return(credentials)
|
360
348
|
Socialcast::CommandLine::CLI.any_instance.should_receive(:ldap_config).and_return(ldap_with_array_permission_mapping_config)
|
361
349
|
File.stub(:open).with(/users.xml.gz/, anything).and_yield(@result)
|
362
350
|
|
@@ -379,7 +367,6 @@ describe Socialcast::CommandLine::CLI do
|
|
379
367
|
|
380
368
|
@result = ''
|
381
369
|
Zlib::GzipWriter.stub(:open).and_yield(@result)
|
382
|
-
Socialcast::CommandLine.stub(:credentials).and_return(credentials)
|
383
370
|
Socialcast::CommandLine::CLI.any_instance.should_receive(:ldap_config).and_return(ldap_default_config)
|
384
371
|
File.stub(:open).with(/users.xml.gz/, anything).and_yield(@result)
|
385
372
|
|
@@ -404,7 +391,6 @@ describe Socialcast::CommandLine::CLI do
|
|
404
391
|
|
405
392
|
@result = ''
|
406
393
|
Zlib::GzipWriter.stub(:open).and_yield(@result)
|
407
|
-
Socialcast::CommandLine.stub(:credentials).and_return(credentials)
|
408
394
|
Socialcast::CommandLine::CLI.any_instance.should_receive(:ldap_config).and_return(ldap_with_array_permission_mapping_config)
|
409
395
|
File.stub(:open).with(/users.xml.gz/, anything).and_yield(@result)
|
410
396
|
|
@@ -429,7 +415,6 @@ describe Socialcast::CommandLine::CLI do
|
|
429
415
|
|
430
416
|
@result = ''
|
431
417
|
Zlib::GzipWriter.stub(:open).and_yield(@result)
|
432
|
-
Socialcast::CommandLine.stub(:credentials).and_return(credentials)
|
433
418
|
Socialcast::CommandLine::CLI.any_instance.should_receive(:ldap_config).and_return(ldap_with_array_permission_mapping_config)
|
434
419
|
File.stub(:open).with(/users.xml.gz/, anything).and_yield(@result)
|
435
420
|
|
@@ -456,7 +441,6 @@ describe Socialcast::CommandLine::CLI do
|
|
456
441
|
|
457
442
|
@result = ''
|
458
443
|
Zlib::GzipWriter.stub(:open).and_yield(@result)
|
459
|
-
Socialcast::CommandLine.stub(:credentials).and_return(credentials)
|
460
444
|
Socialcast::CommandLine::CLI.any_instance.should_receive(:ldap_config).and_return(ldap_with_interpolated_values_config)
|
461
445
|
File.stub(:open).with(/users.xml.gz/, anything).and_yield(@result)
|
462
446
|
|
@@ -482,7 +466,6 @@ describe Socialcast::CommandLine::CLI do
|
|
482
466
|
|
483
467
|
@result = ''
|
484
468
|
Zlib::GzipWriter.stub(:open).and_yield(@result)
|
485
|
-
Socialcast::CommandLine.stub(:credentials).and_return(credentials)
|
486
469
|
Socialcast::CommandLine::CLI.any_instance.should_receive(:ldap_config).and_return(ldap_with_manager_attribute_config)
|
487
470
|
File.stub(:open).with(/users.xml.gz/, anything).and_yield(@result)
|
488
471
|
|
@@ -512,7 +495,6 @@ describe Socialcast::CommandLine::CLI do
|
|
512
495
|
|
513
496
|
@result = ''
|
514
497
|
Zlib::GzipWriter.stub(:open).and_yield(@result)
|
515
|
-
Socialcast::CommandLine.stub(:credentials).and_return(credentials)
|
516
498
|
Socialcast::CommandLine::CLI.any_instance.should_receive(:ldap_config).and_return(ldap_default_config)
|
517
499
|
File.stub(:open).with(/users.xml.gz/, anything).and_yield(@result)
|
518
500
|
|
@@ -3,6 +3,7 @@ require 'spec_helper'
|
|
3
3
|
describe Socialcast::CommandLine::Provision do
|
4
4
|
let!(:credentials) { YAML.load_file(File.join(File.dirname(__FILE__), '..', '..', 'fixtures', 'credentials.yml')) }
|
5
5
|
let!(:ldap_default_config) { YAML.load_file(File.join(File.dirname(__FILE__), '..', '..', 'fixtures', 'ldap.yml')) }
|
6
|
+
let!(:ldap_blank_basedn_config) { YAML.load_file(File.join(File.dirname(__FILE__), '..', '..', 'fixtures', 'ldap_with_blank_basedn.yml')) }
|
6
7
|
let!(:ldap_connection_mapping_config) { YAML.load_file(File.join(File.dirname(__FILE__), '..', '..', 'fixtures', 'ldap_with_connection_mapping.yml')) }
|
7
8
|
let!(:ldap_connection_permission_mapping_config) { YAML.load_file(File.join(File.dirname(__FILE__), '..', '..', 'fixtures', 'ldap_with_connection_permission_mapping.yml')) }
|
8
9
|
let!(:ldap_multiple_connection_mapping_config) { YAML.load_file(File.join(File.dirname(__FILE__), '..', '..', 'fixtures', 'ldap_with_multiple_connection_mappings.yml')) }
|
@@ -15,6 +16,7 @@ describe Socialcast::CommandLine::Provision do
|
|
15
16
|
let!(:ldap_with_roles_without_account_type_config) { YAML.load_file(File.join(File.dirname(__FILE__), '..', '..', 'fixtures', 'ldap_with_roles_without_account_type.yml')) }
|
16
17
|
let!(:ldap_with_unique_identifier_config) { YAML.load_file(File.join(File.dirname(__FILE__), '..', '..', 'fixtures', 'ldap_with_unique_identifier.yml')) }
|
17
18
|
let!(:ldap_without_account_type_or_roles_config) { YAML.load_file(File.join(File.dirname(__FILE__), '..', '..', 'fixtures', 'ldap_without_account_type_or_roles.yml')) }
|
19
|
+
let!(:ldap_without_filter_config) { YAML.load_file(File.join(File.dirname(__FILE__), '..', '..', 'fixtures', 'ldap_without_filter.yml')) }
|
18
20
|
|
19
21
|
def create_entry(entry_attributes)
|
20
22
|
Net::LDAP::Entry.new("dc=example,dc=com").tap do |e|
|
@@ -132,12 +134,12 @@ describe Socialcast::CommandLine::Provision do
|
|
132
134
|
before do
|
133
135
|
provision_instance = Socialcast::CommandLine::Provision.new(ldap_multiple_connection_mapping_config, {})
|
134
136
|
|
135
|
-
ldap_instance1 = double
|
137
|
+
ldap_instance1 = double(Net::LDAP)
|
136
138
|
provision_instance.should_receive(:create_ldap_instance).once.ordered.and_return(ldap_instance1)
|
137
139
|
entry1 = create_entry :mailCon => 'user@example.com', :givenName => 'first name', :sn => 'last name'
|
138
140
|
ldap_instance1.should_receive(:search).once.with(hash_including(:attributes => ['mailCon', 'isMemberOf'])).and_yield(entry1)
|
139
141
|
|
140
|
-
ldap_instance2 = double
|
142
|
+
ldap_instance2 = double(Net::LDAP)
|
141
143
|
provision_instance.should_receive(:create_ldap_instance).once.ordered.and_return(ldap_instance2)
|
142
144
|
entry2 = create_entry :mailCon2 => 'user2@example.com', :firstName => 'first name2', :sn => 'last name2'
|
143
145
|
ldap_instance2.should_receive(:search).once.with(hash_including(:attributes => ['mailCon2', 'firstName', 'isMemberOf'])).and_yield(entry2)
|
@@ -190,7 +192,7 @@ describe Socialcast::CommandLine::Provision do
|
|
190
192
|
before do
|
191
193
|
provision_instance = Socialcast::CommandLine::Provision.new(ldap_with_manager_attribute_config, {})
|
192
194
|
|
193
|
-
ldap_instance = double
|
195
|
+
ldap_instance = double(Net::LDAP)
|
194
196
|
provision_instance.should_receive(:create_ldap_instance).once.ordered.and_return(ldap_instance)
|
195
197
|
|
196
198
|
user_entry = create_entry :mail => 'user@example.com', :ldap_manager => 'cn=theboss,dc=example,dc=com'
|
@@ -358,12 +360,12 @@ describe Socialcast::CommandLine::Provision do
|
|
358
360
|
before do
|
359
361
|
provision_instance = Socialcast::CommandLine::Provision.new(ldap_multiple_connection_permission_mapping_config, {})
|
360
362
|
|
361
|
-
ldap_instance1 = double
|
363
|
+
ldap_instance1 = double(Net::LDAP)
|
362
364
|
provision_instance.should_receive(:create_ldap_instance).once.ordered.and_return(ldap_instance1)
|
363
365
|
entry1 = create_entry :mail => 'user@example.com', :givenName => 'first name', :sn => 'last name', :memberOf => ["cn=External,dc=example,dc=com", "cn=SbiAdmins,dc=example,dc=com", "cn=TownHallAdmins,dc=example,dc=com"]
|
364
366
|
ldap_instance1.should_receive(:search).once.with(hash_including(:attributes => ['givenName', 'sn', 'mail', 'memberOf'])).and_yield(entry1)
|
365
367
|
|
366
|
-
ldap_instance2 = double
|
368
|
+
ldap_instance2 = double(Net::LDAP)
|
367
369
|
provision_instance.should_receive(:create_ldap_instance).once.ordered.and_return(ldap_instance2)
|
368
370
|
entry2 = create_entry :mail => 'user@example.com', :givenName => 'first name', :sn => 'last name', :member => ["cn=Contractors,dc=example,dc=com", "cn=SbiAdmins,dc=example,dc=com", "cn=TownHallAdmins,dc=example,dc=com"]
|
369
371
|
ldap_instance2.should_receive(:search).once.with(hash_including(:attributes => ['givenName', 'sn', 'mail', 'member'])).and_yield(entry2)
|
@@ -383,6 +385,28 @@ describe Socialcast::CommandLine::Provision do
|
|
383
385
|
it_behaves_like "permission attributes are mapped properly"
|
384
386
|
end
|
385
387
|
end
|
388
|
+
|
389
|
+
context "with no basedn configured" do
|
390
|
+
before do
|
391
|
+
RestClient::Resource.any_instance.should_receive(:post).once.with(hash_including(:file => result), { :accept => :json })
|
392
|
+
|
393
|
+
provision_instance = Socialcast::CommandLine::Provision.new(ldap_blank_basedn_config, {})
|
394
|
+
|
395
|
+
root_entry = create_entry(:namingcontexts => ['dc=foo,dc=com', 'dc=bar,dc=com'])
|
396
|
+
ldap_instance = double(Net::LDAP)
|
397
|
+
ldap_instance.should_receive(:search_root_dse).once.and_return(root_entry)
|
398
|
+
provision_instance.should_receive(:create_ldap_instance).once.ordered.and_return(ldap_instance)
|
399
|
+
|
400
|
+
user_entry = create_entry :mail => 'user@example.com', :givenName => 'first name', :sn => 'last name'
|
401
|
+
ldap_instance.should_receive(:search).once.ordered.with(hash_including(:base => 'dc=foo,dc=com', :attributes => ['givenName', 'sn', 'mail', 'isMemberOf']))
|
402
|
+
ldap_instance.should_receive(:search).once.ordered.with(hash_including(:base => 'dc=bar,dc=com', :attributes => ['givenName', 'sn', 'mail', 'isMemberOf'])).and_yield(user_entry)
|
403
|
+
|
404
|
+
provision_instance.provision
|
405
|
+
end
|
406
|
+
it "searches all basedns and puts the user in the output file" do
|
407
|
+
result.should =~ /user@example.com/
|
408
|
+
end
|
409
|
+
end
|
386
410
|
end
|
387
411
|
|
388
412
|
describe '#dereference_mail' do
|
@@ -427,6 +451,74 @@ describe Socialcast::CommandLine::Provision do
|
|
427
451
|
end
|
428
452
|
end
|
429
453
|
|
454
|
+
describe "#fetch_user_hash" do
|
455
|
+
context "without specifying an identifying field" do
|
456
|
+
let(:provision_instance) { Socialcast::CommandLine::Provision.new(ldap_with_unique_identifier_config, {}) }
|
457
|
+
let(:entry) { create_entry :uid => 'unique identifier', :givenName => 'first name', :sn => 'last name' }
|
458
|
+
before do
|
459
|
+
filter = Net::LDAP::Filter.construct('(&(mail=*)(uid=unique identifier))')
|
460
|
+
Net::LDAP.any_instance.should_receive(:search).once
|
461
|
+
.with(hash_including(:attributes => ['givenName', 'sn', 'uid', 'isMemberOf'], :filter => filter))
|
462
|
+
.and_yield(entry)
|
463
|
+
end
|
464
|
+
it do
|
465
|
+
provision_instance.fetch_user_hash('unique identifier').should == {
|
466
|
+
'account_type' => 'member',
|
467
|
+
'contact_info' => {},
|
468
|
+
'custom_fields' => [],
|
469
|
+
'first_name' => 'first name',
|
470
|
+
'last_name' => 'last name',
|
471
|
+
'roles' => [],
|
472
|
+
'unique_identifier' => 'unique identifier'
|
473
|
+
}
|
474
|
+
end
|
475
|
+
end
|
476
|
+
context "specifying an identifying field" do
|
477
|
+
let(:provision_instance) { Socialcast::CommandLine::Provision.new(ldap_default_config, {}) }
|
478
|
+
let(:entry) { create_entry :mail => 'user@example.com', :givenName => 'first name', :sn => 'last name' }
|
479
|
+
before do
|
480
|
+
filter = Net::LDAP::Filter.construct('(&(mail=*)(mail=user@example.com))')
|
481
|
+
Net::LDAP.any_instance.should_receive(:search).once
|
482
|
+
.with(hash_including(:attributes => ['givenName', 'sn', 'mail', 'isMemberOf'], :filter => filter))
|
483
|
+
.and_yield(entry)
|
484
|
+
end
|
485
|
+
it do
|
486
|
+
provision_instance.fetch_user_hash('user@example.com', :identifying_field => 'email').should == {
|
487
|
+
'account_type' => 'member',
|
488
|
+
'contact_info' => {
|
489
|
+
'email' => 'user@example.com'
|
490
|
+
},
|
491
|
+
'custom_fields' => [],
|
492
|
+
'first_name' => 'first name',
|
493
|
+
'last_name' => 'last name',
|
494
|
+
'roles' => []
|
495
|
+
}
|
496
|
+
end
|
497
|
+
end
|
498
|
+
context "without a filter specified" do
|
499
|
+
let(:provision_instance) { Socialcast::CommandLine::Provision.new(ldap_without_filter_config, {}) }
|
500
|
+
let(:entry) { create_entry :mail => 'user@example.com', :givenName => 'first name', :sn => 'last name' }
|
501
|
+
before do
|
502
|
+
filter = Net::LDAP::Filter.construct('(&(objectclass=*)(mail=user@example.com))')
|
503
|
+
Net::LDAP.any_instance.should_receive(:search).once
|
504
|
+
.with(hash_including(:attributes => ['givenName', 'sn', 'mail', 'isMemberOf'], :filter => filter))
|
505
|
+
.and_yield(entry)
|
506
|
+
end
|
507
|
+
it do
|
508
|
+
provision_instance.fetch_user_hash('user@example.com', :identifying_field => 'email').should == {
|
509
|
+
'account_type' => 'member',
|
510
|
+
'contact_info' => {
|
511
|
+
'email' => 'user@example.com'
|
512
|
+
},
|
513
|
+
'custom_fields' => [],
|
514
|
+
'first_name' => 'first name',
|
515
|
+
'last_name' => 'last name',
|
516
|
+
'roles' => []
|
517
|
+
}
|
518
|
+
end
|
519
|
+
end
|
520
|
+
end
|
521
|
+
|
430
522
|
describe "#grab" do
|
431
523
|
let(:provision_instance) { Socialcast::CommandLine::Provision.new(ldap_with_plugin_mapping_config, :plugins => 'socialcast/command_line/fake_attribute_map') }
|
432
524
|
let(:entry) do
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Socialcast::CommandLine do
|
4
|
+
|
5
|
+
let(:custom_file) { File.join(File.dirname(__FILE__), '..', 'fixtures', 'custom_credentials.yml') }
|
6
|
+
let(:stubbed_credentials) { File.join(File.dirname(__FILE__), '..', 'fixtures') }
|
7
|
+
before { Socialcast::CommandLine.stub(:config_dir).and_return(stubbed_credentials) }
|
8
|
+
|
9
|
+
describe '#credentials_file' do
|
10
|
+
subject { Socialcast::CommandLine.credentials_file }
|
11
|
+
context 'with ENV variable' do
|
12
|
+
before { ENV['SC_CREDENTIALS_FILE'] = custom_file }
|
13
|
+
after { ENV['SC_CREDENTIALS_FILE'] = nil }
|
14
|
+
it { should == custom_file }
|
15
|
+
end
|
16
|
+
context 'without ENV variable' do
|
17
|
+
it { should == File.join(Socialcast::CommandLine.config_dir, 'credentials.yml') }
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
describe '#credentials' do
|
22
|
+
subject { Socialcast::CommandLine.credentials }
|
23
|
+
describe 'with ENV variable' do
|
24
|
+
before { ENV['SC_CREDENTIALS_FILE'] = custom_file }
|
25
|
+
after { ENV['SC_CREDENTIALS_FILE'] = nil }
|
26
|
+
it { subject[:user].should == 'mike@socialcast.com' }
|
27
|
+
end
|
28
|
+
describe 'without ENV variable' do
|
29
|
+
it { subject[:user].should == 'ryan@socialcast.com' }
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: socialcast
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Ryan Sonnek
|
@@ -10,11 +11,12 @@ authors:
|
|
10
11
|
autorequire:
|
11
12
|
bindir: bin
|
12
13
|
cert_chain: []
|
13
|
-
date: 2014-03-
|
14
|
+
date: 2014-03-27 00:00:00.000000000 Z
|
14
15
|
dependencies:
|
15
16
|
- !ruby/object:Gem::Dependency
|
16
17
|
name: rest-client
|
17
18
|
requirement: !ruby/object:Gem::Requirement
|
19
|
+
none: false
|
18
20
|
requirements:
|
19
21
|
- - ~>
|
20
22
|
- !ruby/object:Gem::Version
|
@@ -22,6 +24,7 @@ dependencies:
|
|
22
24
|
type: :runtime
|
23
25
|
prerelease: false
|
24
26
|
version_requirements: !ruby/object:Gem::Requirement
|
27
|
+
none: false
|
25
28
|
requirements:
|
26
29
|
- - ~>
|
27
30
|
- !ruby/object:Gem::Version
|
@@ -29,6 +32,7 @@ dependencies:
|
|
29
32
|
- !ruby/object:Gem::Dependency
|
30
33
|
name: json
|
31
34
|
requirement: !ruby/object:Gem::Requirement
|
35
|
+
none: false
|
32
36
|
requirements:
|
33
37
|
- - ~>
|
34
38
|
- !ruby/object:Gem::Version
|
@@ -39,6 +43,7 @@ dependencies:
|
|
39
43
|
type: :runtime
|
40
44
|
prerelease: false
|
41
45
|
version_requirements: !ruby/object:Gem::Requirement
|
46
|
+
none: false
|
42
47
|
requirements:
|
43
48
|
- - ~>
|
44
49
|
- !ruby/object:Gem::Version
|
@@ -49,6 +54,7 @@ dependencies:
|
|
49
54
|
- !ruby/object:Gem::Dependency
|
50
55
|
name: thor
|
51
56
|
requirement: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
52
58
|
requirements:
|
53
59
|
- - ~>
|
54
60
|
- !ruby/object:Gem::Version
|
@@ -59,6 +65,7 @@ dependencies:
|
|
59
65
|
type: :runtime
|
60
66
|
prerelease: false
|
61
67
|
version_requirements: !ruby/object:Gem::Requirement
|
68
|
+
none: false
|
62
69
|
requirements:
|
63
70
|
- - ~>
|
64
71
|
- !ruby/object:Gem::Version
|
@@ -69,6 +76,7 @@ dependencies:
|
|
69
76
|
- !ruby/object:Gem::Dependency
|
70
77
|
name: highline
|
71
78
|
requirement: !ruby/object:Gem::Requirement
|
79
|
+
none: false
|
72
80
|
requirements:
|
73
81
|
- - ~>
|
74
82
|
- !ruby/object:Gem::Version
|
@@ -79,6 +87,7 @@ dependencies:
|
|
79
87
|
type: :runtime
|
80
88
|
prerelease: false
|
81
89
|
version_requirements: !ruby/object:Gem::Requirement
|
90
|
+
none: false
|
82
91
|
requirements:
|
83
92
|
- - ~>
|
84
93
|
- !ruby/object:Gem::Version
|
@@ -89,6 +98,7 @@ dependencies:
|
|
89
98
|
- !ruby/object:Gem::Dependency
|
90
99
|
name: socialcast-net-ldap
|
91
100
|
requirement: !ruby/object:Gem::Requirement
|
101
|
+
none: false
|
92
102
|
requirements:
|
93
103
|
- - ~>
|
94
104
|
- !ruby/object:Gem::Version
|
@@ -99,6 +109,7 @@ dependencies:
|
|
99
109
|
type: :runtime
|
100
110
|
prerelease: false
|
101
111
|
version_requirements: !ruby/object:Gem::Requirement
|
112
|
+
none: false
|
102
113
|
requirements:
|
103
114
|
- - ~>
|
104
115
|
- !ruby/object:Gem::Version
|
@@ -109,6 +120,7 @@ dependencies:
|
|
109
120
|
- !ruby/object:Gem::Dependency
|
110
121
|
name: activeresource
|
111
122
|
requirement: !ruby/object:Gem::Requirement
|
123
|
+
none: false
|
112
124
|
requirements:
|
113
125
|
- - ~>
|
114
126
|
- !ruby/object:Gem::Version
|
@@ -116,6 +128,7 @@ dependencies:
|
|
116
128
|
type: :runtime
|
117
129
|
prerelease: false
|
118
130
|
version_requirements: !ruby/object:Gem::Requirement
|
131
|
+
none: false
|
119
132
|
requirements:
|
120
133
|
- - ~>
|
121
134
|
- !ruby/object:Gem::Version
|
@@ -123,6 +136,7 @@ dependencies:
|
|
123
136
|
- !ruby/object:Gem::Dependency
|
124
137
|
name: activesupport
|
125
138
|
requirement: !ruby/object:Gem::Requirement
|
139
|
+
none: false
|
126
140
|
requirements:
|
127
141
|
- - ~>
|
128
142
|
- !ruby/object:Gem::Version
|
@@ -130,6 +144,7 @@ dependencies:
|
|
130
144
|
type: :runtime
|
131
145
|
prerelease: false
|
132
146
|
version_requirements: !ruby/object:Gem::Requirement
|
147
|
+
none: false
|
133
148
|
requirements:
|
134
149
|
- - ~>
|
135
150
|
- !ruby/object:Gem::Version
|
@@ -137,6 +152,7 @@ dependencies:
|
|
137
152
|
- !ruby/object:Gem::Dependency
|
138
153
|
name: rspec
|
139
154
|
requirement: !ruby/object:Gem::Requirement
|
155
|
+
none: false
|
140
156
|
requirements:
|
141
157
|
- - ~>
|
142
158
|
- !ruby/object:Gem::Version
|
@@ -144,6 +160,7 @@ dependencies:
|
|
144
160
|
type: :development
|
145
161
|
prerelease: false
|
146
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
none: false
|
147
164
|
requirements:
|
148
165
|
- - ~>
|
149
166
|
- !ruby/object:Gem::Version
|
@@ -151,6 +168,7 @@ dependencies:
|
|
151
168
|
- !ruby/object:Gem::Dependency
|
152
169
|
name: webmock
|
153
170
|
requirement: !ruby/object:Gem::Requirement
|
171
|
+
none: false
|
154
172
|
requirements:
|
155
173
|
- - ~>
|
156
174
|
- !ruby/object:Gem::Version
|
@@ -161,6 +179,7 @@ dependencies:
|
|
161
179
|
type: :development
|
162
180
|
prerelease: false
|
163
181
|
version_requirements: !ruby/object:Gem::Requirement
|
182
|
+
none: false
|
164
183
|
requirements:
|
165
184
|
- - ~>
|
166
185
|
- !ruby/object:Gem::Version
|
@@ -171,6 +190,7 @@ dependencies:
|
|
171
190
|
- !ruby/object:Gem::Dependency
|
172
191
|
name: rake
|
173
192
|
requirement: !ruby/object:Gem::Requirement
|
193
|
+
none: false
|
174
194
|
requirements:
|
175
195
|
- - '='
|
176
196
|
- !ruby/object:Gem::Version
|
@@ -178,6 +198,7 @@ dependencies:
|
|
178
198
|
type: :development
|
179
199
|
prerelease: false
|
180
200
|
version_requirements: !ruby/object:Gem::Requirement
|
201
|
+
none: false
|
181
202
|
requirements:
|
182
203
|
- - '='
|
183
204
|
- !ruby/object:Gem::Version
|
@@ -185,6 +206,7 @@ dependencies:
|
|
185
206
|
- !ruby/object:Gem::Dependency
|
186
207
|
name: pry
|
187
208
|
requirement: !ruby/object:Gem::Requirement
|
209
|
+
none: false
|
188
210
|
requirements:
|
189
211
|
- - ~>
|
190
212
|
- !ruby/object:Gem::Version
|
@@ -192,6 +214,7 @@ dependencies:
|
|
192
214
|
type: :development
|
193
215
|
prerelease: false
|
194
216
|
version_requirements: !ruby/object:Gem::Requirement
|
217
|
+
none: false
|
195
218
|
requirements:
|
196
219
|
- - ~>
|
197
220
|
- !ruby/object:Gem::Version
|
@@ -224,10 +247,12 @@ files:
|
|
224
247
|
- socialcast.gemspec
|
225
248
|
- spec/fixtures/credentials.yml
|
226
249
|
- spec/fixtures/credentials_with_proxy.yml
|
250
|
+
- spec/fixtures/custom_credentials.yml
|
227
251
|
- spec/fixtures/fake_attribute_map.rb
|
228
252
|
- spec/fixtures/ldap.yml
|
229
253
|
- spec/fixtures/ldap_with_account_type_without_roles.yml
|
230
254
|
- spec/fixtures/ldap_with_array_permission_mapping.yml
|
255
|
+
- spec/fixtures/ldap_with_blank_basedn.yml
|
231
256
|
- spec/fixtures/ldap_with_class_ldap_attribute.yml
|
232
257
|
- spec/fixtures/ldap_with_connection_mapping.yml
|
233
258
|
- spec/fixtures/ldap_with_connection_permission_mapping.yml
|
@@ -241,41 +266,46 @@ files:
|
|
241
266
|
- spec/fixtures/ldap_with_roles_without_account_type.yml
|
242
267
|
- spec/fixtures/ldap_with_unique_identifier.yml
|
243
268
|
- spec/fixtures/ldap_without_account_type_or_roles.yml
|
269
|
+
- spec/fixtures/ldap_without_filter.yml
|
244
270
|
- spec/fixtures/ldap_without_permission_mappings.yml
|
245
271
|
- spec/socialcast/command_line/cli_spec.rb
|
246
272
|
- spec/socialcast/command_line/provision_spec.rb
|
273
|
+
- spec/socialcast/socialcast_spec.rb
|
247
274
|
- spec/spec_helper.rb
|
248
275
|
homepage: http://github.com/socialcast/socialcast-command-line
|
249
276
|
licenses:
|
250
277
|
- MIT
|
251
|
-
metadata: {}
|
252
278
|
post_install_message:
|
253
279
|
rdoc_options: []
|
254
280
|
require_paths:
|
255
281
|
- lib
|
256
282
|
required_ruby_version: !ruby/object:Gem::Requirement
|
283
|
+
none: false
|
257
284
|
requirements:
|
258
285
|
- - ! '>='
|
259
286
|
- !ruby/object:Gem::Version
|
260
287
|
version: '0'
|
261
288
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
289
|
+
none: false
|
262
290
|
requirements:
|
263
291
|
- - ! '>='
|
264
292
|
- !ruby/object:Gem::Version
|
265
293
|
version: '0'
|
266
294
|
requirements: []
|
267
295
|
rubyforge_project: socialcast
|
268
|
-
rubygems_version:
|
296
|
+
rubygems_version: 1.8.23
|
269
297
|
signing_key:
|
270
|
-
specification_version:
|
298
|
+
specification_version: 3
|
271
299
|
summary: command line interface to socialcast api
|
272
300
|
test_files:
|
273
301
|
- spec/fixtures/credentials.yml
|
274
302
|
- spec/fixtures/credentials_with_proxy.yml
|
303
|
+
- spec/fixtures/custom_credentials.yml
|
275
304
|
- spec/fixtures/fake_attribute_map.rb
|
276
305
|
- spec/fixtures/ldap.yml
|
277
306
|
- spec/fixtures/ldap_with_account_type_without_roles.yml
|
278
307
|
- spec/fixtures/ldap_with_array_permission_mapping.yml
|
308
|
+
- spec/fixtures/ldap_with_blank_basedn.yml
|
279
309
|
- spec/fixtures/ldap_with_class_ldap_attribute.yml
|
280
310
|
- spec/fixtures/ldap_with_connection_mapping.yml
|
281
311
|
- spec/fixtures/ldap_with_connection_permission_mapping.yml
|
@@ -289,7 +319,9 @@ test_files:
|
|
289
319
|
- spec/fixtures/ldap_with_roles_without_account_type.yml
|
290
320
|
- spec/fixtures/ldap_with_unique_identifier.yml
|
291
321
|
- spec/fixtures/ldap_without_account_type_or_roles.yml
|
322
|
+
- spec/fixtures/ldap_without_filter.yml
|
292
323
|
- spec/fixtures/ldap_without_permission_mappings.yml
|
293
324
|
- spec/socialcast/command_line/cli_spec.rb
|
294
325
|
- spec/socialcast/command_line/provision_spec.rb
|
326
|
+
- spec/socialcast/socialcast_spec.rb
|
295
327
|
- spec/spec_helper.rb
|
checksums.yaml
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
---
|
2
|
-
!binary "U0hBMQ==":
|
3
|
-
metadata.gz: !binary |-
|
4
|
-
NGRhZWZlNmVkZGY1ODEwZTcyNTJkMmYyZmE4ZjQ3Yzc4ZWIwNDIyNw==
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
MDMzZGZiZjdmN2NkOTk5NzZjYTU2MzY3YzIxZDQxZWNkMmQxNWMwNw==
|
7
|
-
SHA512:
|
8
|
-
metadata.gz: !binary |-
|
9
|
-
MmEzZWUwYjZlZDk1ZGM3NWRkYjNlYWRiMWU3NGIxZTg3ZWEzOTg2NGRiZGFk
|
10
|
-
NDk4MGQ0NWI1OGNmZWMzYTEwZWJmZDg0NjI3OGRlZmViNmI0YjAxNjQ2NGU4
|
11
|
-
M2I1NmZmYTllYWRlMjkwZmY2YTY2ZjgyZDdmZTYwYjY3ZTFhNzI=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
MTJmNDA3MTQ1ZDdkMDhhNDMyOWNiNjcyZTRhN2UzOWU2YjEzMDJmY2RiNDk3
|
14
|
-
YzZjMzMzNDdmYWYxMzllMmM0MGUxZTFiNTRiNzViZDVlZGRmZTQ1YjA4ZmRm
|
15
|
-
YjJiMzVjMzlmOGVlNDEzYzEzYTNhMTlkYzg5MGVlMmEwZTkyMTk=
|