1 /* 2 Copyright (c) DataStax, Inc. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 #ifndef DATASTAX_INTERNAL_AUTH_RESPONSES_HPP 18 #define DATASTAX_INTERNAL_AUTH_RESPONSES_HPP 19 20 #include "constants.hpp" 21 #include "response.hpp" 22 #include "string.hpp" 23 #include "string_ref.hpp" 24 25 namespace datastax { namespace internal { namespace core { 26 27 class AuthenticateResponse : public Response { 28 public: AuthenticateResponse()29 AuthenticateResponse() 30 : Response(CQL_OPCODE_AUTHENTICATE) {} 31 class_name() const32 const String& class_name() const { return class_name_; } 33 34 virtual bool decode(Decoder& decoder); 35 36 private: 37 String class_name_; 38 }; 39 40 class AuthChallengeResponse : public Response { 41 public: AuthChallengeResponse()42 AuthChallengeResponse() 43 : Response(CQL_OPCODE_AUTH_CHALLENGE) {} 44 token() const45 const String& token() const { return token_; } 46 47 virtual bool decode(Decoder& decoder); 48 49 private: 50 String token_; 51 }; 52 53 class AuthSuccessResponse : public Response { 54 public: AuthSuccessResponse()55 AuthSuccessResponse() 56 : Response(CQL_OPCODE_AUTH_SUCCESS) {} 57 token() const58 const String& token() const { return token_; } 59 60 virtual bool decode(Decoder& decoder); 61 62 private: 63 String token_; 64 }; 65 66 }}} // namespace datastax::internal::core 67 68 #endif 69