-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathHttpAuthenticator.h
More file actions
69 lines (56 loc) · 2.04 KB
/
Copy pathHttpAuthenticator.h
File metadata and controls
69 lines (56 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
* Copyright 2017 Sony Corporation
*/
#ifndef EASYHTTPCPP_HTTPAUTHENTICATOR_H_INCLUDED
#define EASYHTTPCPP_HTTPAUTHENTICATOR_H_INCLUDED
#include <string>
#include "Poco/AutoPtr.h"
#include "Poco/RefCountedObject.h"
#include "Poco/SharedPtr.h"
#include "easyhttpcpp/common/Future.h"
#include "easyhttpcpp/HttpAuthenticatorCallback.h"
#include "easyhttpcpp/HttpAuthenticatorTypeDefs.h"
namespace easyhttpcpp {
/**
* @class HttpAuthenticator HttpAuthenticator.h "easyhttpcpp/HttpAuthenticator.h"
*
* Represents an object that knows how to obtain authentication for a network connection.
*/
class HttpAuthenticator : public Poco::RefCountedObject {
public:
/**
* A "smart" pointer for Loader to facilitate reference counting based garbage collection.
*/
typedef Poco::AutoPtr<HttpAuthenticator> Ptr;
virtual ~HttpAuthenticator()
{
}
/**
* Fetches authorization either from cache (if present) or from server asynchronously.
*
* @return future object to cancel or wait for authorization.
*/
virtual HttpAuthorizationFuturePtr getAuthorization() = 0;
/**
* Fetches authorization either from cache (if present) or from server asynchronously.
*
* @param pCallback the callback object to receive result.
* @return future object to cancel or wait for authorization.
*/
virtual HttpAuthorizationFuturePtr getAuthorization(HttpAuthenticatorCallback::Ptr pCallback) = 0;
/**
* Fetches new authorization from server asynchronously.
*
* @return future object to cancel or wait for authorization.
*/
virtual HttpAuthorizationFuturePtr getNewAuthorization() = 0;
/**
* Fetches new authorization from server asynchronously.
*
* @param pCallback the callback object to receive result.
* @return future object to cancel or wait for authorization.
*/
virtual HttpAuthorizationFuturePtr getNewAuthorization(HttpAuthenticatorCallback::Ptr pCallback) = 0;
};
} /* namespace easyhttpcpp */
#endif /* EASYHTTPCPP_HTTPAUTHENTICATOR_H_INCLUDED */