~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin_authentication.h

code clean move Item_func_abs, Item_func_int_exp, Item_func_ln, Item_func_log to functions directory

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
 
 *  Definitions required for Authentication plugin
5
 
 *
6
 
 *  Copyright (C) 2008 Sun Microsystems
 
4
 *  Copyright (C) 2008 Brian Aker
7
5
 *
8
6
 *  This program is free software; you can redistribute it and/or modify
9
7
 *  it under the terms of the GNU General Public License as published by
19
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
20
18
 */
21
19
 
 
20
/*
 
21
  Definitions required for Authentication plugin
 
22
*/
 
23
 
22
24
#ifndef DRIZZLED_PLUGIN_AUTHENTICATION_H
23
25
#define DRIZZLED_PLUGIN_AUTHENTICATION_H
24
26
 
25
 
#include <string>
26
 
 
27
 
#include "drizzled/plugin.h"
28
 
#include "drizzled/plugin/plugin.h"
29
 
 
30
 
namespace drizzled
31
 
{
32
 
class SecurityContext;
33
 
 
34
 
namespace plugin
35
 
{
36
 
 
37
 
class Authentication : public Plugin
38
 
{
39
 
  Authentication();
40
 
  Authentication(const Authentication &);
41
 
  Authentication& operator=(const Authentication &);
42
 
public:
43
 
  explicit Authentication(std::string name_arg)
44
 
    : Plugin(name_arg, "Authentication")
45
 
  {}
46
 
  virtual ~Authentication() {}
47
 
 
48
 
  virtual bool authenticate(const SecurityContext &sctx,
49
 
                            const std::string &passwd)= 0;
50
 
 
51
 
  static bool addPlugin(plugin::Authentication *auth);
52
 
  static void removePlugin(plugin::Authentication *auth);
53
 
  static bool isAuthenticated(const SecurityContext &sctx,
54
 
                              const std::string &password);
55
 
};
56
 
 
57
 
} /* namespace plugin */
58
 
} /* namespace drizzled */
 
27
typedef struct authentication_st
 
28
{
 
29
  bool (*authenticate)(THD *thd, const char *password);
 
30
} authentication_st;
59
31
 
60
32
#endif /* DRIZZLED_PLUGIN_AUTHENTICATION_H */