faction 1.0.1 → 1.0.2

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: 1f1ca35d8a221707263110bcca33049c689ed3eb
4
- data.tar.gz: e1d09d37d9586b529cfcd542a886cec014b295bd
3
+ metadata.gz: b6b289e5d7b4b727c31146ba332a748670e707f2
4
+ data.tar.gz: 01f0faecca07c48910f49d2f905c88c8833b0d4c
5
5
  SHA512:
6
- metadata.gz: 0b16390ecd4f8b9c3e8081d368c78d22b9268c490d92ee565631f9a3be8b8ca26854bfe0b2a5991528c2aac5ef7896c1bb0080f46e0fbb0115163b6a73156078
7
- data.tar.gz: 9a46d4663ca5882da3edbad675ffb079cdae9964dced03d976218840cf6642d442bd0a0bb6d5b988dfde8f141e59cdb48cb734cb6cdb2c2ed06944e47566959f
6
+ metadata.gz: d7b940ed6e9f928533804d3431f64978e2e569ea8df342847d0efc102b0e24c9cfdcf74382024aca9e7b7cf3be27f9f00cb1eaacf91c9d13ce7b2acce366aef8
7
+ data.tar.gz: 00b06eefdf3dc1700c761d6adf1484ba5c0f1159c525282e34f837f8848ea5bfa4b4e7115507b057c155f80bc31d58702982ea077fc404d2b00957d6f9f0e686
@@ -168,11 +168,33 @@ module Faction #:nodoc:
168
168
  authenticated_crowd_call(:add_principal_to_group, principal, group) && nil
169
169
  end
170
170
 
171
+ def remove_principal(principal)
172
+ authenticated_crowd_call(:remove_principal, principal) && nil
173
+ end
174
+
175
+ def add_principal(username, password, description, active, attributes)
176
+ soap_attributes = attributes.map do |name, value|
177
+ {'p:SOAPAttribute' => {'p:name' => name, 'p:values' => {'wsdl:string' => value}}}
178
+ end
179
+ soap_principal = {
180
+ 'p:active' => active,
181
+ 'p:name' => username,
182
+ 'p:description' => description,
183
+ 'p:attributes' => soap_attributes
184
+ }
185
+ credential = {
186
+ 'auth:credential' => password,
187
+ 'auth:encryptedCredential' => false
188
+ }
189
+ simplify_soap_attributes(authenticated_crowd_call(:add_principal, soap_principal, credential))
190
+ end
191
+
171
192
  private
172
193
 
173
194
  CROWD_NAMESPACES = {
174
195
  'xmlns:wsdl' => 'urn:SecurityServer',
175
196
  'xmlns:auth' => 'http://authentication.integration.crowd.atlassian.com',
197
+ 'xmlns:p' => 'http://soap.integration.crowd.atlassian.com',
176
198
  'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema',
177
199
  'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance'
178
200
  }
@@ -1,3 +1,3 @@
1
1
  module Faction
2
- VERSION = '1.0.1'
2
+ VERSION = '1.0.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faction
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Olli Helenius
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-27 00:00:00.000000000 Z
11
+ date: 2014-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -88,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
88
88
  version: '0'
89
89
  requirements: []
90
90
  rubyforge_project:
91
- rubygems_version: 2.2.2
91
+ rubygems_version: 2.3.0
92
92
  signing_key:
93
93
  specification_version: 4
94
94
  summary: A simple Savon-based client for Atlassian Crowd SOAP API