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_REQUESTS_HPP 18 #define DATASTAX_INTERNAL_AUTH_REQUESTS_HPP 19 20 #include "auth.hpp" 21 #include "constants.hpp" 22 #include "ref_counted.hpp" 23 #include "request.hpp" 24 25 namespace datastax { namespace internal { namespace core { 26 27 class AuthResponseRequest : public Request { 28 public: AuthResponseRequest(const String & token,const Authenticator::Ptr & auth)29 AuthResponseRequest(const String& token, const Authenticator::Ptr& auth) 30 : Request(CQL_OPCODE_AUTH_RESPONSE) 31 , token_(token) 32 , auth_(auth) {} 33 auth() const34 const Authenticator::Ptr& auth() const { return auth_; } 35 36 private: 37 int encode(ProtocolVersion version, RequestCallback* callback, BufferVec* bufs) const; 38 39 private: 40 String token_; 41 Authenticator::Ptr auth_; 42 }; 43 44 }}} // namespace datastax::internal::core 45 46 #endif 47