Remoto - VFS: VFS_curlauth.h Source File
Remoto - VFS
VFS_curlauth.h
Go to the documentation of this file.
1 #ifndef VFS_CURLAUTH_H
2 #define VFS_CURLAUTH_H
3 
4 #include <QUrl>
5 #include <QNetworkReply>
6 #include <QNetworkAccessManager>
7 #include <QMap>
8 
9 #include "VFS_auth.h"
10 
11 class VFS_curlauth : public VFS_auth
12 {
13  Q_OBJECT
14 
15  public:
16  Q_INVOKABLE explicit VFS_curlauth(QString url,QString token="");
17  virtual ~VFS_curlauth();
18 
19  protected:
20  virtual void ls(VFS_request *r);
21  virtual void read(VFS_request *r);
22 
23  private:
24  QUrl _url;
25  QNetworkAccessManager _manager;
26  QMap< QNetworkReply *, VFS_request *> _requests;
27  QString _token;
28  signals:
29 
30  public slots:
31  void replyFinished( QNetworkReply *reply );
32  void sslErrors( QNetworkReply *reply, QList<QSslError> errors);
33 };
34 
35 #endif // VFS_CURLAUTH_H
The base class for authenticating users.
Definition: VFS_auth.h:7
The VFS_curlauth authenticator performs a POST request to a url for authentication.
Definition: VFS_curlauth.h:12
virtual ~VFS_curlauth()
QNetworkAccessManager _manager
The curl connection manager.
Definition: VFS_curlauth.h:25
void sslErrors(QNetworkReply *reply, QList< QSslError > errors)
An ssl error has occurred...
QMap< QNetworkReply *, VFS_request * > _requests
A map of outstanding VFS_request objects to their QNetworkReply objects.
Definition: VFS_curlauth.h:26
virtual void ls(VFS_request *r)
List the users available for this auth method.
virtual void read(VFS_request *r)
Perform an authentication request by read()ing from this node, which will curl the _url via http POST...
QUrl _url
The url to curl.
Definition: VFS_curlauth.h:24
Q_INVOKABLE VFS_curlauth(QString url, QString token="")
void replyFinished(QNetworkReply *reply)
A network request has completed.
QString _token
A token sent when requesting a listing from a remote url.
Definition: VFS_curlauth.h:27
The base class for all requests between nodes.
Definition: VFS_node.h:54