2010-07-23 14:04:18 +02:00
|
|
|
/*
|
|
|
|
* PROGRAM: Firebird authentication
|
|
|
|
* MODULE: Auth.h
|
|
|
|
* DESCRIPTION: Implementation of interfaces, passed to plugins
|
|
|
|
* Plugins loader
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Initial
|
|
|
|
* Developer's Public License Version 1.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the
|
|
|
|
* License. You may obtain a copy of the License at
|
|
|
|
* http://www.ibphoenix.com/main.nfs?a=ibphoenix&page=ibp_idpl.
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed AS IS,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing rights
|
|
|
|
* and limitations under the License.
|
|
|
|
*
|
|
|
|
* The Original Code was created by Alex Peshkov
|
|
|
|
* for the Firebird Open Source RDBMS project.
|
|
|
|
*
|
|
|
|
* Copyright (c) 2010 Alex Peshkov <peshkoff at mail.ru>
|
|
|
|
* and all contributors signed below.
|
|
|
|
*
|
|
|
|
* All Rights Reserved.
|
|
|
|
* Contributor(s): ______________________________________.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef FB_AUTHDBG_H
|
|
|
|
#define FB_AUTHDBG_H
|
|
|
|
|
2011-01-14 18:31:40 +01:00
|
|
|
#define AUTH_DEBUG
|
2010-07-23 14:04:18 +02:00
|
|
|
|
|
|
|
#ifdef AUTH_DEBUG
|
|
|
|
|
|
|
|
#include "../auth/AuthInterface.h"
|
2011-01-14 18:31:40 +01:00
|
|
|
#include "../common/classes/ImplementHelper.h"
|
2010-07-23 14:04:18 +02:00
|
|
|
#include "../common/classes/ClumpletWriter.h"
|
|
|
|
#include "../common/classes/init.h"
|
|
|
|
#include "../common/classes/array.h"
|
|
|
|
#include "../common/classes/fb_string.h"
|
|
|
|
|
|
|
|
namespace Auth {
|
|
|
|
|
|
|
|
// The idea of debug plugin is to send some data from server to client,
|
|
|
|
// modify them on client and return result (which becomes login name) to the server
|
|
|
|
|
2011-04-08 17:18:50 +02:00
|
|
|
class DebugServer : public Firebird::StdPlugin<IServer, FB_AUTH_SERVER_VERSION>
|
2010-07-23 14:04:18 +02:00
|
|
|
{
|
|
|
|
public:
|
2011-04-07 19:16:00 +02:00
|
|
|
DebugServer(Firebird::IPluginConfig*);
|
2010-07-23 14:04:18 +02:00
|
|
|
|
2011-10-04 14:51:57 +02:00
|
|
|
Result startAuthentication(Firebird::IStatus* status, const AuthTags* tags, IClumplets* dpb,
|
|
|
|
IWriter* writerInterface);
|
|
|
|
Result contAuthentication(Firebird::IStatus* status, const unsigned char* data,
|
|
|
|
unsigned int size, IWriter* writerInterface);
|
2010-07-23 14:04:18 +02:00
|
|
|
void getData(const unsigned char** data, unsigned short* dataSize);
|
2011-01-14 18:31:40 +01:00
|
|
|
int release();
|
2010-07-23 14:04:18 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
Firebird::string str;
|
|
|
|
};
|
|
|
|
|
2011-04-08 17:18:50 +02:00
|
|
|
class DebugClient : public Firebird::StdPlugin<IClient, FB_AUTH_CLIENT_VERSION>
|
2010-07-23 14:04:18 +02:00
|
|
|
{
|
|
|
|
public:
|
2011-04-07 19:16:00 +02:00
|
|
|
DebugClient(Firebird::IPluginConfig*);
|
2010-07-23 14:04:18 +02:00
|
|
|
|
2011-10-04 14:51:57 +02:00
|
|
|
Result startAuthentication(Firebird::IStatus* status, const AuthTags* tags, IClumplets* dpb);
|
2011-04-07 19:16:00 +02:00
|
|
|
Result contAuthentication(Firebird::IStatus* status, const unsigned char* data, unsigned int size);
|
2010-07-23 14:04:18 +02:00
|
|
|
void getData(const unsigned char** data, unsigned short* dataSize);
|
2011-01-14 18:31:40 +01:00
|
|
|
int release();
|
2010-07-23 14:04:18 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
Firebird::string str;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Auth
|
|
|
|
|
|
|
|
#endif // AUTH_DEBUG
|
|
|
|
|
|
|
|
#endif // FB_AUTHDBG_H
|