2009-09-02 04:27:16 +02:00
|
|
|
/*
|
|
|
|
* Copyright 2009 by Rob Scheepmaker <r.scheepmaker@student.utwente.nl>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301 USA
|
|
|
|
*/
|
|
|
|
|
2009-12-27 23:16:11 +01:00
|
|
|
#ifndef PLASMA_AUTHORIZATIONMANAGER_P_H
|
|
|
|
#define PLASMA_AUTHORIZATIONMANAGER_P_H
|
2009-09-02 04:27:16 +02:00
|
|
|
|
2009-09-09 23:54:31 +02:00
|
|
|
#include "config-plasma.h"
|
|
|
|
|
2009-09-02 04:27:16 +02:00
|
|
|
#include <QtCore/QMap>
|
|
|
|
#include <QtCore/QString>
|
2009-09-09 23:54:31 +02:00
|
|
|
|
|
|
|
#ifdef ENABLE_REMOTE_WIDGETS
|
2009-09-02 08:22:26 +02:00
|
|
|
#include <QtCrypto>
|
2009-09-09 23:54:31 +02:00
|
|
|
#endif
|
2009-09-02 04:27:16 +02:00
|
|
|
|
|
|
|
#include <kconfiggroup.h>
|
|
|
|
|
2009-09-03 23:10:33 +02:00
|
|
|
#include <authorizationmanager.h>
|
|
|
|
#include <credentials.h>
|
|
|
|
|
2009-09-02 04:27:16 +02:00
|
|
|
class QByteArray;
|
|
|
|
|
|
|
|
namespace KWallet
|
|
|
|
{
|
|
|
|
class Wallet;
|
|
|
|
} // namespace KWallet
|
|
|
|
|
|
|
|
namespace Jolie
|
|
|
|
{
|
|
|
|
class Server;
|
|
|
|
} // namespace Jolie
|
|
|
|
|
|
|
|
namespace Plasma
|
|
|
|
{
|
|
|
|
|
|
|
|
class AuthorizationInterface;
|
|
|
|
class AuthorizationRule;
|
|
|
|
class Credentials;
|
|
|
|
|
|
|
|
class AuthorizationManagerPrivate
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
AuthorizationManagerPrivate(AuthorizationManager *manager);
|
|
|
|
~AuthorizationManagerPrivate();
|
|
|
|
|
2009-09-03 01:49:58 +02:00
|
|
|
void prepareForServiceAccess();
|
|
|
|
void prepareForServicePublication();
|
2009-09-03 01:49:46 +02:00
|
|
|
void slotWalletOpened();
|
|
|
|
void slotLoadRules();
|
2009-09-02 04:27:16 +02:00
|
|
|
AuthorizationRule *matchingRule(const QString &serviceName, const Credentials &key) const;
|
|
|
|
Credentials getCredentials(const QString &id = QString());
|
|
|
|
void addCredentials(const Credentials &identity);
|
2009-09-03 01:49:46 +02:00
|
|
|
void saveRules();
|
2009-09-02 04:27:16 +02:00
|
|
|
|
2009-09-09 23:54:31 +02:00
|
|
|
#ifdef ENABLE_REMOTE_WIDGETS
|
2009-09-02 04:27:16 +02:00
|
|
|
QCA::Initializer initializer;
|
2009-09-09 23:54:31 +02:00
|
|
|
#endif
|
2009-09-02 04:27:16 +02:00
|
|
|
|
|
|
|
AuthorizationManager *q;
|
|
|
|
Jolie::Server *server;
|
|
|
|
AuthorizationManager::AuthorizationPolicy
|
|
|
|
authorizationPolicy;
|
|
|
|
AuthorizationInterface *authorizationInterface;
|
|
|
|
AuthorizationInterface *customAuthorizationInterface;
|
|
|
|
KWallet::Wallet *wallet;
|
|
|
|
|
2009-09-03 01:49:46 +02:00
|
|
|
Credentials myCredentials;
|
|
|
|
QMap<QString, Credentials> identities;
|
2009-09-02 04:27:16 +02:00
|
|
|
QList<AuthorizationRule*> rules;
|
|
|
|
KConfigGroup identitiesConfig;
|
|
|
|
KConfigGroup rulesConfig;
|
|
|
|
bool locked;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2009-12-27 23:16:11 +01:00
|
|
|
#endif // PLASMA_AUTHORIZATIONMANAGER_P_H
|