cf-uaa-lib 3.10.0 → 3.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -1
- data/lib/uaa/scim.rb +69 -20
- data/lib/uaa/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: a39c7cac1bfb08a869bf7550ad7cf6bbe12773fe
|
4
|
+
data.tar.gz: 1d0ddccaa0bc2e16233f5b97c869b49039be14df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed1db7f178ef9bdf94698575429be99920f52e298c10bd9617a0fa045457647244a58e41ca288aa8c9e7eac9703433bbfe5239dfcbbe8a8c83ba1fb317233e2b
|
7
|
+
data.tar.gz: 7bb052fa64c0473588d24aeda1c855e556215fc82f891fc56b2f7f15f7ae7fa3967cb0ac300ff95b285c30a3ed80cd1d0cc748280c78e48bd95181b46595ff17
|
data/.travis.yml
CHANGED
data/lib/uaa/scim.rb
CHANGED
@@ -42,16 +42,27 @@ class Scim
|
|
42
42
|
|
43
43
|
def force_attr(k)
|
44
44
|
kd = k.to_s.downcase
|
45
|
-
kc = {
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
45
|
+
kc = {
|
46
|
+
'username' => 'userName',
|
47
|
+
'familyname' => 'familyName',
|
48
|
+
'givenname' => 'givenName',
|
49
|
+
'middlename' => 'middleName',
|
50
|
+
'honorificprefix' => 'honorificPrefix',
|
51
|
+
'honorificsuffix' => 'honorificSuffix',
|
52
|
+
'displayname' => 'displayName',
|
53
|
+
'nickname' => 'nickName',
|
54
|
+
'profileurl' => 'profileUrl',
|
55
|
+
'streetaddress' => 'streetAddress',
|
56
|
+
'postalcode' => 'postalCode',
|
57
|
+
'usertype' => 'userType',
|
58
|
+
'preferredlanguage' => 'preferredLanguage',
|
59
|
+
'x509certificates' => 'x509Certificates',
|
60
|
+
'lastmodified' => 'lastModified',
|
61
|
+
'externalid' => 'externalId',
|
62
|
+
'phonenumbers' => 'phoneNumbers',
|
63
|
+
'startindex' => 'startIndex',
|
64
|
+
'zoneid' => 'zoneId'
|
65
|
+
}[kd]
|
55
66
|
kc || kd
|
56
67
|
end
|
57
68
|
|
@@ -76,15 +87,46 @@ class Scim
|
|
76
87
|
|
77
88
|
# an attempt to hide some scim and uaa oddities
|
78
89
|
def type_info(type, elem)
|
79
|
-
scimfo = {
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
90
|
+
scimfo = {
|
91
|
+
user: {
|
92
|
+
path: '/Users',
|
93
|
+
name_attr: 'userName',
|
94
|
+
origin_attr: 'origin'
|
95
|
+
},
|
96
|
+
group: {
|
97
|
+
path: '/Groups',
|
98
|
+
name_attr: 'displayName',
|
99
|
+
origin_attr: 'zoneid'
|
100
|
+
},
|
101
|
+
client: {
|
102
|
+
path: '/oauth/clients',
|
103
|
+
name_attr: 'client_id'
|
104
|
+
},
|
105
|
+
user_id: {
|
106
|
+
path: '/ids/Users',
|
107
|
+
name_attr: 'userName',
|
108
|
+
origin_attr: 'origin',
|
109
|
+
},
|
110
|
+
group_mapping: {
|
111
|
+
path: '/Groups/External',
|
112
|
+
name_attr: 'externalGroup',
|
113
|
+
origin_attr: 'origin'
|
114
|
+
}
|
115
|
+
}
|
116
|
+
|
117
|
+
type_info = scimfo[type]
|
118
|
+
|
119
|
+
unless type_info
|
85
120
|
raise ArgumentError, "scim resource type must be one of #{scimfo.keys.inspect}"
|
86
121
|
end
|
87
|
-
|
122
|
+
|
123
|
+
value = type_info[elem]
|
124
|
+
|
125
|
+
unless value
|
126
|
+
raise ArgumentError, "scim schema element must be one of #{type_info.keys.inspect}"
|
127
|
+
end
|
128
|
+
|
129
|
+
value
|
88
130
|
end
|
89
131
|
|
90
132
|
def jkey(k) @key_style == :down ? k.to_s : k end
|
@@ -262,9 +304,16 @@ class Scim
|
|
262
304
|
# @param type (see #add)
|
263
305
|
# @return [Array] array of name/id hashes for each object found
|
264
306
|
def ids(type, *names)
|
265
|
-
|
266
|
-
|
267
|
-
|
307
|
+
name_attr = type_info(type, :name_attr)
|
308
|
+
origin_attr = type_info(type, :origin_attr)
|
309
|
+
|
310
|
+
filter = names.map do |n|
|
311
|
+
"#{name_attr} eq \"#{n}\""
|
312
|
+
end
|
313
|
+
|
314
|
+
attributes = ['id', name_attr, origin_attr]
|
315
|
+
|
316
|
+
all_pages(type, attributes: attributes.join(','), filter: filter.join(' or '))
|
268
317
|
end
|
269
318
|
|
270
319
|
# Convenience method to query for single object by name.
|
data/lib/uaa/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cf-uaa-lib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dave Syer
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2017-07-
|
15
|
+
date: 2017-07-28 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: multi_json
|