~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/authentication.h

Monty fixes pluss a few from me for charset.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 
 *
 
3
 
4
4
 *  Definitions required for Authentication plugin
 
5
 
5
6
 *
6
7
 *  Copyright (C) 2008 Sun Microsystems
7
8
 *
19
20
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
20
21
 */
21
22
 
 
23
/*
 
24
  Definitions required for Authentication plugin
 
25
*/
 
26
 
22
27
#ifndef DRIZZLED_PLUGIN_AUTHENTICATION_H
23
28
#define DRIZZLED_PLUGIN_AUTHENTICATION_H
24
29
 
25
 
#include <string>
26
 
 
27
 
#include "drizzled/plugin.h"
28
 
#include "drizzled/plugin/plugin.h"
29
 
#include "drizzled/identifier.h"
30
 
 
31
 
namespace drizzled
32
 
{
33
 
 
34
 
namespace identifier {
35
 
class User;
36
 
37
 
 
38
 
namespace plugin
39
 
{
40
 
 
41
 
class Authentication : public Plugin
42
 
{
43
 
  Authentication();
44
 
  Authentication(const Authentication &);
45
 
  Authentication& operator=(const Authentication &);
 
30
class Authentication
 
31
{
46
32
public:
47
 
  explicit Authentication(std::string name_arg)
48
 
    : Plugin(name_arg, "Authentication")
49
 
  {}
 
33
  Authentication() {}
50
34
  virtual ~Authentication() {}
51
35
 
52
 
  virtual bool authenticate(const identifier::User &sctx,
53
 
                            const std::string &passwd)= 0;
 
36
  virtual bool authenticate(Session *, const char *)= 0;
54
37
 
55
 
  static bool addPlugin(plugin::Authentication *auth);
56
 
  static void removePlugin(plugin::Authentication *auth);
57
 
  static bool isAuthenticated(drizzled::identifier::User::const_shared_ptr sctx,
58
 
                              const std::string &password);
59
38
};
60
39
 
61
 
} /* namespace plugin */
62
 
} /* namespace drizzled */
63
 
 
64
40
#endif /* DRIZZLED_PLUGIN_AUTHENTICATION_H */