1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Definitions required for Authentication plugin
6
* Copyright (C) 2008 Sun Microsystems, Inc.
4
* Definitions required for Authentication plugin
7
* Copyright (C) 2008 Brian Aker
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
24
Definitions required for Authentication plugin
22
27
#ifndef DRIZZLED_PLUGIN_AUTHENTICATION_H
23
28
#define DRIZZLED_PLUGIN_AUTHENTICATION_H
27
#include "drizzled/plugin.h"
28
#include "drizzled/plugin/plugin.h"
29
#include "drizzled/identifier.h"
31
#include "drizzled/visibility.h"
36
namespace identifier {
43
class DRIZZLED_API Authentication : public Plugin
46
Authentication(const Authentication &);
47
Authentication& operator=(const Authentication &);
49
explicit Authentication(std::string name_arg)
50
: Plugin(name_arg, "Authentication")
52
virtual ~Authentication() {}
54
virtual bool authenticate(const identifier::User &sctx,
55
const std::string &passwd)= 0;
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);
63
} /* namespace plugin */
64
} /* namespace drizzled */
30
typedef struct authentication_st
32
bool (*authenticate)(Session *session, const char *password);
66
35
#endif /* DRIZZLED_PLUGIN_AUTHENTICATION_H */