telvri_security 1.0.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.
@@ -0,0 +1,252 @@
1
+ =begin
2
+ #Telvri Security API Gateway
3
+
4
+ #Developer-first Identity and Security Platform for real-time telco fraud mitigation, including SIM-swap intelligence for trusted application workflows.
5
+
6
+ The version of the OpenAPI document: 1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.23.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module TelvriSecurity
16
+ class DeveloperAuthApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Authenticate a developer account
23
+ # Accepts login credentials and redirects to the dashboard on success.
24
+ # @param email [String] Developer account email address.
25
+ # @param password [String] Account password.
26
+ # @param [Hash] opts the optional parameters
27
+ # @return [nil]
28
+ def auth_controller_login(email, password, opts = {})
29
+ auth_controller_login_with_http_info(email, password, opts)
30
+ nil
31
+ end
32
+
33
+ # Authenticate a developer account
34
+ # Accepts login credentials and redirects to the dashboard on success.
35
+ # @param email [String] Developer account email address.
36
+ # @param password [String] Account password.
37
+ # @param [Hash] opts the optional parameters
38
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
39
+ def auth_controller_login_with_http_info(email, password, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: DeveloperAuthApi.auth_controller_login ...'
42
+ end
43
+ # verify the required parameter 'email' is set
44
+ if @api_client.config.client_side_validation && email.nil?
45
+ fail ArgumentError, "Missing the required parameter 'email' when calling DeveloperAuthApi.auth_controller_login"
46
+ end
47
+ # verify the required parameter 'password' is set
48
+ if @api_client.config.client_side_validation && password.nil?
49
+ fail ArgumentError, "Missing the required parameter 'password' when calling DeveloperAuthApi.auth_controller_login"
50
+ end
51
+ if @api_client.config.client_side_validation && password.to_s.length < 8
52
+ fail ArgumentError, 'invalid value for "password" when calling DeveloperAuthApi.auth_controller_login, the character length must be greater than or equal to 8.'
53
+ end
54
+
55
+ # resource path
56
+ local_var_path = '/auth/login'
57
+
58
+ # query parameters
59
+ query_params = opts[:query_params] || {}
60
+
61
+ # header parameters
62
+ header_params = opts[:header_params] || {}
63
+ # HTTP header 'Content-Type'
64
+ content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded', 'application/json'])
65
+ if !content_type.nil?
66
+ header_params['Content-Type'] = content_type
67
+ end
68
+
69
+ # form parameters
70
+ form_params = opts[:form_params] || {}
71
+ form_params['email'] = email
72
+ form_params['password'] = password
73
+
74
+ # http body (model)
75
+ post_body = opts[:debug_body]
76
+
77
+ # return_type
78
+ return_type = opts[:debug_return_type]
79
+
80
+ # auth_names
81
+ auth_names = opts[:debug_auth_names] || []
82
+
83
+ new_options = opts.merge(
84
+ :operation => :"DeveloperAuthApi.auth_controller_login",
85
+ :header_params => header_params,
86
+ :query_params => query_params,
87
+ :form_params => form_params,
88
+ :body => post_body,
89
+ :auth_names => auth_names,
90
+ :return_type => return_type
91
+ )
92
+
93
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
94
+ if @api_client.config.debugging
95
+ @api_client.config.logger.debug "API called: DeveloperAuthApi#auth_controller_login\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
96
+ end
97
+ return data, status_code, headers
98
+ end
99
+
100
+ # Sign out of the developer dashboard
101
+ # @param [Hash] opts the optional parameters
102
+ # @return [nil]
103
+ def auth_controller_logout(opts = {})
104
+ auth_controller_logout_with_http_info(opts)
105
+ nil
106
+ end
107
+
108
+ # Sign out of the developer dashboard
109
+ # @param [Hash] opts the optional parameters
110
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
111
+ def auth_controller_logout_with_http_info(opts = {})
112
+ if @api_client.config.debugging
113
+ @api_client.config.logger.debug 'Calling API: DeveloperAuthApi.auth_controller_logout ...'
114
+ end
115
+ # resource path
116
+ local_var_path = '/auth/logout'
117
+
118
+ # query parameters
119
+ query_params = opts[:query_params] || {}
120
+
121
+ # header parameters
122
+ header_params = opts[:header_params] || {}
123
+
124
+ # form parameters
125
+ form_params = opts[:form_params] || {}
126
+
127
+ # http body (model)
128
+ post_body = opts[:debug_body]
129
+
130
+ # return_type
131
+ return_type = opts[:debug_return_type]
132
+
133
+ # auth_names
134
+ auth_names = opts[:debug_auth_names] || []
135
+
136
+ new_options = opts.merge(
137
+ :operation => :"DeveloperAuthApi.auth_controller_logout",
138
+ :header_params => header_params,
139
+ :query_params => query_params,
140
+ :form_params => form_params,
141
+ :body => post_body,
142
+ :auth_names => auth_names,
143
+ :return_type => return_type
144
+ )
145
+
146
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
147
+ if @api_client.config.debugging
148
+ @api_client.config.logger.debug "API called: DeveloperAuthApi#auth_controller_logout\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
149
+ end
150
+ return data, status_code, headers
151
+ end
152
+
153
+ # Create a developer account
154
+ # Registers a developer account and redirects to the dashboard on success.
155
+ # @param full_name [String] Full name for the developer account.
156
+ # @param email [String] Work email used for dashboard access and API key delivery.
157
+ # @param password [String] Account password.
158
+ # @param confirm_password [String] Password confirmation.
159
+ # @param [Hash] opts the optional parameters
160
+ # @option opts [String] :company Company or team name.
161
+ # @return [nil]
162
+ def auth_controller_signup(full_name, email, password, confirm_password, opts = {})
163
+ auth_controller_signup_with_http_info(full_name, email, password, confirm_password, opts)
164
+ nil
165
+ end
166
+
167
+ # Create a developer account
168
+ # Registers a developer account and redirects to the dashboard on success.
169
+ # @param full_name [String] Full name for the developer account.
170
+ # @param email [String] Work email used for dashboard access and API key delivery.
171
+ # @param password [String] Account password.
172
+ # @param confirm_password [String] Password confirmation.
173
+ # @param [Hash] opts the optional parameters
174
+ # @option opts [String] :company Company or team name.
175
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
176
+ def auth_controller_signup_with_http_info(full_name, email, password, confirm_password, opts = {})
177
+ if @api_client.config.debugging
178
+ @api_client.config.logger.debug 'Calling API: DeveloperAuthApi.auth_controller_signup ...'
179
+ end
180
+ # verify the required parameter 'full_name' is set
181
+ if @api_client.config.client_side_validation && full_name.nil?
182
+ fail ArgumentError, "Missing the required parameter 'full_name' when calling DeveloperAuthApi.auth_controller_signup"
183
+ end
184
+ # verify the required parameter 'email' is set
185
+ if @api_client.config.client_side_validation && email.nil?
186
+ fail ArgumentError, "Missing the required parameter 'email' when calling DeveloperAuthApi.auth_controller_signup"
187
+ end
188
+ # verify the required parameter 'password' is set
189
+ if @api_client.config.client_side_validation && password.nil?
190
+ fail ArgumentError, "Missing the required parameter 'password' when calling DeveloperAuthApi.auth_controller_signup"
191
+ end
192
+ if @api_client.config.client_side_validation && password.to_s.length < 8
193
+ fail ArgumentError, 'invalid value for "password" when calling DeveloperAuthApi.auth_controller_signup, the character length must be greater than or equal to 8.'
194
+ end
195
+
196
+ # verify the required parameter 'confirm_password' is set
197
+ if @api_client.config.client_side_validation && confirm_password.nil?
198
+ fail ArgumentError, "Missing the required parameter 'confirm_password' when calling DeveloperAuthApi.auth_controller_signup"
199
+ end
200
+ if @api_client.config.client_side_validation && confirm_password.to_s.length < 8
201
+ fail ArgumentError, 'invalid value for "confirm_password" when calling DeveloperAuthApi.auth_controller_signup, the character length must be greater than or equal to 8.'
202
+ end
203
+
204
+ # resource path
205
+ local_var_path = '/auth/signup'
206
+
207
+ # query parameters
208
+ query_params = opts[:query_params] || {}
209
+
210
+ # header parameters
211
+ header_params = opts[:header_params] || {}
212
+ # HTTP header 'Content-Type'
213
+ content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded', 'application/json'])
214
+ if !content_type.nil?
215
+ header_params['Content-Type'] = content_type
216
+ end
217
+
218
+ # form parameters
219
+ form_params = opts[:form_params] || {}
220
+ form_params['fullName'] = full_name
221
+ form_params['email'] = email
222
+ form_params['password'] = password
223
+ form_params['confirmPassword'] = confirm_password
224
+ form_params['company'] = opts[:'company'] if !opts[:'company'].nil?
225
+
226
+ # http body (model)
227
+ post_body = opts[:debug_body]
228
+
229
+ # return_type
230
+ return_type = opts[:debug_return_type]
231
+
232
+ # auth_names
233
+ auth_names = opts[:debug_auth_names] || []
234
+
235
+ new_options = opts.merge(
236
+ :operation => :"DeveloperAuthApi.auth_controller_signup",
237
+ :header_params => header_params,
238
+ :query_params => query_params,
239
+ :form_params => form_params,
240
+ :body => post_body,
241
+ :auth_names => auth_names,
242
+ :return_type => return_type
243
+ )
244
+
245
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
246
+ if @api_client.config.debugging
247
+ @api_client.config.logger.debug "API called: DeveloperAuthApi#auth_controller_signup\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
248
+ end
249
+ return data, status_code, headers
250
+ end
251
+ end
252
+ end
@@ -0,0 +1,93 @@
1
+ =begin
2
+ #Telvri Security API Gateway
3
+
4
+ #Developer-first Identity and Security Platform for real-time telco fraud mitigation, including SIM-swap intelligence for trusted application workflows.
5
+
6
+ The version of the OpenAPI document: 1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.23.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module TelvriSecurity
16
+ class SIMSwapIntelligenceApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Run a real-time SIM-swap risk check
23
+ # Checks a subscriber phone number against mocked global telecom registry intelligence and returns whether recent SIM-swap activity is present. Carrier resolution uses national mobile prefixes worldwide (Nigeria MTN/Airtel/Glo/9mobile, Germany Telekom/Vodafone/O2, US AT&T/T-Mobile/Verizon, UK, India, UAE, and more). Mock rule: numbers ending in 9 report a swap within the last 2 hours.
24
+ # @param check_sim_swap_dto [CheckSimSwapDto]
25
+ # @param [Hash] opts the optional parameters
26
+ # @option opts [String] :x_api_key Developer API key. Alternative: Authorization: Bearer &lt;KEY&gt;.
27
+ # @return [SimSwapResponseDto]
28
+ def sim_swap_controller_check_sim_swap(check_sim_swap_dto, opts = {})
29
+ data, _status_code, _headers = sim_swap_controller_check_sim_swap_with_http_info(check_sim_swap_dto, opts)
30
+ data
31
+ end
32
+
33
+ # Run a real-time SIM-swap risk check
34
+ # Checks a subscriber phone number against mocked global telecom registry intelligence and returns whether recent SIM-swap activity is present. Carrier resolution uses national mobile prefixes worldwide (Nigeria MTN/Airtel/Glo/9mobile, Germany Telekom/Vodafone/O2, US AT&amp;T/T-Mobile/Verizon, UK, India, UAE, and more). Mock rule: numbers ending in 9 report a swap within the last 2 hours.
35
+ # @param check_sim_swap_dto [CheckSimSwapDto]
36
+ # @param [Hash] opts the optional parameters
37
+ # @option opts [String] :x_api_key Developer API key. Alternative: Authorization: Bearer &lt;KEY&gt;.
38
+ # @return [Array<(SimSwapResponseDto, Integer, Hash)>] SimSwapResponseDto data, response status code and response headers
39
+ def sim_swap_controller_check_sim_swap_with_http_info(check_sim_swap_dto, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: SIMSwapIntelligenceApi.sim_swap_controller_check_sim_swap ...'
42
+ end
43
+ # verify the required parameter 'check_sim_swap_dto' is set
44
+ if @api_client.config.client_side_validation && check_sim_swap_dto.nil?
45
+ fail ArgumentError, "Missing the required parameter 'check_sim_swap_dto' when calling SIMSwapIntelligenceApi.sim_swap_controller_check_sim_swap"
46
+ end
47
+ # resource path
48
+ local_var_path = '/v1/security/sim-check'
49
+
50
+ # query parameters
51
+ query_params = opts[:query_params] || {}
52
+
53
+ # header parameters
54
+ header_params = opts[:header_params] || {}
55
+ # HTTP header 'Accept' (if needed)
56
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
57
+ # HTTP header 'Content-Type'
58
+ content_type = @api_client.select_header_content_type(['application/json'])
59
+ if !content_type.nil?
60
+ header_params['Content-Type'] = content_type
61
+ end
62
+ header_params[:'X-API-Key'] = opts[:'x_api_key'] if !opts[:'x_api_key'].nil?
63
+
64
+ # form parameters
65
+ form_params = opts[:form_params] || {}
66
+
67
+ # http body (model)
68
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(check_sim_swap_dto)
69
+
70
+ # return_type
71
+ return_type = opts[:debug_return_type] || 'SimSwapResponseDto'
72
+
73
+ # auth_names
74
+ auth_names = opts[:debug_auth_names] || ['X-API-Key', 'Bearer']
75
+
76
+ new_options = opts.merge(
77
+ :operation => :"SIMSwapIntelligenceApi.sim_swap_controller_check_sim_swap",
78
+ :header_params => header_params,
79
+ :query_params => query_params,
80
+ :form_params => form_params,
81
+ :body => post_body,
82
+ :auth_names => auth_names,
83
+ :return_type => return_type
84
+ )
85
+
86
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
87
+ if @api_client.config.debugging
88
+ @api_client.config.logger.debug "API called: SIMSwapIntelligenceApi#sim_swap_controller_check_sim_swap\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
89
+ end
90
+ return data, status_code, headers
91
+ end
92
+ end
93
+ end