libqtaws  0.1.0
UnofficialAWSlibraryforQt
awsabstractcredentials.h
1 /*
2  Copyright 2013-2015 Paul Colby
3 
4  This file is part of libqtaws.
5 
6  Libqtaws is free software: you can redistribute it and/or modify
7  it under the terms of the GNU Lesser General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  Libqtaws is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public License
17  along with libqtaws. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #ifndef AWSABSTRACTCREDENTIALS_H
21 #define AWSABSTRACTCREDENTIALS_H
22 
23 #include "qtawsglobal.h"
24 
25 #include <QDateTime>
26 #include <QObject>
27 
28 QTAWS_BEGIN_NAMESPACE
29 
30 class QTAWS_EXPORT AwsAbstractCredentials : public QObject {
31  Q_OBJECT
32 
33 public:
34  AwsAbstractCredentials(QObject * const parent = 0);
35 
36  virtual QString accessKeyId() const = 0;
37  virtual QString secretKey() const = 0;
38  virtual QString token() const = 0;
39 
40  // Support for refreshable credentials. Note, we could use meta-data inspection
41  // here, such as QObject::inherits and QObject::qobject_cast, but isRefreshable()
42  // is likely to be called before every service call, so performance is especially
43  // important here
44  virtual QDateTime expiration() const;
45  virtual bool isExpired() const;
46  virtual bool isRefreshable() const;
47 
48 public slots:
49  virtual bool refresh();
50 
51 signals:
52  void changed();
53 
54 };
55 
56 QTAWS_END_NAMESPACE
57 
58 #endif
Interface class for providing AWS credentials.
Definition: awsabstractcredentials.h:30