scim-shady 0.2.1 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/.gitlab-ci.yml +2 -2
  3. data/.travis.yml +2 -2
  4. data/README.md +6 -5
  5. data/lib/scim/shady.rb +6 -19
  6. data/lib/scim/shady/enterprise_user.rb +93 -0
  7. data/lib/scim/shady/group.rb +49 -17
  8. data/lib/scim/shady/user.rb +550 -63
  9. data/lib/scim/shady/version.rb +1 -1
  10. data/scim-shady.gemspec +3 -2
  11. metadata +12 -38
  12. data/lib/scim/shady/address.rb +0 -41
  13. data/lib/scim/shady/buildable.rb +0 -21
  14. data/lib/scim/shady/builders.rb +0 -14
  15. data/lib/scim/shady/builders/addresses.rb +0 -24
  16. data/lib/scim/shady/builders/bulk.rb +0 -19
  17. data/lib/scim/shady/builders/emails.rb +0 -16
  18. data/lib/scim/shady/builders/filter.rb +0 -17
  19. data/lib/scim/shady/builders/groups.rb +0 -16
  20. data/lib/scim/shady/builders/instant_messengers.rb +0 -16
  21. data/lib/scim/shady/builders/metadata.rb +0 -29
  22. data/lib/scim/shady/builders/name.rb +0 -27
  23. data/lib/scim/shady/builders/phone_numbers.rb +0 -16
  24. data/lib/scim/shady/builders/photos.rb +0 -16
  25. data/lib/scim/shady/builders/resource.rb +0 -26
  26. data/lib/scim/shady/builders/service_provider_config.rb +0 -87
  27. data/lib/scim/shady/builders/user.rb +0 -96
  28. data/lib/scim/shady/builders/x509_certificates.rb +0 -16
  29. data/lib/scim/shady/instant_messenger.rb +0 -21
  30. data/lib/scim/shady/metadata.rb +0 -45
  31. data/lib/scim/shady/name.rb +0 -17
  32. data/lib/scim/shady/phone_number.rb +0 -29
  33. data/lib/scim/shady/photo.rb +0 -29
  34. data/lib/scim/shady/resource.rb +0 -25
  35. data/lib/scim/shady/schemas.rb +0 -17
  36. data/lib/scim/shady/service_provider_config.rb +0 -71
  37. data/lib/scim/shady/x509_certificate.rb +0 -17
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ed697fd0d3f49326a30c48d69a08b84b8a7318ac80fcbe85a3623044d8dad985
4
- data.tar.gz: b4af2762d9e406d9ca0146535cbf20069660741be44a2dd73ddcf60211bc66fc
3
+ metadata.gz: e749381083da99407f60b25743511599c847c962b2bc9f51e802dae7bf8db58b
4
+ data.tar.gz: a4a49dd535c632dcd73a415280d722c43a72a13c4715c7c6c0063fa3862b3e04
5
5
  SHA512:
6
- metadata.gz: 63de2a911b7b8ed26dda1cfc773f8c8e9b069c0668294b3c5dbb5985d4e5efff18bfa5f5e528029d7888a26386d400c488507200e7669dc45c4ca09ccc24a872
7
- data.tar.gz: e143182d15144dfa28247133c9deeea4d33f8c0d8eea7e30fb1ff952e24a08d96131666f583e014deb993980f2bb0f3688a724e09ad9944ed0b222508a90f4dc
6
+ metadata.gz: 74af7e82ef27bf01479463d1212b608e9220629403e34ed91e3c1abeb4c70468d3b244a14fa77cf31cd117035aa62a1a621cb012fa3ab2e58019f6ba2d1f416f
7
+ data.tar.gz: 0e5f463c6cf2869c0515b6ef8b6854120bd285d188443bec2e40ab33376010571b81ecfc340647d24c8f5e312199a0ba30e4c140713675c82483859e96ddf686
@@ -1,4 +1,4 @@
1
- image: ruby:2.2
1
+ image: ruby:2.6
2
2
 
3
3
  before_script:
4
4
  - apt-get update && apt-get install -y locales
@@ -7,7 +7,7 @@ before_script:
7
7
  - export LC_ALL=en_US.UTF-8
8
8
  - ruby -v
9
9
  - which ruby
10
- - gem install bundler --no-ri --no-rdoc
10
+ - gem install bundler
11
11
  - bundle install --jobs $(nproc) "${FLAGS[@]}"
12
12
 
13
13
  rspec:
@@ -1,6 +1,6 @@
1
1
  sudo: false
2
2
  language: ruby
3
3
  rvm:
4
- - 2.5.0
5
- before_install: gem install bundler -v 1.16.1
4
+ - 2.6.1
5
+ before_install: gem install bundler
6
6
  script: bundle exec rspec
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # Scim::Shady
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/scim/shady`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ This gem provides the default SCIM schemas described in [RFC-7643](https://tools.ietf.org/html/rfc7643).
6
4
 
7
5
  ## Installation
8
6
 
@@ -22,7 +20,10 @@ Or install it yourself as:
22
20
 
23
21
  ## Usage
24
22
 
25
- TODO: Write usage instructions here
23
+ See `spec/scim/*_spec.rb` for example usage.
24
+
25
+ For more advanced scenarios, considering using
26
+ [scim-kit](https://github.com/mokhan/scim-kit).
26
27
 
27
28
  ## Development
28
29
 
@@ -32,7 +33,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
32
33
 
33
34
  ## Contributing
34
35
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/scim-shady.
36
+ Bug reports and pull requests are welcome on GitHub at https://github.com/mokhan/scim-shady.
36
37
 
37
38
  ## License
38
39
 
@@ -1,23 +1,10 @@
1
- require "forwardable"
2
- require "json"
3
- require "time"
4
- require "active_support/concern"
1
+ require 'json'
2
+ require 'scim-kit'
5
3
 
6
- require "scim/shady/address"
7
- require "scim/shady/buildable"
8
- require "scim/shady/builders"
9
- require "scim/shady/group"
10
- require "scim/shady/instant_messenger"
11
- require "scim/shady/metadata"
12
- require "scim/shady/name"
13
- require "scim/shady/phone_number"
14
- require "scim/shady/photo"
15
- require "scim/shady/resource"
16
- require "scim/shady/schemas"
17
- require "scim/shady/service_provider_config"
18
- require "scim/shady/user"
19
- require "scim/shady/version"
20
- require "scim/shady/x509_certificate"
4
+ require 'scim/shady/enterprise_user'
5
+ require 'scim/shady/user'
6
+ require 'scim/shady/group'
7
+ require 'scim/shady/version'
21
8
 
22
9
  module Scim
23
10
  module Shady
@@ -0,0 +1,93 @@
1
+ module Scim
2
+ module Shady
3
+ class EnterpriseUser < ::Scim::Kit::V2::Resource
4
+ def initialize(attributes = {})
5
+ super(schemas: [User.schema, self.class.schema], attributes: attributes)
6
+ end
7
+
8
+ def self.schema(location: "/v2/Schemas/urn:ietf:params:scim:schemas:extension:enterprise:2.0:User")
9
+ schema = ::Scim::Kit::V2::Schema.new(id: "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User", name: 'EnterpriseUser', location: location)
10
+ schema.add_attribute(name: :employee_number, type: :string) do |x|
11
+ x.multi_valued = false
12
+ x.description = "Numeric or alphanumeric identifier assigned to a person, typically based on order of hire or association with an organization."
13
+ x.required = false
14
+ x.case_exact = false
15
+ x.mutability = :read_write
16
+ x.returned = :default
17
+ x.uniqueness = :none
18
+ end
19
+ schema.add_attribute(name: :cost_center, type: :string) do |x|
20
+ x.multi_valued = false
21
+ x.description = "Identifies the name of a cost center."
22
+ x.required = false
23
+ x.case_exact = false
24
+ x.mutability = :read_write
25
+ x.returned = :default
26
+ x.uniqueness = :none
27
+ end
28
+ schema.add_attribute(name: :organization, type: :string) do |x|
29
+ x.multi_valued = false
30
+ x.description = "Identifies the name of an organization."
31
+ x.required = false
32
+ x.case_exact = false
33
+ x.mutability = :read_write
34
+ x.returned = :default
35
+ x.uniqueness = :none
36
+ end
37
+ schema.add_attribute(name: :division, type: :string) do |x|
38
+ x.multi_valued = false
39
+ x.description = "Identifies the name of a division."
40
+ x.required = false
41
+ x.case_exact = false
42
+ x.mutability = :read_write
43
+ x.returned = :default
44
+ x.uniqueness = :none
45
+ end
46
+ schema.add_attribute(name: :department, type: :string) do |x|
47
+ x.multi_valued = false
48
+ x.description = "Identifies the name of a department."
49
+ x.required = false
50
+ x.case_exact = false
51
+ x.mutability = :read_write
52
+ x.returned = :default
53
+ x.uniqueness = :none
54
+ end
55
+ schema.add_attribute(name: :manager, type: :complex) do |x|
56
+ x.multi_valued = false
57
+ x.description = ""
58
+ x.required = false
59
+ x.mutability = :read_write
60
+ x.returned = :default
61
+ x.add_attribute(name: :value, type: :string) do |y|
62
+ y.multi_valued = false
63
+ y.description = ""
64
+ y.required = false
65
+ y.case_exact = false
66
+ y.mutability = :read_write
67
+ y.returned = :default
68
+ y.uniqueness = :none
69
+ end
70
+ x.add_attribute(name: '$ref', type: :reference) do |y|
71
+ y.multi_valued = false
72
+ y.description = ""
73
+ y.required = false
74
+ y.case_exact = false
75
+ y.mutability = :read_write
76
+ y.returned = :default
77
+ y.uniqueness = :none
78
+ end
79
+ x.add_attribute(name: :display_name, type: :string) do |y|
80
+ y.multi_valued = false
81
+ y.description = ""
82
+ y.required = false
83
+ y.case_exact = false
84
+ y.mutability = :read_only
85
+ y.returned = :default
86
+ y.uniqueness = :none
87
+ end
88
+ end
89
+ schema
90
+ end
91
+ end
92
+ end
93
+ end
@@ -1,24 +1,56 @@
1
1
  module Scim
2
2
  module Shady
3
- class Group
4
- def initialize(hash)
5
- @hash = hash
3
+ class Group < ::Scim::Kit::V2::Resource
4
+ def initialize(attributes = {})
5
+ super(schemas: [self.class.schema], attributes: attributes)
6
6
  end
7
7
 
8
- def value
9
- to_h['value']
10
- end
11
-
12
- def reference
13
- to_h['$ref']
14
- end
15
-
16
- def display
17
- to_h['display']
18
- end
19
-
20
- def to_h
21
- @hash
8
+ def self.schema(location: "/v2/Schemas/#{::Scim::Kit::V2::Schemas::GROUP}")
9
+ schema = ::Scim::Kit::V2::Schema.new(id: ::Scim::Kit::V2::Schemas::GROUP, name: 'Group', location: location)
10
+ schema.add_attribute(name: :display_name, type: :string) do |x|
11
+ x.multi_valued = false
12
+ x.description = "A human-readable name for the Group. REQUIRED."
13
+ x.required = false
14
+ x.case_exact = false
15
+ x.mutability = :read_write
16
+ x.returned = :default
17
+ x.uniqueness = :none
18
+ end
19
+ schema.add_attribute(name: :members, type: :complex) do |x|
20
+ x.multi_valued = true
21
+ x.description = "A list of members of the Group."
22
+ x.required = false
23
+ x.add_attribute(name: :value, type: :string) do |y|
24
+ y.multi_valued = false
25
+ y.description = "Identifier of the member of this Group."
26
+ y.required = false
27
+ y.case_exact = false
28
+ y.mutability = :immutable
29
+ y.returned = :default
30
+ y.uniqueness = :none
31
+ end
32
+ x.add_attribute(name: '$ref', type: :reference) do |y|
33
+ y.reference_types = ['User', 'Group']
34
+ y.multi_valued = false
35
+ y.description = "The URI corresponding to a SCIM resource that is a member of this Group."
36
+ y.required = false
37
+ y.case_exact = false
38
+ y.mutability = :immutable
39
+ y.returned = :default
40
+ y.uniqueness = :none
41
+ end
42
+ x.add_attribute(name: :type, type: :string) do |y|
43
+ y.multi_valued = false
44
+ y.description = "A label indicating the type of resource, e.g., 'User' or 'Group'."
45
+ y.required = false
46
+ y.case_exact = false
47
+ y.canonical_values = ['User', 'Group']
48
+ y.mutability = :immutable
49
+ y.returned = :default
50
+ y.uniqueness = :none
51
+ end
52
+ end
53
+ schema
22
54
  end
23
55
  end
24
56
  end
@@ -1,70 +1,557 @@
1
1
  module Scim
2
2
  module Shady
3
- class User < Resource
4
- include Buildable
5
-
6
- def username
7
- to_h['userName']
8
- end
9
-
10
- def external_id
11
- to_h['externalId']
12
- end
13
-
14
- def name
15
- Name.new(to_h)
16
- end
17
-
18
- def addresses
19
- to_h['addresses'].map { |x| Address.new(x) }
20
- end
21
-
22
- def phone_numbers
23
- to_h['phoneNumbers'].map { |x| PhoneNumber.new(x) }
24
- end
25
-
26
- def instant_messengers
27
- to_h['ims'].map { |x| InstantMessenger.new(x) }
28
- end
29
-
30
- def photos
31
- to_h['photos'].map { |x| Photo.new(x) }
32
- end
33
-
34
- def user_type
35
- to_h['userType']
36
- end
37
-
38
- def title
39
- to_h['title']
40
- end
41
-
42
- def preferred_language
43
- to_h['preferredLanguage']
44
- end
45
-
46
- def locale
47
- to_h['locale']
48
- end
49
-
50
- def timezone
51
- to_h['timezone']
52
- end
53
-
54
- def active?
55
- to_h['active']
56
- end
57
-
58
- def groups
59
- to_h['groups'].map { |x| Group.new(x) }
60
- end
61
-
62
- def x509_certificates
63
- to_h['x509Certificates'].map { |x| X509Certificate.new(x) }
3
+ class User < ::Scim::Kit::V2::Resource
4
+ def initialize(attributes = {})
5
+ super(schemas: [self.class.schema], attributes: attributes)
64
6
  end
65
7
 
66
- def self.builder_class
67
- Scim::Shady::Builders::User
8
+ def self.schema(location: "/v2/Schemas/#{::Scim::Kit::V2::Schemas::USER}")
9
+ schema = ::Scim::Kit::V2::Schema.new(id: ::Scim::Kit::V2::Schemas::USER, name: 'User', location: location)
10
+ schema.add_attribute(name: :user_name) do |x|
11
+ x.multi_valued = false
12
+ x.description = "Unique identifier for the User, typically used by the user to directly authenticate to the service provider. Each User MUST include a non-empty userName value. This identifier MUST be unique across the service provider's entire set of Users. REQUIRED."
13
+ x.required = true
14
+ x.case_exact = false
15
+ x.mutability = :read_write
16
+ x.returned = :default
17
+ x.uniqueness = :server
18
+ end
19
+ schema.add_attribute(name: :name, type: :complex) do |x|
20
+ x.multi_valued = false
21
+ x.description = "The components of the user's real name. Providers MAY return just the full name as a single string in the formatted sub-attribute, or they MAY return just the individual component attributes using the other sub-attributes, or they MAY return both. If both variants are returned, they SHOULD be describing the same name, with the formatted name indicating how the component attributes should be combined."
22
+ x.required = false
23
+ x.mutability = :read_write
24
+ x.returned = :default
25
+ x.uniqueness = :none
26
+ x.add_attribute(name: :formatted) do |y|
27
+ y.multi_valued = false
28
+ y.description = "The full name, including all middle names, titles, and suffixes as appropriate, formatted for display (e.g., 'Ms. Barbara J Jensen, III')."
29
+ y.required = false
30
+ y.case_exact = false
31
+ y.mutability = :read_write
32
+ y.returned = :default
33
+ y.uniqueness = :none
34
+ end
35
+ x.add_attribute(name: :family_name) do |y|
36
+ y.multi_valued = false
37
+ y.description = "The family name of the User, or last name in most Western languages (e.g., 'Jensen' given the full name 'Ms. Barbara J Jensen, III')."
38
+ y.required = false
39
+ y.case_exact = false
40
+ y.mutability = :read_write
41
+ y.returned = :default
42
+ y.uniqueness = :none
43
+ end
44
+ x.add_attribute(name: :given_name) do |y|
45
+ y.multi_valued = false
46
+ y.description = "The given name of the User, or first name in most Western languages (e.g., 'Barbara' given the full name 'Ms. Barbara J Jensen, III')."
47
+ y.required = false
48
+ y.case_exact = false
49
+ y.mutability = :read_write
50
+ y.returned = :default
51
+ y.uniqueness = :none
52
+ end
53
+ x.add_attribute(name: :middle_name) do |y|
54
+ y.multi_valued = false
55
+ y.description = "The middle name(s) of the User (e.g., 'Jane' given the full name 'Ms. Barbara J Jensen, III')."
56
+ y.required = false
57
+ y.case_exact = false
58
+ y.mutability = :read_write
59
+ y.returned = :default
60
+ y.uniqueness = :none
61
+ end
62
+ x.add_attribute(name: :honorific_prefix) do |y|
63
+ y.multi_valued = false
64
+ y.description = "The honorific prefix(es) of the User, or title in most Western languages (e.g., 'Ms.' given the full name 'Ms. Barbara J Jensen, III')."
65
+ y.required = false
66
+ y.case_exact = false
67
+ y.mutability = :read_write
68
+ y.returned = :default
69
+ y.uniqueness = :none
70
+ end
71
+ x.add_attribute(name: :honorific_suffix) do |y|
72
+ y.multi_valued = false
73
+ y.description = "The honorific suffix(es) of the User, or suffix in most Western languages (e.g., 'III' given the full name 'Ms. Barbara J Jensen, III')."
74
+ y.required = false
75
+ y.case_exact = false
76
+ y.mutability = :read_write
77
+ y.returned = :default
78
+ y.uniqueness = :none
79
+ end
80
+ end
81
+ schema.add_attribute(name: :display_name, type: :string) do |x|
82
+ x.multi_valued = false
83
+ x.description = "The name of the User, suitable for display to end-users. The name SHOULD be the full name of the User being described, if known."
84
+ x.required = false
85
+ x.case_exact = false
86
+ x.mutability = :read_write
87
+ x.returned = :default
88
+ x.uniqueness = :none
89
+ end
90
+ schema.add_attribute(name: :nick_name, type: :string) do |x|
91
+ x.multi_valued = false
92
+ x.description = "The casual way to address the user in real life, e.g., 'Bob' or 'Bobby' instead of 'Robert'. This attribute SHOULD NOT be used to represent a User's username (e.g., 'bjensen' or 'mpepperidge')."
93
+ x.required = false
94
+ x.case_exact = false
95
+ x.mutability = :read_write
96
+ x.returned = :default
97
+ x.uniqueness = :none
98
+ end
99
+ schema.add_attribute(name: :preferred_language, type: :string) do |x|
100
+ x.multi_valued = false
101
+ x.description = "Indicates the User's preferred written or spoken language. Generally used for selecting a localized user interface; e.g., 'en_US' specifies the language English and country US."
102
+ x.required = false
103
+ x.case_exact = false
104
+ x.mutability = :read_write
105
+ x.returned = :default
106
+ x.uniqueness = :none
107
+ end
108
+ schema.add_attribute(name: :locale, type: :string) do |x|
109
+ x.multi_valued = false
110
+ x.description = "Used to indicate the User's default location for purposes of localizing items such as currency, date time format, or numerical representations."
111
+ x.required = false
112
+ x.case_exact = false
113
+ x.mutability = :read_write
114
+ x.returned = :default
115
+ x.uniqueness = :none
116
+ end
117
+ schema.add_attribute(name: :timezone, type: :string) do |x|
118
+ x.multi_valued = false
119
+ x.description = "The User's time zone in the 'Olson' time zone database format, e.g., 'America/Los_Angeles'."
120
+ x.required = false
121
+ x.case_exact = false
122
+ x.mutability = :read_write
123
+ x.returned = :default
124
+ x.uniqueness = :none
125
+ end
126
+ schema.add_attribute(name: :active, type: :boolean) do |x|
127
+ x.multi_valued = false
128
+ x.description = "A Boolean value indicating the User's administrative status."
129
+ x.required = false
130
+ x.mutability = :read_write
131
+ x.returned = :default
132
+ end
133
+ schema.add_attribute(name: :password, type: :string) do |x|
134
+ x.multi_valued = false
135
+ x.description = "The User's cleartext password. This attribute is intended to be used as a means to specify an initial password when creating a new User or to reset an existing User's password."
136
+ x.required = false
137
+ x.case_exact = false
138
+ x.mutability = :write_only
139
+ x.returned = :never
140
+ x.uniqueness = :none
141
+ end
142
+ schema.add_attribute(name: :emails, type: :complex) do |x|
143
+ x.multi_valued = true
144
+ x.description = "Email addresses for the user. The value SHOULD be canonicalized by the service provider, e.g., 'bjensen@example.com' instead of 'bjensen@EXAMPLE.COM'. Canonical type values of 'work', 'home', and 'other'."
145
+ x.required = false
146
+ x.case_exact = false
147
+ x.mutability = :read_write
148
+ x.returned = :default
149
+ x.uniqueness = :none
150
+ x.add_attribute(name: :value, type: :string) do |y|
151
+ y.multi_valued = false
152
+ y.description = "Email addresses for the user. The value SHOULD be canonicalized by the service provider, e.g., 'bjensen@example.com' instead of 'bjensen@EXAMPLE.COM'. Canonical type values of 'work', 'home', and 'other'."
153
+ y.required = false
154
+ y.case_exact = false
155
+ y.mutability = :read_write
156
+ y.returned = :default
157
+ y.uniqueness = :none
158
+ end
159
+ x.add_attribute(name: :display, type: :string) do |y|
160
+ y.multi_valued = false
161
+ y.description = "A human-readable name, primarily used for display purposes. READ-ONLY."
162
+ y.required = false
163
+ y.case_exact = false
164
+ y.mutability = :read_write
165
+ y.returned = :default
166
+ y.uniqueness = :none
167
+ end
168
+ x.add_attribute(name: :type, type: :string) do |y|
169
+ y.multi_valued = false
170
+ y.description = "A label indicating the attribute's function, e.g., 'work' or 'home'."
171
+ y.required = false
172
+ y.case_exact = false
173
+ y.canonical_values = ['work', 'home', 'other']
174
+ y.mutability = :read_write
175
+ y.returned = :default
176
+ y.uniqueness = :none
177
+ end
178
+ x.add_attribute(name: :primary, type: :boolean) do |y|
179
+ y.multi_valued = false
180
+ y.description = "A Boolean value indicating the 'primary' or preferred attribute value for this attribute, e.g., the preferred mailing address or primary email address. The primary attribute value 'true' MUST appear no more than once."
181
+ y.required = false
182
+ y.mutability = :read_write
183
+ y.returned = :default
184
+ end
185
+ end
186
+ schema.add_attribute(name: :phone_numbers, type: :complex) do |x|
187
+ x.multi_valued = true
188
+ x.description = "Phone numbers for the User. The value SHOULD be canonicalized by the service provider according to the format specified in RFC 3966, e.g., 'tel:+1-201-555-0123'. Canonical type values of 'work', 'home', 'mobile', 'fax', 'pager', and 'other'."
189
+ x.required = false
190
+ x.mutability = :read_write
191
+ x.returned = :default
192
+ x.add_attribute(name: :value, type: :string) do |y|
193
+ y.multi_valued = false
194
+ y.description = "Phone number of the User."
195
+ y.required = false
196
+ y.case_exact = false
197
+ y.mutability = :read_write
198
+ y.returned = :default
199
+ y.uniqueness = :none
200
+ end
201
+ x.add_attribute(name: :display, type: :string) do |y|
202
+ y.multi_valued = false
203
+ y.description = "A human-readable name, primarily used for display purposes. READ-ONLY."
204
+ y.required = false
205
+ y.case_exact = false
206
+ y.mutability = :read_write
207
+ y.returned = :default
208
+ y.uniqueness = :none
209
+ end
210
+ x.add_attribute(name: :type, type: :string) do |y|
211
+ y.multi_valued = false
212
+ y.description = "A label indicating the attribute's function, e.g., 'work', 'home', 'mobile'."
213
+ y.required = false
214
+ y.case_exact = false
215
+ y.canonical_values = ['work', 'home', 'mobile', 'fax', 'pager', 'other']
216
+ y.mutability = :read_write
217
+ y.returned = :default
218
+ y.uniqueness = :none
219
+ end
220
+ x.add_attribute(name: :primary, type: :boolean) do |y|
221
+ y.multi_valued = false
222
+ y.description = "A Boolean value indicating the 'primary' or preferred attribute value for this attribute, e.g., the preferred phone number or primary phone number. The primary attribute value 'true' MUST appear no more than once."
223
+ y.required = false
224
+ y.mutability = :read_write
225
+ y.returned = :default
226
+ end
227
+ end
228
+ schema.add_attribute(name: :ims, type: :complex) do |x|
229
+ x.multi_valued = true
230
+ x.description = "Instant messaging addresses for the User."
231
+ x.required = false
232
+ x.mutability = :read_write
233
+ x.returned = :default
234
+ x.add_attribute(name: :value, type: :string) do |y|
235
+ y.multi_valued = false
236
+ y.description = "Instant messaging address for the User."
237
+ y.required = false
238
+ y.case_exact = false
239
+ y.mutability = :read_write
240
+ y.returned = :default
241
+ y.uniqueness = :none
242
+ end
243
+ x.add_attribute(name: :display, type: :string) do |y|
244
+ y.multi_valued = false
245
+ y.description = "A human-readable name, primarily used for display purposes. READ-ONLY."
246
+ y.required = false
247
+ y.case_exact = false
248
+ y.mutability = :read_write
249
+ y.returned = :default
250
+ y.uniqueness = :none
251
+ end
252
+ x.add_attribute(name: :type, type: :string) do |y|
253
+ y.multi_valued = false
254
+ y.description = "A label indicating the attribute's function, e.g., 'aim', 'gtalk', 'xmpp'."
255
+ y.required = false
256
+ y.case_exact = false
257
+ y.canonical_values = ['aim', 'gtalk', 'icq', 'xmpp', 'msn', 'skype', 'qq', 'yahoo']
258
+ y.mutability = :read_write
259
+ y.returned = :default
260
+ y.uniqueness = :none
261
+ end
262
+ x.add_attribute(name: :primary, type: :boolean) do |y|
263
+ y.multi_valued = false
264
+ y.description = "A Boolean value indicating the 'primary' or preferred attribute value for this attribute, e.g., the preferred messenger or primary messenger. The primary attribute value 'true' MUST appear no more than once."
265
+ y.required = false
266
+ y.mutability = :read_write
267
+ y.returned = :default
268
+ end
269
+ end
270
+ schema.add_attribute(name: :photos, type: :complex) do |x|
271
+ x.multi_valued = true
272
+ x.description = "URLs of photos of the User."
273
+ x.required = false
274
+ x.mutability = :read_write
275
+ x.returned = :default
276
+ x.add_attribute(name: :value, type: :reference) do |y|
277
+ y.reference_types = ['external']
278
+ y.multi_valued = false
279
+ y.description = "URL of a photo of the User."
280
+ y.required = false
281
+ y.case_exact = false
282
+ y.mutability = :read_write
283
+ y.returned = :default
284
+ y.uniqueness = :none
285
+ end
286
+ x.add_attribute(name: :display, type: :string) do |y|
287
+ y.multi_valued = false
288
+ y.description = "A human-readable name, primarily used for display purposes. READ-ONLY."
289
+ y.required = false
290
+ y.case_exact = false
291
+ y.mutability = :read_write
292
+ y.returned = :default
293
+ y.uniqueness = :none
294
+ end
295
+ x.add_attribute(name: :type, type: :string) do |y|
296
+ y.multi_valued = false
297
+ y.description = "A label indicating the attribute's function, i.e., 'photo' or 'thumbnail'."
298
+ y.required = false
299
+ y.case_exact = false
300
+ y.canonical_values = ['photo', 'thumbnail']
301
+ y.mutability = :read_write
302
+ y.returned = :default
303
+ y.uniqueness = :none
304
+ end
305
+ x.add_attribute(name: :primary, type: :boolean) do |y|
306
+ y.multi_valued = false
307
+ y.description = "A Boolean value indicating the 'primary' or preferred attribute value for this attribute, e.g., the preferred photo or thumbnail. The primary attribute value 'true' MUST appear no more than once."
308
+ y.required = false
309
+ y.mutability = :read_write
310
+ y.returned = :default
311
+ end
312
+ end
313
+ schema.add_attribute(name: :addresses, type: :complex) do |x|
314
+ x.multi_valued = true
315
+ x.description = "A physical mailing address for this User. Canonical type values of 'work', 'home', and 'other'. This attribute is a complex type with the following sub-attributes."
316
+ x.required = false
317
+ x.mutability = :read_write
318
+ x.returned = :default
319
+ x.uniqueness = :none
320
+ x.add_attribute(name: :formatted, type: :string) do |y|
321
+ y.multi_valued = false
322
+ y.description = "The full mailing address, formatted for display or use with a mailing label. This attribute MAY contain newlines."
323
+ y.required = false
324
+ y.case_exact = false
325
+ y.mutability = :read_write
326
+ y.returned = :default
327
+ y.uniqueness = :none
328
+ end
329
+ x.add_attribute(name: :street_address, type: :string) do |y|
330
+ y.multi_valued = false
331
+ y.description = "The full street address component, which may include house number, street name, P.O. box, and multi-line extended street address information. This attribute MAY contain newlines."
332
+ y.required = false
333
+ y.case_exact = false
334
+ y.mutability = :read_write
335
+ y.returned = :default
336
+ y.uniqueness = :none
337
+ end
338
+ x.add_attribute(name: :locality, type: :string) do |y|
339
+ y.multi_valued = false
340
+ y.description = "The city or locality component."
341
+ y.required = false
342
+ y.case_exact = false
343
+ y.mutability = :read_write
344
+ y.returned = :default
345
+ y.uniqueness = :none
346
+ end
347
+ x.add_attribute(name: :region, type: :string) do |y|
348
+ y.multi_valued = false
349
+ y.description = "The state or region component."
350
+ y.required = false
351
+ y.case_exact = false
352
+ y.mutability = :read_write
353
+ y.returned = :default
354
+ y.uniqueness = :none
355
+ end
356
+ x.add_attribute(name: :postal_code, type: :string) do |y|
357
+ y.multi_valued = false
358
+ y.description = "The zip code or postal code component."
359
+ y.required = false
360
+ y.case_exact = false
361
+ y.mutability = :read_write
362
+ y.returned = :default
363
+ y.uniqueness = :none
364
+ end
365
+ x.add_attribute(name: :country, type: :string) do |y|
366
+ y.multi_valued = false
367
+ y.description = "The country name component."
368
+ y.required = false
369
+ y.case_exact = false
370
+ y.mutability = :read_write
371
+ y.returned = :default
372
+ y.uniqueness = :none
373
+ end
374
+ x.add_attribute(name: :type, type: :string) do |y|
375
+ y.multi_valued = false
376
+ y.description = "A label indicating the attribute's function, e.g., 'work' or 'home'."
377
+ y.required = false
378
+ y.case_exact = false
379
+ y.canonical_values = ['work', 'home', 'other']
380
+ y.mutability = :read_write
381
+ y.returned = :default
382
+ y.uniqueness = :none
383
+ end
384
+ end
385
+ schema.add_attribute(name: :groups, type: :complex) do |x|
386
+ x.multi_valued = true
387
+ x.description = "A list of groups to which the user belongs, either through direct membership, through nested groups, or dynamically calculated."
388
+ x.required = false
389
+ x.mutability = :read_only
390
+ x.returned = :default
391
+ x.add_attribute(name: :value, type: :string) do |y|
392
+ y.multi_valued = false
393
+ y.description = "The identifier of the User's group."
394
+ y.required = false
395
+ y.case_exact = false
396
+ y.mutability = :read_only
397
+ y.returned = :default
398
+ y.uniqueness = :none
399
+ end
400
+ x.add_attribute(name: '$ref', type: :reference) do |y|
401
+ y.multi_valued = false
402
+ y.description = "The URI of the corresponding 'Group' resource to which the user belongs."
403
+ y.required = false
404
+ y.case_exact = false
405
+ y.mutability = :read_only
406
+ y.returned = :default
407
+ y.uniqueness = :none
408
+ end
409
+ x.add_attribute(name: :display, type: :string) do |y|
410
+ y.multi_valued = false
411
+ y.description = "A human-readable name, primarily used for display purposes. READ-ONLY."
412
+ y.required = false
413
+ y.case_exact = false
414
+ y.mutability = :read_only
415
+ y.returned = :default
416
+ y.uniqueness = :none
417
+ end
418
+ x.add_attribute(name: :type, type: :string) do |y|
419
+ y.multi_valued = false
420
+ y.description = "A label indicating the attribute's function, e.g., 'direct' or 'indirect'."
421
+ y.required = false
422
+ y.case_exact = false
423
+ y.canonical_values = ['direct', 'indirect']
424
+ y.mutability = :read_only
425
+ y.returned = :default
426
+ y.uniqueness = :none
427
+ end
428
+ end
429
+ schema.add_attribute(name: :entitlements, type: :complex) do |x|
430
+ x.multi_valued = true
431
+ x.description = "A list of entitlements for the User that represent a thing the User has."
432
+ x.required = false
433
+ x.mutability = :read_write
434
+ x.returned = :default
435
+ x.add_attribute(name: :value, type: :string) do |y|
436
+ y.multi_valued = false
437
+ y.description = "The value of an entitlement."
438
+ y.required = false
439
+ y.case_exact = false
440
+ y.mutability = :read_write
441
+ y.returned = :default
442
+ y.uniqueness = :none
443
+ end
444
+ x.add_attribute(name: :display, type: :string) do |y|
445
+ y.multi_valued = false
446
+ y.description = "A human-readable name, primarily used for display purposes. READ-ONLY."
447
+ y.required = false
448
+ y.case_exact = false
449
+ y.mutability = :read_write
450
+ y.returned = :default
451
+ y.uniqueness = :none
452
+ end
453
+ x.add_attribute(name: :type, type: :string) do |y|
454
+ y.multi_valued = false
455
+ y.description = "A label indicating the attribute's function."
456
+ y.required = false
457
+ y.case_exact = false
458
+ y.mutability = :read_write
459
+ y.returned = :default
460
+ y.uniqueness = :none
461
+ end
462
+ x.add_attribute(name: :primary, type: :boolean) do |y|
463
+ y.multi_valued = false
464
+ y.description = "A Boolean value indicating the 'primary' or preferred attribute value for this attribute. The primary attribute value 'true' MUST appear no more than once."
465
+ y.required = false
466
+ y.mutability = :read_write
467
+ y.returned = :default
468
+ end
469
+ end
470
+ schema.add_attribute(name: :roles, type: :complex) do |x|
471
+ x.multi_valued = true
472
+ x.description = "A list of roles for the User that collectively represent who the User is, e.g., 'Student', 'Faculty'."
473
+ x.required = false
474
+ x.mutability = :read_write
475
+ x.returned = :default
476
+ x.add_attribute(name: :value, type: :string) do |y|
477
+ y.multi_valued = false
478
+ y.description = "The value of a role."
479
+ y.required = false
480
+ y.case_exact = false
481
+ y.mutability = :read_write
482
+ y.returned = :default
483
+ y.uniqueness = :none
484
+ end
485
+ x.add_attribute(name: :display, type: :string) do |y|
486
+ y.multi_valued = false
487
+ y.description = "A human-readable name, primarily used for display purposes. READ-ONLY."
488
+ y.required = false
489
+ y.case_exact = false
490
+ y.mutability = :read_write
491
+ y.returned = :default
492
+ y.uniqueness = :none
493
+ end
494
+ x.add_attribute(name: :type, type: :string) do |y|
495
+ y.multi_valued = false
496
+ y.description = "A label indicating the attribute's function."
497
+ y.required = false
498
+ y.case_exact = false
499
+ y.canonical_values = []
500
+ y.mutability = :read_write
501
+ y.returned = :default
502
+ y.uniqueness = :none
503
+ end
504
+ x.add_attribute(name: :primary, type: :boolean) do |y|
505
+ y.multi_valued = false
506
+ y.description = "A Boolean value indicating the 'primary' or preferred attribute value for this attribute. The primary attribute value 'true' MUST appear no more than once."
507
+ y.required = false
508
+ y.mutability = :read_write
509
+ y.returned = :default
510
+ end
511
+ end
512
+ schema.add_attribute(name: :x509_certificates, type: :complex) do |x|
513
+ x.multi_valued = true
514
+ x.description = "A list of certificates issued to the User."
515
+ x.required = false
516
+ x.case_exact = false
517
+ x.mutability = :read_write
518
+ x.returned = :default
519
+ x.add_attribute(name: :value, type: :binary) do |y|
520
+ y.multi_valued = false
521
+ y.description = "The value of an X.509 certificate."
522
+ y.required = false
523
+ y.case_exact = false
524
+ y.mutability = :read_write
525
+ y.returned = :default
526
+ y.uniqueness = :none
527
+ end
528
+ x.add_attribute(name: :display, type: :string) do |y|
529
+ y.multi_valued = false
530
+ y.description = "A human-readable name, primarily used for display purposes. READ-ONLY."
531
+ y.required = false
532
+ y.case_exact = false
533
+ y.mutability = :read_write
534
+ y.returned = :default
535
+ y.uniqueness = :none
536
+ end
537
+ x.add_attribute(name: :type, type: :string) do |y|
538
+ y.multi_valued = false
539
+ y.description = "A label indicating the attribute's function."
540
+ y.required = false
541
+ y.case_exact = false
542
+ y.mutability = :read_write
543
+ y.returned = :default
544
+ y.uniqueness = :none
545
+ end
546
+ x.add_attribute(name: :primary, type: :boolean) do |y|
547
+ y.multi_valued = false
548
+ y.description = "A Boolean value indicating the 'primary' or preferred attribute value for this attribute. The primary attribute value 'true' MUST appear no more than once."
549
+ y.required = false
550
+ y.mutability = :read_write
551
+ y.returned = :default
552
+ end
553
+ end
554
+ schema
68
555
  end
69
556
  end
70
557
  end