identityinfo.h
/*
* This file is part of signon
*
* Copyright (C) 2009-2010 Nokia Corporation.
* Copyright (C) 2011-2016 Canonical Ltd.
*
* Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation.
*
* 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
*/
#ifndef IDENTITY_INFO_H
#define IDENTITY_INFO_H
#include <QMetaType>
#include <QStringList>
#include "libsignoncommon.h"
#include "securitycontext.h"
namespace SignOn {
typedef QString MethodName;
typedef QStringList MechanismsList;
typedef QList<SecurityContext> SecurityContextList;
class SIGNON_EXPORT IdentityInfo
{
friend class AuthServiceImpl;
friend class IdentityImpl;
public:
enum CredentialsType {
Other = 0,
Application = 1 << 0,
Web = 1 << 1,
Network = 1 << 2
};
public:
IdentityInfo();
IdentityInfo(const IdentityInfo &other);
IdentityInfo &operator=(const IdentityInfo &other);
IdentityInfo(const QString &caption, const QString &userName,
const QMap<MethodName,MechanismsList> &methods);
~IdentityInfo();
void setId(const quint32 id);
quint32 id() const;
void setSecret(const QString &secret, const bool storeSecret = true);
QString secret() const;
bool isStoringSecret() const;
void setStoreSecret(const bool storeSecret);
void setUserName(const QString &userName);
const QString userName() const;
void setCaption(const QString &caption);
const QString caption() const;
void setRealms(const QStringList &realms);
QStringList realms() const;
void setOwner(const QString &ownerToken);
QString owner() const;
void setAccessControlList(const QStringList &accessControlList);
void setAccessControlList(const SecurityContextList &accessControlList);
QStringList accessControlList() const;
SecurityContextList accessControlListFull() const;
void setMethod(const MethodName &method,
const MechanismsList &mechanismsList);
void removeMethod(const MethodName &method);
void setType(CredentialsType type);
CredentialsType type() const;
QList<MethodName> methods() const;
MechanismsList mechanisms(const MethodName &method) const;
void setRefCount(qint32 refCount);
qint32 refCount() const;
private:
class IdentityInfoImpl *impl;
};
} // namespace SignOn
Q_DECLARE_METATYPE(SignOn::IdentityInfo)
#endif /* IDENTITY_INFO_H */
SignOn::IdentityInfo
Contains identity information.
Definition: identityinfo.h:65
SignOn::IdentityInfo::CredentialsType
CredentialsType
Values used to describe the type of the identity.
Definition: identityinfo.h:76
SignOn
Definition: async-dbus-proxy.cpp:41
SignOn::MethodName
QString MethodName
Defines a string as an authentication method.
Definition: identityinfo.h:43
SignOn::MechanismsList
QStringList MechanismsList
Defines a string list as a list of mechanisms.
Definition: identityinfo.h:49
SignOn::SecurityContextList
QList< SecurityContext > SecurityContextList
Defines a list of security contexts.
Definition: identityinfo.h:55