~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin_authentication.h

  • Committer: Monty
  • Date: 2008-11-07 05:51:15 UTC
  • mto: This revision was merged to the branch mainline in revision 579.
  • Revision ID: mordred@palanthas.inaugust.com-20081107055115-0275gvq62buzls77
Fixed a decimal sign thing.

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
 
 *
4
 
 *  Definitions required for Authentication plugin
5
 
 *
6
 
 *  Copyright (C) 2008 Sun Microsystems, Inc.
 
3
 
 
4
 *  Definitions required for Authentication plugin 
 
5
 
 
6
 *
 
7
 *  Copyright (C) 2008 Brian Aker
7
8
 *
8
9
 *  This program is free software; you can redistribute it and/or modify
9
10
 *  it under the terms of the GNU General Public License as published by
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
 
#include "drizzled/visibility.h"
32
 
 
33
 
namespace drizzled
34
 
{
35
 
 
36
 
namespace identifier {
37
 
class User;
38
 
39
 
 
40
 
namespace plugin
41
 
{
42
 
 
43
 
class DRIZZLED_API Authentication : public Plugin
44
 
{
45
 
  Authentication();
46
 
  Authentication(const Authentication &);
47
 
  Authentication& operator=(const Authentication &);
48
 
public:
49
 
  explicit Authentication(std::string name_arg)
50
 
    : Plugin(name_arg, "Authentication")
51
 
  {}
52
 
  virtual ~Authentication() {}
53
 
 
54
 
  virtual bool authenticate(const identifier::User &sctx,
55
 
                            const std::string &passwd)= 0;
56
 
 
57
 
  static bool addPlugin(plugin::Authentication *auth);
58
 
  static void removePlugin(plugin::Authentication *auth);
59
 
  static bool isAuthenticated(drizzled::identifier::User::const_shared_ptr sctx,
60
 
                              const std::string &password);
61
 
};
62
 
 
63
 
} /* namespace plugin */
64
 
} /* namespace drizzled */
 
30
typedef struct authentication_st
 
31
{
 
32
  bool (*authenticate)(Session *session, const char *password);
 
33
} authentication_st;
65
34
 
66
35
#endif /* DRIZZLED_PLUGIN_AUTHENTICATION_H */