Apache Mesos
combined_authenticator.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 __MESOS_AUTHENTICATION_HTTP_COMBINED_AUTHENTICATOR_HPP__
18 #define __MESOS_AUTHENTICATION_HTTP_COMBINED_AUTHENTICATOR_HPP__
19 
20 #include <string>
21 #include <vector>
22 
23 #include <mesos/mesos.hpp>
24 
26 #include <process/future.hpp>
27 #include <process/http.hpp>
28 #include <process/owned.hpp>
29 
30 #include <stout/hashset.hpp>
31 
32 namespace mesos {
33 namespace http {
34 namespace authentication {
35 
36 class CombinedAuthenticatorProcess;
37 
38 
44 {
45 public:
47  const std::string& realm,
48  std::vector<process::Owned<
50 
55 
56  ~CombinedAuthenticator() override;
57 
125 
130  std::string scheme() const override;
131 
132 private:
134  hashset<std::string> schemes;
135 };
136 
137 } // namespace authentication {
138 } // namespace http {
139 } // namespace mesos {
140 
141 #endif // __MESOS_AUTHENTICATION_HTTP_COMBINED_AUTHENTICATOR_HPP__
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...
An authenticator which holds references to multiple authenticators.
Definition: combined_authenticator.hpp:42
Definition: http.hpp:533
CombinedAuthenticator(const std::string &realm, std::vector< process::Owned< process::http::authentication::Authenticator >> &&authenticators)
The Authenticator interface allows us to implement different authenticators based on the scheme (e...
Definition: authenticator.hpp:103
Definition: agent.hpp:25
Definition: executor.hpp:48
std::string scheme() const override
Returns the authentication schemes offered by the installed authenticators, separated by whitespace...
process::Future< process::http::authentication::AuthenticationResult > authenticate(const process::http::Request &request) override
Authenticates using the installed authenticators.
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
Definition: owned.hpp:36
Definition: future.hpp:58