1 <?xml version="1.0" encoding="iso-8859-1"?>
3 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
6 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
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">
15 function popupCode( url ) {
16 window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
19 function toggleCode( id ) {
20 if ( document.getElementById )
21 elem = document.getElementById( id );
22 else if ( document.all )
23 elem = eval( "document.all." + id );
27 elemStyle = elem.style;
29 if ( elemStyle.display != "block" ) {
30 elemStyle.display = "block"
32 elemStyle.display = "none"
38 // Make codeblocks hidden by default
39 document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
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>
55 <tr class="top-aligned-row">
56 <td><strong>In:</strong></td>
58 <a href="../../../files/lib/mcollective/rpc/audit_rb.html">
59 lib/mcollective/rpc/audit.rb
65 <tr class="top-aligned-row">
66 <td><strong>Parent:</strong></td>
73 <!-- banner header -->
75 <div id="bodyContent">
79 <div id="contextContent">
81 <div id="description">
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
88 We provide a simple one that logs to a logfile in the class
89 MCollective::Audit::Logfile you can create your own:
92 Create a class in plugins/mcollective/audit/<yourplugin>.rb
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.
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>
105 To enable auditing you should set:
108 rpcaudit = 1 rpcauditprovider = Logfile
111 in the config file this will enable logging using the
112 MCollective::Audit::Logile class
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
124 <div id="method-list">
125 <h3 class="section-bar">Methods</h3>
127 <div class="name-list">
128 <a href="#M000071">audit_request</a>
129 <a href="#M000070">inherited</a>
147 <!-- if method_list -->
149 <h3 class="section-bar">Public Class methods</h3>
151 <div id="method-M000070" class="method-detail">
152 <a name="M000070"></a>
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>
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">
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"><<</span> {<span class="ruby-identifier">:type</span> =<span class="ruby-operator">></span> <span class="ruby-value str">"rpcaudit_plugin"</span>, <span class="ruby-identifier">:class</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">to_s</span>}
168 31: <span class="ruby-keyword kw">end</span>
174 <h3 class="section-bar">Public Instance methods</h3>
176 <div id="method-M000071" class="method-detail">
177 <a name="M000071"></a>
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>
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">
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">"audit_request is not implimented in #{this.class}"</span>)
193 35: <span class="ruby-keyword kw">end</span>
206 <div id="validator-badges">
207 <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>