Apache Mesos
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 __MESOS_AUTHENTICATION_HTTP_AUTHENTICATEE_HPP__
18 #define __MESOS_AUTHENTICATION_HTTP_AUTHENTICATEE_HPP__
19 
20 #include <mesos/v1/mesos.hpp>
21 
22 #include <process/future.hpp>
23 #include <process/http.hpp>
24 
25 #include <stout/option.hpp>
26 
27 namespace mesos {
28 namespace http {
29 namespace authentication {
30 
35 {
36 public:
37  virtual ~Authenticatee() = default;
38 
46  virtual void reset() {};
47 
53  virtual std::string scheme() const = 0;
54 
70  const Option<mesos::v1::Credential>& credential) = 0;
71 };
72 
73 } // namespace authentication {
74 } // namespace http {
75 } // namespace mesos {
76 
77 #endif // __MESOS_AUTHENTICATION_HTTP_AUTHENTICATEE_HPP__
Definition: option.hpp:28
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...
Definition: http.hpp:520
virtual std::string scheme() const =0
Name of the authentication scheme implemented.
An abstraction enabling any HTTP API consumer to authenticate.
Definition: authenticatee.hpp:34
Definition: spec.hpp:26
virtual process::Future< process::http::Request > authenticate(const process::http::Request &request, const Option< mesos::v1::Credential > &credential)=0
Create an HTTP request for authentication.
virtual void reset()
Reset the authenticatee to its initial state.
Definition: authenticatee.hpp:46
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: future.hpp:58