Drizzled Public API Documentation

auth_schema.h
1 /* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3  *
4  * Copyright 2011 Daniel Nichter
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; version 2 of the License.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18  */
19 
20 #pragma once
21 #include <drizzled/session.h>
22 #include <drizzled/plugin/authentication.h>
23 #include PCRE_HEADER
24 
25 using namespace std;
26 using namespace drizzled;
27 
28 namespace drizzle_plugin {
29 namespace auth_schema {
30 
32 {
33 public:
34  AuthSchema(bool enabled);
35  ~AuthSchema();
36 
46  bool setTable(const string &table);
47 
54  string sysvar_table;
55 
56 private:
60  bool authenticate(const identifier::User &sctx, const string &password);
61 
83  bool verifyMySQLPassword(const string &real_password,
84  const string &scramble_bytes,
85  const string &client_password);
86 
104  string escapeQuoteAuthTable(const string &table);
105 
114  string escapeQuoteIdentifier(const string &input);
115 
129  string escapeString(const string &input);
130 
131  pcre *_ident_re;
132  Session::shared_ptr _session;
133 };
134 
135 } /* end namespace drizzle_plugin::auth_schema */
136 } /* end namespace drizzle_plugin */