Apache Mesos
basic_authenticatee.hpp
Go to the documentation of this file.
1 // Licensed to the Apache Software Foundation (ASF) under one
2 // or more contributor license agreements. See the NOTICE file
3 // distributed with this work for additional information
4 // regarding copyright ownership. The ASF licenses this file
5 // to you under the Apache License, Version 2.0 (the
6 // "License"); you may not use this file except in compliance
7 // with the License. You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 
17 #ifndef __AUTHENTICATION_HTTP_BASIC_AUTHENTICATEE_HPP__
18 #define __AUTHENTICATION_HTTP_BASIC_AUTHENTICATEE_HPP__
19 
20 #include <mesos/v1/mesos.hpp>
21 
23 
24 #include <process/future.hpp>
25 #include <process/http.hpp>
26 
27 #include <stout/option.hpp>
28 
29 namespace mesos {
30 namespace http {
31 namespace authentication {
32 
33 class BasicAuthenticateeProcess; // Forward declaration.
34 
40 {
41 public:
43 
44  ~BasicAuthenticatee() override;
45 
46  // Not copy-constructable.
47  BasicAuthenticatee(const BasicAuthenticatee&) = delete;
48 
49  // Not copyable.
51 
52  std::string scheme() const override;
53 
56  const Option<mesos::v1::Credential>& credential) override;
57 
58 private:
60 };
61 
62 } // namespace authentication {
63 } // namespace http {
64 } // namespace mesos {
65 
66 #endif // __AUTHENTICATION_HTTP_BASIC_AUTHENTICATEE_HPP__
Definition: option.hpp:29
Future< Response > request(const Request &request, bool streamedResponse=false)
Asynchronously sends an HTTP request to the process and returns the HTTP response once the entire res...
BasicAuthenticatee & operator=(const BasicAuthenticatee &)=delete
Definition: http.hpp:533
An abstraction enabling any HTTP API consumer to authenticate.
Definition: authenticatee.hpp:34
Definition: agent.hpp:25
std::string scheme() const override
Name of the authentication scheme implemented.
Authenticatee implementing the client side of basic HTTP authentication.
Definition: basic_authenticatee.hpp:39
URI http(const std::string &host, const std::string &path="/", const Option< int > &port=None(), const Option< std::string > &query=None(), const Option< std::string > &fragment=None(), const Option< std::string > &user=None(), const Option< std::string > &password=None())
Creates an http URI with the given parameters.
Definition: http.hpp:35
process::Future< process::http::Request > authenticate(const process::http::Request &request, const Option< mesos::v1::Credential > &credential) override
Create an HTTP request for authentication.
Definition: future.hpp:58