/usr/include/Wt/Auth/FormBaseModel is in libwt-dev 3.3.0-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | // This may look like C code, but it's really -*- C++ -*-
/*
* Copyright (C) 2011 Emweb bvba, Kessel-Lo, Belgium.
*
* See the LICENSE file for terms of use.
*/
#ifndef WT_AUTH_FORM_BASE_MODEL_H_
#define WT_AUTH_FORM_BASE_MODEL_H_
#include <Wt/WFormModel>
namespace Wt {
namespace Auth {
class AbstractPasswordService;
class AbstractUserDatabase;
class OAuthService;
/*! \class FormBaseModel Wt/Auth/FormBaseModel
* \brief A base model class for authentication-related forms
*
* This class manages the the auth services and the user database which
* an authentication model will use to implement a form..
*
* \ingroup auth
*/
class WT_API FormBaseModel : public WFormModel
{
public:
//! \brief Login name field.
static const Field LoginNameField;
/*! \brief Constructor.
*/
FormBaseModel(const AuthService& baseAuth, AbstractUserDatabase& users,
WObject *parent = 0);
/*! \brief Returns the authentication base service.
*
* This returns the service passed through the constructor.
*/
const AuthService *baseAuth() const { return &baseAuth_; }
/*! \brief Returns the user database.
*/
AbstractUserDatabase& users() { return users_; }
/*! \brief Adds a password authentication service.
*
* This enables password-based registration, including choosing a proper
* password.
*
* Only one password authentication service can be configured.
*
* \sa addOAuth()
* \sa AbstractPasswordService::validatePassword()
*/
virtual void addPasswordAuth(const AbstractPasswordService *auth);
/*! \brief Returns the password authentication service.
*
* \sa addPasswordAuth()
*/
const AbstractPasswordService *passwordAuth() const { return passwordAuth_; }
/*! \brief Adds an OAuth authentication service provider.
*
* This enables OAuth-based registration. More than one OAuth
* authentication service can be configured: one for each supported
* third-party OAuth identity provider.
*
* \sa addPasswordAuth()
*/
virtual void addOAuth(const OAuthService *auth);
/*! \brief Adds a list of OAuth authentication service providers.
*
* \sa addOAuth()
*/
virtual void addOAuth(const std::vector<const OAuthService *>& auth);
/*! \brief Returns the list of OAuth authentication service providers.
*
* \sa addOAuth()
*/
std::vector<const OAuthService *> oAuth() const { return oAuth_; }
virtual WString label(Field field) const;
protected:
void setValid(Field field);
void setValid(Field field, const WString& message);
private:
const AuthService& baseAuth_;
AbstractUserDatabase& users_;
const AbstractPasswordService *passwordAuth_;
std::vector<const OAuthService *> oAuth_;
};
}
}
#endif // WT_AUTH_FORM_BASE_MODEL_H_
|