ssoready 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/lib/environment.rb +7 -0
- data/lib/gemconfig.rb +14 -0
- data/lib/requests.rb +159 -0
- data/lib/ssoready/management/client.rb +51 -0
- data/lib/ssoready/management/organizations/client.rb +247 -0
- data/lib/ssoready/management/saml_connections/client.rb +269 -0
- data/lib/ssoready/management/scim_directories/client.rb +330 -0
- data/lib/ssoready/management/setup_urls/client.rb +97 -0
- data/lib/ssoready/saml/client.rb +170 -0
- data/lib/ssoready/scim/client.rb +296 -0
- data/lib/ssoready/types/create_organization_response.rb +63 -0
- data/lib/ssoready/types/create_saml_connection_response.rb +63 -0
- data/lib/ssoready/types/create_scim_directory_response.rb +63 -0
- data/lib/ssoready/types/create_setup_url_response.rb +62 -0
- data/lib/ssoready/types/get_organization_response.rb +63 -0
- data/lib/ssoready/types/get_saml_connection_response.rb +63 -0
- data/lib/ssoready/types/get_saml_redirect_url_response.rb +56 -0
- data/lib/ssoready/types/get_scim_directory_response.rb +63 -0
- data/lib/ssoready/types/get_scim_group_response.rb +63 -0
- data/lib/ssoready/types/get_scim_user_response.rb +63 -0
- data/lib/ssoready/types/google_protobuf_any.rb +58 -0
- data/lib/ssoready/types/list_organizations_response.rb +73 -0
- data/lib/ssoready/types/list_saml_connections_response.rb +73 -0
- data/lib/ssoready/types/list_scim_directories_response.rb +73 -0
- data/lib/ssoready/types/list_scim_groups_response.rb +73 -0
- data/lib/ssoready/types/list_scim_users_response.rb +73 -0
- data/lib/ssoready/types/organization.rb +112 -0
- data/lib/ssoready/types/redeem_saml_access_code_response.rb +126 -0
- data/lib/ssoready/types/rotate_scim_directory_bearer_token_response.rb +63 -0
- data/lib/ssoready/types/saml_connection.rb +144 -0
- data/lib/ssoready/types/scim_directory.rb +104 -0
- data/lib/ssoready/types/scim_group.rb +114 -0
- data/lib/ssoready/types/scim_user.rb +102 -0
- data/lib/ssoready/types/status.rb +94 -0
- data/lib/ssoready/types/update_organization_response.rb +63 -0
- data/lib/ssoready/types/update_saml_connection_response.rb +63 -0
- data/lib/ssoready/types/update_scim_directory_response.rb +63 -0
- data/lib/ssoready.rb +68 -0
- data/lib/types_export.rb +29 -0
- metadata +163 -0
@@ -0,0 +1,73 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "organization"
|
4
|
+
require "ostruct"
|
5
|
+
require "json"
|
6
|
+
|
7
|
+
module SSOReady
|
8
|
+
class ListOrganizationsResponse
|
9
|
+
# @return [Array<SSOReady::Organization>] List of organizations.
|
10
|
+
attr_reader :organizations
|
11
|
+
# @return [String] Value to use as `pageToken` for the next page of data. Empty if there is no more
|
12
|
+
# data.
|
13
|
+
attr_reader :next_page_token
|
14
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
15
|
+
attr_reader :additional_properties
|
16
|
+
# @return [Object]
|
17
|
+
attr_reader :_field_set
|
18
|
+
protected :_field_set
|
19
|
+
|
20
|
+
OMIT = Object.new
|
21
|
+
|
22
|
+
# @param organizations [Array<SSOReady::Organization>] List of organizations.
|
23
|
+
# @param next_page_token [String] Value to use as `pageToken` for the next page of data. Empty if there is no more
|
24
|
+
# data.
|
25
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
26
|
+
# @return [SSOReady::ListOrganizationsResponse]
|
27
|
+
def initialize(organizations: OMIT, next_page_token: OMIT, additional_properties: nil)
|
28
|
+
@organizations = organizations if organizations != OMIT
|
29
|
+
@next_page_token = next_page_token if next_page_token != OMIT
|
30
|
+
@additional_properties = additional_properties
|
31
|
+
@_field_set = { "organizations": organizations, "nextPageToken": next_page_token }.reject do |_k, v|
|
32
|
+
v == OMIT
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
# Deserialize a JSON object to an instance of ListOrganizationsResponse
|
37
|
+
#
|
38
|
+
# @param json_object [String]
|
39
|
+
# @return [SSOReady::ListOrganizationsResponse]
|
40
|
+
def self.from_json(json_object:)
|
41
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
42
|
+
parsed_json = JSON.parse(json_object)
|
43
|
+
organizations = parsed_json["organizations"]&.map do |v|
|
44
|
+
v = v.to_json
|
45
|
+
SSOReady::Organization.from_json(json_object: v)
|
46
|
+
end
|
47
|
+
next_page_token = struct["nextPageToken"]
|
48
|
+
new(
|
49
|
+
organizations: organizations,
|
50
|
+
next_page_token: next_page_token,
|
51
|
+
additional_properties: struct
|
52
|
+
)
|
53
|
+
end
|
54
|
+
|
55
|
+
# Serialize an instance of ListOrganizationsResponse to a JSON object
|
56
|
+
#
|
57
|
+
# @return [String]
|
58
|
+
def to_json(*_args)
|
59
|
+
@_field_set&.to_json
|
60
|
+
end
|
61
|
+
|
62
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
63
|
+
# hash and check each fields type against the current object's property
|
64
|
+
# definitions.
|
65
|
+
#
|
66
|
+
# @param obj [Object]
|
67
|
+
# @return [Void]
|
68
|
+
def self.validate_raw(obj:)
|
69
|
+
obj.organizations&.is_a?(Array) != false || raise("Passed value for field obj.organizations is not the expected type, validation failed.")
|
70
|
+
obj.next_page_token&.is_a?(String) != false || raise("Passed value for field obj.next_page_token is not the expected type, validation failed.")
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "saml_connection"
|
4
|
+
require "ostruct"
|
5
|
+
require "json"
|
6
|
+
|
7
|
+
module SSOReady
|
8
|
+
class ListSAMLConnectionsResponse
|
9
|
+
# @return [Array<SSOReady::SAMLConnection>] The list of SAML connections.
|
10
|
+
attr_reader :saml_connections
|
11
|
+
# @return [String] Value to use as `pageToken` for the next page of data. Empty if there is no more
|
12
|
+
# data.
|
13
|
+
attr_reader :next_page_token
|
14
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
15
|
+
attr_reader :additional_properties
|
16
|
+
# @return [Object]
|
17
|
+
attr_reader :_field_set
|
18
|
+
protected :_field_set
|
19
|
+
|
20
|
+
OMIT = Object.new
|
21
|
+
|
22
|
+
# @param saml_connections [Array<SSOReady::SAMLConnection>] The list of SAML connections.
|
23
|
+
# @param next_page_token [String] Value to use as `pageToken` for the next page of data. Empty if there is no more
|
24
|
+
# data.
|
25
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
26
|
+
# @return [SSOReady::ListSAMLConnectionsResponse]
|
27
|
+
def initialize(saml_connections: OMIT, next_page_token: OMIT, additional_properties: nil)
|
28
|
+
@saml_connections = saml_connections if saml_connections != OMIT
|
29
|
+
@next_page_token = next_page_token if next_page_token != OMIT
|
30
|
+
@additional_properties = additional_properties
|
31
|
+
@_field_set = { "samlConnections": saml_connections, "nextPageToken": next_page_token }.reject do |_k, v|
|
32
|
+
v == OMIT
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
# Deserialize a JSON object to an instance of ListSAMLConnectionsResponse
|
37
|
+
#
|
38
|
+
# @param json_object [String]
|
39
|
+
# @return [SSOReady::ListSAMLConnectionsResponse]
|
40
|
+
def self.from_json(json_object:)
|
41
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
42
|
+
parsed_json = JSON.parse(json_object)
|
43
|
+
saml_connections = parsed_json["samlConnections"]&.map do |v|
|
44
|
+
v = v.to_json
|
45
|
+
SSOReady::SAMLConnection.from_json(json_object: v)
|
46
|
+
end
|
47
|
+
next_page_token = struct["nextPageToken"]
|
48
|
+
new(
|
49
|
+
saml_connections: saml_connections,
|
50
|
+
next_page_token: next_page_token,
|
51
|
+
additional_properties: struct
|
52
|
+
)
|
53
|
+
end
|
54
|
+
|
55
|
+
# Serialize an instance of ListSAMLConnectionsResponse to a JSON object
|
56
|
+
#
|
57
|
+
# @return [String]
|
58
|
+
def to_json(*_args)
|
59
|
+
@_field_set&.to_json
|
60
|
+
end
|
61
|
+
|
62
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
63
|
+
# hash and check each fields type against the current object's property
|
64
|
+
# definitions.
|
65
|
+
#
|
66
|
+
# @param obj [Object]
|
67
|
+
# @return [Void]
|
68
|
+
def self.validate_raw(obj:)
|
69
|
+
obj.saml_connections&.is_a?(Array) != false || raise("Passed value for field obj.saml_connections is not the expected type, validation failed.")
|
70
|
+
obj.next_page_token&.is_a?(String) != false || raise("Passed value for field obj.next_page_token is not the expected type, validation failed.")
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "scim_directory"
|
4
|
+
require "ostruct"
|
5
|
+
require "json"
|
6
|
+
|
7
|
+
module SSOReady
|
8
|
+
class ListSCIMDirectoriesResponse
|
9
|
+
# @return [Array<SSOReady::SCIMDirectory>] The list of SCIM directories.
|
10
|
+
attr_reader :scim_directories
|
11
|
+
# @return [String] Value to use as `pageToken` for the next page of data. Empty if there is no more
|
12
|
+
# data.
|
13
|
+
attr_reader :next_page_token
|
14
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
15
|
+
attr_reader :additional_properties
|
16
|
+
# @return [Object]
|
17
|
+
attr_reader :_field_set
|
18
|
+
protected :_field_set
|
19
|
+
|
20
|
+
OMIT = Object.new
|
21
|
+
|
22
|
+
# @param scim_directories [Array<SSOReady::SCIMDirectory>] The list of SCIM directories.
|
23
|
+
# @param next_page_token [String] Value to use as `pageToken` for the next page of data. Empty if there is no more
|
24
|
+
# data.
|
25
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
26
|
+
# @return [SSOReady::ListSCIMDirectoriesResponse]
|
27
|
+
def initialize(scim_directories: OMIT, next_page_token: OMIT, additional_properties: nil)
|
28
|
+
@scim_directories = scim_directories if scim_directories != OMIT
|
29
|
+
@next_page_token = next_page_token if next_page_token != OMIT
|
30
|
+
@additional_properties = additional_properties
|
31
|
+
@_field_set = { "scimDirectories": scim_directories, "nextPageToken": next_page_token }.reject do |_k, v|
|
32
|
+
v == OMIT
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
# Deserialize a JSON object to an instance of ListSCIMDirectoriesResponse
|
37
|
+
#
|
38
|
+
# @param json_object [String]
|
39
|
+
# @return [SSOReady::ListSCIMDirectoriesResponse]
|
40
|
+
def self.from_json(json_object:)
|
41
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
42
|
+
parsed_json = JSON.parse(json_object)
|
43
|
+
scim_directories = parsed_json["scimDirectories"]&.map do |v|
|
44
|
+
v = v.to_json
|
45
|
+
SSOReady::SCIMDirectory.from_json(json_object: v)
|
46
|
+
end
|
47
|
+
next_page_token = struct["nextPageToken"]
|
48
|
+
new(
|
49
|
+
scim_directories: scim_directories,
|
50
|
+
next_page_token: next_page_token,
|
51
|
+
additional_properties: struct
|
52
|
+
)
|
53
|
+
end
|
54
|
+
|
55
|
+
# Serialize an instance of ListSCIMDirectoriesResponse to a JSON object
|
56
|
+
#
|
57
|
+
# @return [String]
|
58
|
+
def to_json(*_args)
|
59
|
+
@_field_set&.to_json
|
60
|
+
end
|
61
|
+
|
62
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
63
|
+
# hash and check each fields type against the current object's property
|
64
|
+
# definitions.
|
65
|
+
#
|
66
|
+
# @param obj [Object]
|
67
|
+
# @return [Void]
|
68
|
+
def self.validate_raw(obj:)
|
69
|
+
obj.scim_directories&.is_a?(Array) != false || raise("Passed value for field obj.scim_directories is not the expected type, validation failed.")
|
70
|
+
obj.next_page_token&.is_a?(String) != false || raise("Passed value for field obj.next_page_token is not the expected type, validation failed.")
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "scim_group"
|
4
|
+
require "ostruct"
|
5
|
+
require "json"
|
6
|
+
|
7
|
+
module SSOReady
|
8
|
+
class ListSCIMGroupsResponse
|
9
|
+
# @return [Array<SSOReady::SCIMGroup>] List of SCIM groups.
|
10
|
+
attr_reader :scim_groups
|
11
|
+
# @return [String] Value to use as `pageToken` for the next page of data. Empty if there is no more
|
12
|
+
# data.
|
13
|
+
attr_reader :next_page_token
|
14
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
15
|
+
attr_reader :additional_properties
|
16
|
+
# @return [Object]
|
17
|
+
attr_reader :_field_set
|
18
|
+
protected :_field_set
|
19
|
+
|
20
|
+
OMIT = Object.new
|
21
|
+
|
22
|
+
# @param scim_groups [Array<SSOReady::SCIMGroup>] List of SCIM groups.
|
23
|
+
# @param next_page_token [String] Value to use as `pageToken` for the next page of data. Empty if there is no more
|
24
|
+
# data.
|
25
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
26
|
+
# @return [SSOReady::ListSCIMGroupsResponse]
|
27
|
+
def initialize(scim_groups: OMIT, next_page_token: OMIT, additional_properties: nil)
|
28
|
+
@scim_groups = scim_groups if scim_groups != OMIT
|
29
|
+
@next_page_token = next_page_token if next_page_token != OMIT
|
30
|
+
@additional_properties = additional_properties
|
31
|
+
@_field_set = { "scimGroups": scim_groups, "nextPageToken": next_page_token }.reject do |_k, v|
|
32
|
+
v == OMIT
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
# Deserialize a JSON object to an instance of ListSCIMGroupsResponse
|
37
|
+
#
|
38
|
+
# @param json_object [String]
|
39
|
+
# @return [SSOReady::ListSCIMGroupsResponse]
|
40
|
+
def self.from_json(json_object:)
|
41
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
42
|
+
parsed_json = JSON.parse(json_object)
|
43
|
+
scim_groups = parsed_json["scimGroups"]&.map do |v|
|
44
|
+
v = v.to_json
|
45
|
+
SSOReady::SCIMGroup.from_json(json_object: v)
|
46
|
+
end
|
47
|
+
next_page_token = struct["nextPageToken"]
|
48
|
+
new(
|
49
|
+
scim_groups: scim_groups,
|
50
|
+
next_page_token: next_page_token,
|
51
|
+
additional_properties: struct
|
52
|
+
)
|
53
|
+
end
|
54
|
+
|
55
|
+
# Serialize an instance of ListSCIMGroupsResponse to a JSON object
|
56
|
+
#
|
57
|
+
# @return [String]
|
58
|
+
def to_json(*_args)
|
59
|
+
@_field_set&.to_json
|
60
|
+
end
|
61
|
+
|
62
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
63
|
+
# hash and check each fields type against the current object's property
|
64
|
+
# definitions.
|
65
|
+
#
|
66
|
+
# @param obj [Object]
|
67
|
+
# @return [Void]
|
68
|
+
def self.validate_raw(obj:)
|
69
|
+
obj.scim_groups&.is_a?(Array) != false || raise("Passed value for field obj.scim_groups is not the expected type, validation failed.")
|
70
|
+
obj.next_page_token&.is_a?(String) != false || raise("Passed value for field obj.next_page_token is not the expected type, validation failed.")
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "scim_user"
|
4
|
+
require "ostruct"
|
5
|
+
require "json"
|
6
|
+
|
7
|
+
module SSOReady
|
8
|
+
class ListSCIMUsersResponse
|
9
|
+
# @return [Array<SSOReady::SCIMUser>] List of SCIM users.
|
10
|
+
attr_reader :scim_users
|
11
|
+
# @return [String] Value to use as `pageToken` for the next page of data. Empty if there is no more
|
12
|
+
# data.
|
13
|
+
attr_reader :next_page_token
|
14
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
15
|
+
attr_reader :additional_properties
|
16
|
+
# @return [Object]
|
17
|
+
attr_reader :_field_set
|
18
|
+
protected :_field_set
|
19
|
+
|
20
|
+
OMIT = Object.new
|
21
|
+
|
22
|
+
# @param scim_users [Array<SSOReady::SCIMUser>] List of SCIM users.
|
23
|
+
# @param next_page_token [String] Value to use as `pageToken` for the next page of data. Empty if there is no more
|
24
|
+
# data.
|
25
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
26
|
+
# @return [SSOReady::ListSCIMUsersResponse]
|
27
|
+
def initialize(scim_users: OMIT, next_page_token: OMIT, additional_properties: nil)
|
28
|
+
@scim_users = scim_users if scim_users != OMIT
|
29
|
+
@next_page_token = next_page_token if next_page_token != OMIT
|
30
|
+
@additional_properties = additional_properties
|
31
|
+
@_field_set = { "scimUsers": scim_users, "nextPageToken": next_page_token }.reject do |_k, v|
|
32
|
+
v == OMIT
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
# Deserialize a JSON object to an instance of ListSCIMUsersResponse
|
37
|
+
#
|
38
|
+
# @param json_object [String]
|
39
|
+
# @return [SSOReady::ListSCIMUsersResponse]
|
40
|
+
def self.from_json(json_object:)
|
41
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
42
|
+
parsed_json = JSON.parse(json_object)
|
43
|
+
scim_users = parsed_json["scimUsers"]&.map do |v|
|
44
|
+
v = v.to_json
|
45
|
+
SSOReady::SCIMUser.from_json(json_object: v)
|
46
|
+
end
|
47
|
+
next_page_token = struct["nextPageToken"]
|
48
|
+
new(
|
49
|
+
scim_users: scim_users,
|
50
|
+
next_page_token: next_page_token,
|
51
|
+
additional_properties: struct
|
52
|
+
)
|
53
|
+
end
|
54
|
+
|
55
|
+
# Serialize an instance of ListSCIMUsersResponse to a JSON object
|
56
|
+
#
|
57
|
+
# @return [String]
|
58
|
+
def to_json(*_args)
|
59
|
+
@_field_set&.to_json
|
60
|
+
end
|
61
|
+
|
62
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
63
|
+
# hash and check each fields type against the current object's property
|
64
|
+
# definitions.
|
65
|
+
#
|
66
|
+
# @param obj [Object]
|
67
|
+
# @return [Void]
|
68
|
+
def self.validate_raw(obj:)
|
69
|
+
obj.scim_users&.is_a?(Array) != false || raise("Passed value for field obj.scim_users is not the expected type, validation failed.")
|
70
|
+
obj.next_page_token&.is_a?(String) != false || raise("Passed value for field obj.next_page_token is not the expected type, validation failed.")
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
@@ -0,0 +1,112 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module SSOReady
|
7
|
+
class Organization
|
8
|
+
# @return [String] Unique identifier for this organization.
|
9
|
+
attr_reader :id
|
10
|
+
# @return [String] The environment this organization belongs to.
|
11
|
+
attr_reader :environment_id
|
12
|
+
# @return [String] An optional human-friendly name for this organization.
|
13
|
+
attr_reader :display_name
|
14
|
+
# @return [String] An identifier you can attach to an organization. Meant to be used to correlate
|
15
|
+
# an SSOReady organization to your
|
16
|
+
# internal equivalent concept.
|
17
|
+
# External IDs are unique within an environment. No two organizations in the same
|
18
|
+
# environment can have
|
19
|
+
# the same external ID.
|
20
|
+
attr_reader :external_id
|
21
|
+
# @return [Array<String>] A list of domains that users from this organization use.
|
22
|
+
# SAML connections and SCIM directories within this organization will only produce
|
23
|
+
# users whose email are included in
|
24
|
+
# `domains`. SSOReady will reject SAML and SCIM users that do not fall within
|
25
|
+
# `domains`.
|
26
|
+
attr_reader :domains
|
27
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
28
|
+
attr_reader :additional_properties
|
29
|
+
# @return [Object]
|
30
|
+
attr_reader :_field_set
|
31
|
+
protected :_field_set
|
32
|
+
|
33
|
+
OMIT = Object.new
|
34
|
+
|
35
|
+
# @param id [String] Unique identifier for this organization.
|
36
|
+
# @param environment_id [String] The environment this organization belongs to.
|
37
|
+
# @param display_name [String] An optional human-friendly name for this organization.
|
38
|
+
# @param external_id [String] An identifier you can attach to an organization. Meant to be used to correlate
|
39
|
+
# an SSOReady organization to your
|
40
|
+
# internal equivalent concept.
|
41
|
+
# External IDs are unique within an environment. No two organizations in the same
|
42
|
+
# environment can have
|
43
|
+
# the same external ID.
|
44
|
+
# @param domains [Array<String>] A list of domains that users from this organization use.
|
45
|
+
# SAML connections and SCIM directories within this organization will only produce
|
46
|
+
# users whose email are included in
|
47
|
+
# `domains`. SSOReady will reject SAML and SCIM users that do not fall within
|
48
|
+
# `domains`.
|
49
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
50
|
+
# @return [SSOReady::Organization]
|
51
|
+
def initialize(id: OMIT, environment_id: OMIT, display_name: OMIT, external_id: OMIT, domains: OMIT,
|
52
|
+
additional_properties: nil)
|
53
|
+
@id = id if id != OMIT
|
54
|
+
@environment_id = environment_id if environment_id != OMIT
|
55
|
+
@display_name = display_name if display_name != OMIT
|
56
|
+
@external_id = external_id if external_id != OMIT
|
57
|
+
@domains = domains if domains != OMIT
|
58
|
+
@additional_properties = additional_properties
|
59
|
+
@_field_set = {
|
60
|
+
"id": id,
|
61
|
+
"environmentId": environment_id,
|
62
|
+
"displayName": display_name,
|
63
|
+
"externalId": external_id,
|
64
|
+
"domains": domains
|
65
|
+
}.reject do |_k, v|
|
66
|
+
v == OMIT
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
# Deserialize a JSON object to an instance of Organization
|
71
|
+
#
|
72
|
+
# @param json_object [String]
|
73
|
+
# @return [SSOReady::Organization]
|
74
|
+
def self.from_json(json_object:)
|
75
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
76
|
+
id = struct["id"]
|
77
|
+
environment_id = struct["environmentId"]
|
78
|
+
display_name = struct["displayName"]
|
79
|
+
external_id = struct["externalId"]
|
80
|
+
domains = struct["domains"]
|
81
|
+
new(
|
82
|
+
id: id,
|
83
|
+
environment_id: environment_id,
|
84
|
+
display_name: display_name,
|
85
|
+
external_id: external_id,
|
86
|
+
domains: domains,
|
87
|
+
additional_properties: struct
|
88
|
+
)
|
89
|
+
end
|
90
|
+
|
91
|
+
# Serialize an instance of Organization to a JSON object
|
92
|
+
#
|
93
|
+
# @return [String]
|
94
|
+
def to_json(*_args)
|
95
|
+
@_field_set&.to_json
|
96
|
+
end
|
97
|
+
|
98
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
99
|
+
# hash and check each fields type against the current object's property
|
100
|
+
# definitions.
|
101
|
+
#
|
102
|
+
# @param obj [Object]
|
103
|
+
# @return [Void]
|
104
|
+
def self.validate_raw(obj:)
|
105
|
+
obj.id&.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
106
|
+
obj.environment_id&.is_a?(String) != false || raise("Passed value for field obj.environment_id is not the expected type, validation failed.")
|
107
|
+
obj.display_name&.is_a?(String) != false || raise("Passed value for field obj.display_name is not the expected type, validation failed.")
|
108
|
+
obj.external_id&.is_a?(String) != false || raise("Passed value for field obj.external_id is not the expected type, validation failed.")
|
109
|
+
obj.domains&.is_a?(Array) != false || raise("Passed value for field obj.domains is not the expected type, validation failed.")
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
@@ -0,0 +1,126 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module SSOReady
|
7
|
+
class RedeemSAMLAccessCodeResponse
|
8
|
+
# @return [String] The user's email address.
|
9
|
+
attr_reader :email
|
10
|
+
# @return [String] The `state` you provided when getting a SAML initiation URL, if any.
|
11
|
+
# If your user logged in to your product using Identity Provider-initiated SAML
|
12
|
+
# (e.g. they clicked on your app inside
|
13
|
+
# their corporate Okta dashboard), then `state` will be empty.
|
14
|
+
# SSOReady validates the authenticity of non-empty `state` values. You do not need
|
15
|
+
# to implement your own CSRF on top
|
16
|
+
# of it, but doing so anyway will have no bad consequences.
|
17
|
+
attr_reader :state
|
18
|
+
# @return [Hash{String => String}] Arbitrary key-value pairs the Identity Provider included about the user.
|
19
|
+
# Typically, these `attributes` are used to pass along the user's first/last name,
|
20
|
+
# or whether they should be
|
21
|
+
# considered an admin within their company.
|
22
|
+
attr_reader :attributes
|
23
|
+
# @return [String] The ID of the organization this user belongs to.
|
24
|
+
attr_reader :organization_id
|
25
|
+
# @return [String] The `externalId`, if any, of the organization this user belongs to.
|
26
|
+
attr_reader :organization_external_id
|
27
|
+
# @return [String] A unique identifier of this particular SAML login. It is not a secret. You can
|
28
|
+
# safely log it.
|
29
|
+
# SSOReady maintains an audit log of every SAML login. Use this SAML flow ID to
|
30
|
+
# find this login in the audit logs.
|
31
|
+
attr_reader :saml_flow_id
|
32
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
33
|
+
attr_reader :additional_properties
|
34
|
+
# @return [Object]
|
35
|
+
attr_reader :_field_set
|
36
|
+
protected :_field_set
|
37
|
+
|
38
|
+
OMIT = Object.new
|
39
|
+
|
40
|
+
# @param email [String] The user's email address.
|
41
|
+
# @param state [String] The `state` you provided when getting a SAML initiation URL, if any.
|
42
|
+
# If your user logged in to your product using Identity Provider-initiated SAML
|
43
|
+
# (e.g. they clicked on your app inside
|
44
|
+
# their corporate Okta dashboard), then `state` will be empty.
|
45
|
+
# SSOReady validates the authenticity of non-empty `state` values. You do not need
|
46
|
+
# to implement your own CSRF on top
|
47
|
+
# of it, but doing so anyway will have no bad consequences.
|
48
|
+
# @param attributes [Hash{String => String}] Arbitrary key-value pairs the Identity Provider included about the user.
|
49
|
+
# Typically, these `attributes` are used to pass along the user's first/last name,
|
50
|
+
# or whether they should be
|
51
|
+
# considered an admin within their company.
|
52
|
+
# @param organization_id [String] The ID of the organization this user belongs to.
|
53
|
+
# @param organization_external_id [String] The `externalId`, if any, of the organization this user belongs to.
|
54
|
+
# @param saml_flow_id [String] A unique identifier of this particular SAML login. It is not a secret. You can
|
55
|
+
# safely log it.
|
56
|
+
# SSOReady maintains an audit log of every SAML login. Use this SAML flow ID to
|
57
|
+
# find this login in the audit logs.
|
58
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
59
|
+
# @return [SSOReady::RedeemSAMLAccessCodeResponse]
|
60
|
+
def initialize(email: OMIT, state: OMIT, attributes: OMIT, organization_id: OMIT, organization_external_id: OMIT,
|
61
|
+
saml_flow_id: OMIT, additional_properties: nil)
|
62
|
+
@email = email if email != OMIT
|
63
|
+
@state = state if state != OMIT
|
64
|
+
@attributes = attributes if attributes != OMIT
|
65
|
+
@organization_id = organization_id if organization_id != OMIT
|
66
|
+
@organization_external_id = organization_external_id if organization_external_id != OMIT
|
67
|
+
@saml_flow_id = saml_flow_id if saml_flow_id != OMIT
|
68
|
+
@additional_properties = additional_properties
|
69
|
+
@_field_set = {
|
70
|
+
"email": email,
|
71
|
+
"state": state,
|
72
|
+
"attributes": attributes,
|
73
|
+
"organizationId": organization_id,
|
74
|
+
"organizationExternalId": organization_external_id,
|
75
|
+
"samlFlowId": saml_flow_id
|
76
|
+
}.reject do |_k, v|
|
77
|
+
v == OMIT
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
# Deserialize a JSON object to an instance of RedeemSAMLAccessCodeResponse
|
82
|
+
#
|
83
|
+
# @param json_object [String]
|
84
|
+
# @return [SSOReady::RedeemSAMLAccessCodeResponse]
|
85
|
+
def self.from_json(json_object:)
|
86
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
87
|
+
email = struct["email"]
|
88
|
+
state = struct["state"]
|
89
|
+
attributes = struct["attributes"]
|
90
|
+
organization_id = struct["organizationId"]
|
91
|
+
organization_external_id = struct["organizationExternalId"]
|
92
|
+
saml_flow_id = struct["samlFlowId"]
|
93
|
+
new(
|
94
|
+
email: email,
|
95
|
+
state: state,
|
96
|
+
attributes: attributes,
|
97
|
+
organization_id: organization_id,
|
98
|
+
organization_external_id: organization_external_id,
|
99
|
+
saml_flow_id: saml_flow_id,
|
100
|
+
additional_properties: struct
|
101
|
+
)
|
102
|
+
end
|
103
|
+
|
104
|
+
# Serialize an instance of RedeemSAMLAccessCodeResponse to a JSON object
|
105
|
+
#
|
106
|
+
# @return [String]
|
107
|
+
def to_json(*_args)
|
108
|
+
@_field_set&.to_json
|
109
|
+
end
|
110
|
+
|
111
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
112
|
+
# hash and check each fields type against the current object's property
|
113
|
+
# definitions.
|
114
|
+
#
|
115
|
+
# @param obj [Object]
|
116
|
+
# @return [Void]
|
117
|
+
def self.validate_raw(obj:)
|
118
|
+
obj.email&.is_a?(String) != false || raise("Passed value for field obj.email is not the expected type, validation failed.")
|
119
|
+
obj.state&.is_a?(String) != false || raise("Passed value for field obj.state is not the expected type, validation failed.")
|
120
|
+
obj.attributes&.is_a?(Hash) != false || raise("Passed value for field obj.attributes is not the expected type, validation failed.")
|
121
|
+
obj.organization_id&.is_a?(String) != false || raise("Passed value for field obj.organization_id is not the expected type, validation failed.")
|
122
|
+
obj.organization_external_id&.is_a?(String) != false || raise("Passed value for field obj.organization_external_id is not the expected type, validation failed.")
|
123
|
+
obj.saml_flow_id&.is_a?(String) != false || raise("Passed value for field obj.saml_flow_id is not the expected type, validation failed.")
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module SSOReady
|
7
|
+
class RotateSCIMDirectoryBearerTokenResponse
|
8
|
+
# @return [String] The new, updated bearer token.
|
9
|
+
# Do not log or store this bearer token. It is an authentication token that your
|
10
|
+
# customer should securely input into
|
11
|
+
# their Identity Provider.
|
12
|
+
attr_reader :bearer_token
|
13
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
14
|
+
attr_reader :additional_properties
|
15
|
+
# @return [Object]
|
16
|
+
attr_reader :_field_set
|
17
|
+
protected :_field_set
|
18
|
+
|
19
|
+
OMIT = Object.new
|
20
|
+
|
21
|
+
# @param bearer_token [String] The new, updated bearer token.
|
22
|
+
# Do not log or store this bearer token. It is an authentication token that your
|
23
|
+
# customer should securely input into
|
24
|
+
# their Identity Provider.
|
25
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
26
|
+
# @return [SSOReady::RotateSCIMDirectoryBearerTokenResponse]
|
27
|
+
def initialize(bearer_token: OMIT, additional_properties: nil)
|
28
|
+
@bearer_token = bearer_token if bearer_token != OMIT
|
29
|
+
@additional_properties = additional_properties
|
30
|
+
@_field_set = { "bearerToken": bearer_token }.reject do |_k, v|
|
31
|
+
v == OMIT
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# Deserialize a JSON object to an instance of
|
36
|
+
# RotateSCIMDirectoryBearerTokenResponse
|
37
|
+
#
|
38
|
+
# @param json_object [String]
|
39
|
+
# @return [SSOReady::RotateSCIMDirectoryBearerTokenResponse]
|
40
|
+
def self.from_json(json_object:)
|
41
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
42
|
+
bearer_token = struct["bearerToken"]
|
43
|
+
new(bearer_token: bearer_token, additional_properties: struct)
|
44
|
+
end
|
45
|
+
|
46
|
+
# Serialize an instance of RotateSCIMDirectoryBearerTokenResponse to a JSON object
|
47
|
+
#
|
48
|
+
# @return [String]
|
49
|
+
def to_json(*_args)
|
50
|
+
@_field_set&.to_json
|
51
|
+
end
|
52
|
+
|
53
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
54
|
+
# hash and check each fields type against the current object's property
|
55
|
+
# definitions.
|
56
|
+
#
|
57
|
+
# @param obj [Object]
|
58
|
+
# @return [Void]
|
59
|
+
def self.validate_raw(obj:)
|
60
|
+
obj.bearer_token&.is_a?(String) != false || raise("Passed value for field obj.bearer_token is not the expected type, validation failed.")
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|