Update version according to OSCI-856
[packages/precise/mcollective.git] / doc / classes / MCollective / RPC / Audit.html
1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE html 
3      PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
6 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7 <head>
8   <title>Class: MCollective::RPC::Audit</title>
9   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10   <meta http-equiv="Content-Script-Type" content="text/javascript" />
11   <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
12   <script type="text/javascript">
13   // <![CDATA[
14
15   function popupCode( url ) {
16     window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17   }
18
19   function toggleCode( id ) {
20     if ( document.getElementById )
21       elem = document.getElementById( id );
22     else if ( document.all )
23       elem = eval( "document.all." + id );
24     else
25       return false;
26
27     elemStyle = elem.style;
28     
29     if ( elemStyle.display != "block" ) {
30       elemStyle.display = "block"
31     } else {
32       elemStyle.display = "none"
33     }
34
35     return true;
36   }
37   
38   // Make codeblocks hidden by default
39   document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40   
41   // ]]>
42   </script>
43
44 </head>
45 <body>
46
47
48
49     <div id="classHeader">
50         <table class="header-table">
51         <tr class="top-aligned-row">
52           <td><strong>Class</strong></td>
53           <td class="class-name-in-header">MCollective::RPC::Audit</td>
54         </tr>
55         <tr class="top-aligned-row">
56             <td><strong>In:</strong></td>
57             <td>
58                 <a href="../../../files/lib/mcollective/rpc/audit_rb.html">
59                 lib/mcollective/rpc/audit.rb
60                 </a>
61         <br />
62             </td>
63         </tr>
64
65         <tr class="top-aligned-row">
66             <td><strong>Parent:</strong></td>
67             <td>
68                 Object
69             </td>
70         </tr>
71         </table>
72     </div>
73   <!-- banner header -->
74
75   <div id="bodyContent">
76
77
78
79   <div id="contextContent">
80
81     <div id="description">
82       <p>
83 Auditing of requests is done only for SimpleRPC requests, you provide a
84 plugin in the MCollective::Audit::* namespace which the SimpleRPC framework
85 calls for each message
86 </p>
87 <p>
88 We provide a simple one that logs to a logfile in the class
89 MCollective::Audit::Logfile you can create your own:
90 </p>
91 <p>
92 Create a class in plugins/mcollective/audit/&lt;yourplugin&gt;.rb
93 </p>
94 <p>
95 You must inherit from <a href="Audit.html">MCollective::RPC::Audit</a>
96 which will take care of registering you with the plugin system.
97 </p>
98 <p>
99 Your plugin must provide <a
100 href="Audit.html#M000071">audit_request</a>(request, connection) the
101 request parameter will be an instance of <a
102 href="Request.html">MCollective::RPC::Request</a>
103 </p>
104 <p>
105 To enable auditing you should set:
106 </p>
107 <p>
108 rpcaudit = 1 rpcauditprovider = Logfile
109 </p>
110 <p>
111 in the config file this will enable logging using the
112 MCollective::Audit::Logile class
113 </p>
114 <p>
115 The <a href="Audit.html">Audit</a> class acts as a base for audit plugins
116 and takes care of registering them with the plugin manager
117 </p>
118
119     </div>
120
121
122    </div>
123
124     <div id="method-list">
125       <h3 class="section-bar">Methods</h3>
126
127       <div class="name-list">
128       <a href="#M000071">audit_request</a>&nbsp;&nbsp;
129       <a href="#M000070">inherited</a>&nbsp;&nbsp;
130       </div>
131     </div>
132
133   </div>
134
135
136     <!-- if includes -->
137
138     <div id="section">
139
140
141
142
143
144       
145
146
147     <!-- if method_list -->
148     <div id="methods">
149       <h3 class="section-bar">Public Class methods</h3>
150
151       <div id="method-M000070" class="method-detail">
152         <a name="M000070"></a>
153
154         <div class="method-heading">
155           <a href="#M000070" class="method-signature">
156           <span class="method-name">inherited</span><span class="method-args">(klass)</span>
157           </a>
158         </div>
159       
160         <div class="method-description">
161           <p><a class="source-toggle" href="#"
162             onclick="toggleCode('M000070-source');return false;">[Source]</a></p>
163           <div class="method-source-code" id="M000070-source">
164 <pre>
165     <span class="ruby-comment cmt"># File lib/mcollective/rpc/audit.rb, line 29</span>
166 29:       <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">inherited</span>(<span class="ruby-identifier">klass</span>)
167 30:         <span class="ruby-constant">PluginManager</span> <span class="ruby-operator">&lt;&lt;</span> {<span class="ruby-identifier">:type</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;rpcaudit_plugin&quot;</span>, <span class="ruby-identifier">:class</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">to_s</span>}
168 31:       <span class="ruby-keyword kw">end</span>
169 </pre>
170           </div>
171         </div>
172       </div>
173
174       <h3 class="section-bar">Public Instance methods</h3>
175
176       <div id="method-M000071" class="method-detail">
177         <a name="M000071"></a>
178
179         <div class="method-heading">
180           <a href="#M000071" class="method-signature">
181           <span class="method-name">audit_request</span><span class="method-args">(request, connection)</span>
182           </a>
183         </div>
184       
185         <div class="method-description">
186           <p><a class="source-toggle" href="#"
187             onclick="toggleCode('M000071-source');return false;">[Source]</a></p>
188           <div class="method-source-code" id="M000071-source">
189 <pre>
190     <span class="ruby-comment cmt"># File lib/mcollective/rpc/audit.rb, line 33</span>
191 33:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">audit_request</span>(<span class="ruby-identifier">request</span>, <span class="ruby-identifier">connection</span>)
192 34:         <span class="ruby-ivar">@log</span>.<span class="ruby-identifier">error</span>(<span class="ruby-node">&quot;audit_request is not implimented in #{this.class}&quot;</span>)
193 35:       <span class="ruby-keyword kw">end</span>
194 </pre>
195           </div>
196         </div>
197       </div>
198
199
200     </div>
201
202
203   </div>
204
205
206 <div id="validator-badges">
207   <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
208 </div>
209
210 </body>
211 </html>