Class: Kleister::AuthApi
- Inherits:
-
Object
- Object
- Kleister::AuthApi
- Defined in:
- lib/kleister/api/auth_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#callback_provider(provider, opts = {}) ⇒ nil
Callback to parse the defined provider.
-
#callback_provider_with_http_info(provider, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Callback to parse the defined provider.
-
#initialize(api_client = ApiClient.default) ⇒ AuthApi
constructor
A new instance of AuthApi.
-
#list_providers(opts = {}) ⇒ ListProviders200Response
Fetch the available auth providers.
-
#list_providers_with_http_info(opts = {}) ⇒ Array<(ListProviders200Response, Integer, Hash)>
Fetch the available auth providers.
-
#login_auth(login_auth_request, opts = {}) ⇒ AuthToken
Authenticate an user by credentials.
-
#login_auth_with_http_info(login_auth_request, opts = {}) ⇒ Array<(AuthToken, Integer, Hash)>
Authenticate an user by credentials.
-
#redirect_auth(redirect_auth_request, opts = {}) ⇒ AuthToken
Retrieve real token after redirect.
-
#redirect_auth_with_http_info(redirect_auth_request, opts = {}) ⇒ Array<(AuthToken, Integer, Hash)>
Retrieve real token after redirect.
-
#refresh_auth(opts = {}) ⇒ AuthToken
Refresh an auth token before it expires.
-
#refresh_auth_with_http_info(opts = {}) ⇒ Array<(AuthToken, Integer, Hash)>
Refresh an auth token before it expires.
-
#request_provider(provider, opts = {}) ⇒ nil
Request the redirect to defined provider.
-
#request_provider_with_http_info(provider, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Request the redirect to defined provider.
-
#verify_auth(opts = {}) ⇒ AuthVerify
Verify validity for an authentication token.
-
#verify_auth_with_http_info(opts = {}) ⇒ Array<(AuthVerify, Integer, Hash)>
Verify validity for an authentication token.
Constructor Details
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
15 16 17 |
# File 'lib/kleister/api/auth_api.rb', line 15 def api_client @api_client end |
Instance Method Details
#callback_provider(provider, opts = {}) ⇒ nil
Callback to parse the defined provider
27 28 29 30 |
# File 'lib/kleister/api/auth_api.rb', line 27 def callback_provider(provider, opts = {}) callback_provider_with_http_info(provider, opts) nil end |
#callback_provider_with_http_info(provider, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Callback to parse the defined provider
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/kleister/api/auth_api.rb', line 38 def callback_provider_with_http_info(provider, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AuthApi.callback_provider ...' end # verify the required parameter 'provider' is set if @api_client.config.client_side_validation && provider.nil? raise ArgumentError, "Missing the required parameter 'provider' when calling AuthApi.callback_provider" end # resource path local_var_path = '/auth/{provider}/callback'.sub('{' + 'provider' + '}', CGI.escape(provider.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:state] = opts[:state] unless opts[:state].nil? query_params[:code] = opts[:code] unless opts[:code].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['text/html']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || [] = opts.merge( operation: :'AuthApi.callback_provider', header_params: header_params, query_params: query_params, form_params: form_params, body: post_body, auth_names: auth_names, return_type: return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AuthApi#callback_provider\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end [data, status_code, headers] end |
#list_providers(opts = {}) ⇒ ListProviders200Response
Fetch the available auth providers
92 93 94 95 |
# File 'lib/kleister/api/auth_api.rb', line 92 def list_providers(opts = {}) data, _status_code, _headers = list_providers_with_http_info(opts) data end |
#list_providers_with_http_info(opts = {}) ⇒ Array<(ListProviders200Response, Integer, Hash)>
Fetch the available auth providers
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 |
# File 'lib/kleister/api/auth_api.rb', line 100 def list_providers_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AuthApi.list_providers ...' end # resource path local_var_path = '/auth/providers' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListProviders200Response' # auth_names auth_names = opts[:debug_auth_names] || [] = opts.merge( operation: :'AuthApi.list_providers', header_params: header_params, query_params: query_params, form_params: form_params, body: post_body, auth_names: auth_names, return_type: return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AuthApi#list_providers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end [data, status_code, headers] end |
#login_auth(login_auth_request, opts = {}) ⇒ AuthToken
Authenticate an user by credentials
148 149 150 151 |
# File 'lib/kleister/api/auth_api.rb', line 148 def login_auth(login_auth_request, opts = {}) data, _status_code, _headers = login_auth_with_http_info(login_auth_request, opts) data end |
#login_auth_with_http_info(login_auth_request, opts = {}) ⇒ Array<(AuthToken, Integer, Hash)>
Authenticate an user by credentials
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 |
# File 'lib/kleister/api/auth_api.rb', line 157 def login_auth_with_http_info(login_auth_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AuthApi.login_auth ...' end # verify the required parameter 'login_auth_request' is set if @api_client.config.client_side_validation && login_auth_request.nil? raise ArgumentError, "Missing the required parameter 'login_auth_request' when calling AuthApi.login_auth" end # resource path local_var_path = '/auth/login' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) unless content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(login_auth_request) # return_type return_type = opts[:debug_return_type] || 'AuthToken' # auth_names auth_names = opts[:debug_auth_names] || [] = opts.merge( operation: :'AuthApi.login_auth', header_params: header_params, query_params: query_params, form_params: form_params, body: post_body, auth_names: auth_names, return_type: return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AuthApi#login_auth\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end [data, status_code, headers] end |
#redirect_auth(redirect_auth_request, opts = {}) ⇒ AuthToken
Retrieve real token after redirect
215 216 217 218 |
# File 'lib/kleister/api/auth_api.rb', line 215 def redirect_auth(redirect_auth_request, opts = {}) data, _status_code, _headers = redirect_auth_with_http_info(redirect_auth_request, opts) data end |
#redirect_auth_with_http_info(redirect_auth_request, opts = {}) ⇒ Array<(AuthToken, Integer, Hash)>
Retrieve real token after redirect
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 |
# File 'lib/kleister/api/auth_api.rb', line 224 def redirect_auth_with_http_info(redirect_auth_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AuthApi.redirect_auth ...' end # verify the required parameter 'redirect_auth_request' is set if @api_client.config.client_side_validation && redirect_auth_request.nil? raise ArgumentError, "Missing the required parameter 'redirect_auth_request' when calling AuthApi.redirect_auth" end # resource path local_var_path = '/auth/redirect' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) unless content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(redirect_auth_request) # return_type return_type = opts[:debug_return_type] || 'AuthToken' # auth_names auth_names = opts[:debug_auth_names] || [] = opts.merge( operation: :'AuthApi.redirect_auth', header_params: header_params, query_params: query_params, form_params: form_params, body: post_body, auth_names: auth_names, return_type: return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AuthApi#redirect_auth\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end [data, status_code, headers] end |
#refresh_auth(opts = {}) ⇒ AuthToken
Refresh an auth token before it expires
281 282 283 284 |
# File 'lib/kleister/api/auth_api.rb', line 281 def refresh_auth(opts = {}) data, _status_code, _headers = refresh_auth_with_http_info(opts) data end |
#refresh_auth_with_http_info(opts = {}) ⇒ Array<(AuthToken, Integer, Hash)>
Refresh an auth token before it expires
289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 |
# File 'lib/kleister/api/auth_api.rb', line 289 def refresh_auth_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AuthApi.refresh_auth ...' end # resource path local_var_path = '/auth/refresh' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'AuthToken' # auth_names auth_names = opts[:debug_auth_names] || %w[Basic Header Bearer] = opts.merge( operation: :'AuthApi.refresh_auth', header_params: header_params, query_params: query_params, form_params: form_params, body: post_body, auth_names: auth_names, return_type: return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AuthApi#refresh_auth\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end [data, status_code, headers] end |
#request_provider(provider, opts = {}) ⇒ nil
Request the redirect to defined provider
337 338 339 340 |
# File 'lib/kleister/api/auth_api.rb', line 337 def request_provider(provider, opts = {}) request_provider_with_http_info(provider, opts) nil end |
#request_provider_with_http_info(provider, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Request the redirect to defined provider
346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 |
# File 'lib/kleister/api/auth_api.rb', line 346 def request_provider_with_http_info(provider, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AuthApi.request_provider ...' end # verify the required parameter 'provider' is set if @api_client.config.client_side_validation && provider.nil? raise ArgumentError, "Missing the required parameter 'provider' when calling AuthApi.request_provider" end # resource path local_var_path = '/auth/{provider}/request'.sub('{' + 'provider' + '}', CGI.escape(provider.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['text/html']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || [] = opts.merge( operation: :'AuthApi.request_provider', header_params: header_params, query_params: query_params, form_params: form_params, body: post_body, auth_names: auth_names, return_type: return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AuthApi#request_provider\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end [data, status_code, headers] end |
#verify_auth(opts = {}) ⇒ AuthVerify
Verify validity for an authentication token
398 399 400 401 |
# File 'lib/kleister/api/auth_api.rb', line 398 def verify_auth(opts = {}) data, _status_code, _headers = verify_auth_with_http_info(opts) data end |
#verify_auth_with_http_info(opts = {}) ⇒ Array<(AuthVerify, Integer, Hash)>
Verify validity for an authentication token
406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 |
# File 'lib/kleister/api/auth_api.rb', line 406 def verify_auth_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AuthApi.verify_auth ...' end # resource path local_var_path = '/auth/verify' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'AuthVerify' # auth_names auth_names = opts[:debug_auth_names] || %w[Basic Header Bearer] = opts.merge( operation: :'AuthApi.verify_auth', header_params: header_params, query_params: query_params, form_params: form_params, body: post_body, auth_names: auth_names, return_type: return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AuthApi#verify_auth\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end [data, status_code, headers] end |