first check-in of feisty meow codebase. many things broken still due to recent
[feisty_meow.git] / octopi / library / cromp / cromp_security.h
1 #ifndef CROMP_SECURITY_CLASS
2 #define CROMP_SECURITY_CLASS
3
4 /***
5 *                                                                             *
6 *  Name   : cromp_security
7 *  Author : Chris Koeritz
8 * Copyright (c) 2002-$now By Author.  This program is free software; you can  *
9 * redistribute it and/or modify it under the terms of the GNU General Public  *
10 * License as published by the Free Software Foundation; either version 2 of   *
11 * the License or (at your option) any later version.  This is online at:      *
12 *     http://www.fsf.org/copyleft/gpl.html                                    *
13 * Please send any updates to: fred@gruntose.com                               *
14 \*****************************************************************************/
15
16 #include <basis/contracts.h>
17 #include <tentacles/simple_entity_registry.h>
18 #include <sockets/tcpip_stack.h>
19
20 namespace cromp {
21
22 //! Implements the client registry in a cromp-appropriate manner.
23 /*!
24   The identity issue request is vetted against the known connection endpoint for a client.
25 */
26
27 class cromp_security : public octopi::simple_entity_registry
28 {
29 public:
30   cromp_security();
31   virtual ~cromp_security();
32
33   DEFINE_CLASS_NAME("cromp_security");
34
35   virtual bool add_entity(const octopi::octopus_entity &client,
36         const basis::byte_array &verification);
37
38   // stronger security models can be implemented by overriding add_entity().
39   // this object merely verifies that we have seen the entity get issued
40   // by the current server.
41
42 private:
43   sockets::tcpip_stack *_stack;  // enables access to tcpip functionality.
44 };
45
46 } //namespace.
47
48 #endif
49