Class: MultiAuthSample::AuthenticationController
- Inherits:
-
BaseController
- Object
- BaseController
- MultiAuthSample::AuthenticationController
- Defined in:
- lib/multi_auth_sample/controllers/authentication_controller.rb
Overview
AuthenticationController
Constant Summary
Constants inherited from BaseController
Instance Attribute Summary
Attributes inherited from BaseController
Instance Method Summary collapse
-
#basic_auth_and_api_header_auth ⇒ String
TODO: type endpoint description here.
-
#custom_authentication ⇒ String
TODO: type endpoint description here.
-
#custom_query_or_header_authentication ⇒ String
TODO: type endpoint description here.
-
#multiple_auth_combination ⇒ String
This endpoint uses globally applied auth which is a hypothetical scneraio but covers the worst case.
-
#no_auth ⇒ String
This endpoint does not use auth.
-
#o_auth_authorization_grant ⇒ User
TODO: type endpoint description here.
-
#o_auth_bearer_token ⇒ String
TODO: type endpoint description here.
-
#o_auth_client_credentials_grant ⇒ ServiceStatus
TODO: type endpoint description here.
-
#o_auth_grant_types_or_combinations ⇒ String
This endpoint tests or combinations of OAuth types.
Methods inherited from BaseController
#initialize, #new_api_call_builder, #new_parameter, #new_request_builder, #new_response_handler, user_agent
Constructor Details
This class inherits a constructor from MultiAuthSample::BaseController
Instance Method Details
#basic_auth_and_api_header_auth ⇒ String
TODO: type endpoint description here
105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/multi_auth_sample/controllers/authentication_controller.rb', line 105 def basic_auth_and_api_header_auth new_api_call_builder .request(new_request_builder(HttpMethodEnum::GET, '/auth/basicAndApiKeyAndApiHeader', Server::DEFAULT) .auth(And.new('basicAuth', 'apiKey', 'apiHeader'))) .response(new_response_handler .deserializer(APIHelper.method(:deserialize_primitive_types)) .deserialize_into(proc do |response| response.to_s end) .is_primitive_response(true)) .execute end |
#custom_authentication ⇒ String
TODO: type endpoint description here
26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/multi_auth_sample/controllers/authentication_controller.rb', line 26 def custom_authentication new_api_call_builder .request(new_request_builder(HttpMethodEnum::GET, '/auth/customAuthentication', Server::DEFAULT) .auth(Single.new('CustomAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:deserialize_primitive_types)) .deserialize_into(proc do |response| response.to_s end) .is_primitive_response(true)) .execute end |
#custom_query_or_header_authentication ⇒ String
TODO: type endpoint description here
41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/multi_auth_sample/controllers/authentication_controller.rb', line 41 def custom_query_or_header_authentication new_api_call_builder .request(new_request_builder(HttpMethodEnum::GET, '/auth/customQueryOrHeaderParam', Server::DEFAULT) .auth(Or.new('apiKey', 'apiHeader'))) .response(new_response_handler .deserializer(APIHelper.method(:deserialize_primitive_types)) .deserialize_into(proc do |response| response.to_s end) .is_primitive_response(true)) .execute end |
#multiple_auth_combination ⇒ String
This endpoint uses globally applied auth which is a hypothetical scneraio but covers the worst case.
136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
# File 'lib/multi_auth_sample/controllers/authentication_controller.rb', line 136 def multiple_auth_combination warn 'Endpoint multiple_auth_combination in AuthenticationController is '\ 'deprecated' new_api_call_builder .request(new_request_builder(HttpMethodEnum::GET, '/auth/multipleAuthCombination', Server::DEFAULT) .auth(Or.new('CustomAuth', 'OAuthBearerToken', And.new('basicAuth', 'apiKey', 'apiHeader')))) .response(new_response_handler .deserializer(APIHelper.method(:deserialize_primitive_types)) .deserialize_into(proc do |response| response.to_s end) .is_primitive_response(true)) .execute end |
#no_auth ⇒ String
This endpoint does not use auth.
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/multi_auth_sample/controllers/authentication_controller.rb', line 71 def no_auth warn 'Endpoint no_auth in AuthenticationController is deprecated since v'\ 'ersion 0.0.1-alpha. You should not use this method as it requir'\ 'es no auth and can bring security issues to the server and api cal'\ 'l itself!!' new_api_call_builder .request(new_request_builder(HttpMethodEnum::GET, '/auth/noAuth', Server::DEFAULT) .query_param(new_parameter(true, key: 'array'))) .response(new_response_handler .deserializer(APIHelper.method(:deserialize_primitive_types)) .deserialize_into(proc do |response| response.to_s end) .is_primitive_response(true)) .execute end |
#o_auth_authorization_grant ⇒ User
TODO: type endpoint description here
120 121 122 123 124 125 126 127 128 129 130 131 |
# File 'lib/multi_auth_sample/controllers/authentication_controller.rb', line 120 def new_api_call_builder .request(new_request_builder(HttpMethodEnum::GET, '/oauth2/non-auth-server/user', Server::DEFAULT) .header_param(new_parameter('application/json', key: 'accept')) .auth(And.new('OAuthACG', 'OAuthROPCG'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(User.method(:from_hash))) .execute end |
#o_auth_bearer_token ⇒ String
TODO: type endpoint description here
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/multi_auth_sample/controllers/authentication_controller.rb', line 11 def o_auth_bearer_token new_api_call_builder .request(new_request_builder(HttpMethodEnum::GET, '/auth/oauth2', Server::DEFAULT) .auth(Single.new('OAuthBearerToken'))) .response(new_response_handler .deserializer(APIHelper.method(:deserialize_primitive_types)) .deserialize_into(proc do |response| response.to_s end) .is_primitive_response(true)) .execute end |
#o_auth_client_credentials_grant ⇒ ServiceStatus
TODO: type endpoint description here
90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/multi_auth_sample/controllers/authentication_controller.rb', line 90 def o_auth_client_credentials_grant new_api_call_builder .request(new_request_builder(HttpMethodEnum::GET, '/oauth2/non-auth-server/status', Server::DEFAULT) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('OAuthCCG'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(ServiceStatus.method(:from_hash))) .execute end |
#o_auth_grant_types_or_combinations ⇒ String
This endpoint tests or combinations of OAuth types
56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/multi_auth_sample/controllers/authentication_controller.rb', line 56 def o_auth_grant_types_or_combinations new_api_call_builder .request(new_request_builder(HttpMethodEnum::GET, '/oauth2/oauthOrCombination', Server::DEFAULT) .auth(Or.new('OAuthCCG', 'OAuthBearerToken'))) .response(new_response_handler .deserializer(APIHelper.method(:deserialize_primitive_types)) .deserialize_into(proc do |response| response.to_s end) .is_primitive_response(true)) .execute end |