doc/R509/Config/SubjectItemPolicy.html in r509-0.9.2 vs doc/R509/Config/SubjectItemPolicy.html in r509-0.10.0
- old
+ new
@@ -4,17 +4,17 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
Class: R509::Config::SubjectItemPolicy
- — Documentation by YARD 0.8.5
+ — Documentation by YARD 0.8.6.1
</title>
- <link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />
+ <link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
- <link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />
+ <link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
<script type="text/javascript" charset="utf-8">
hasFrames = window.top.frames.main ? true : false;
relpath = '../../';
framesUrl = "../../frames.html#!" + escape(window.location.href);
@@ -92,21 +92,27 @@
<dt class="r2 last">Defined in:</dt>
- <dd class="r2 last">lib/r509/config.rb</dd>
+ <dd class="r2 last">lib/r509/config/subject_item_policy.rb</dd>
</dl>
<div class="clear"></div>
<h2>Overview</h2><div class="docstring">
<div class="discussion">
-<p>returns information about the subject item policy for a profile</p>
+<p>The Subject Item Policy allows you to define what subject fields are
+allowed in a certificate. Required means that field <strong>must</strong>
+be supplied, optional means it will be encoded if provided, and match means
+the field must be present and must match the value specified.</p>
+<p>Using R509::OIDMapper you can create new shortnames that will be usable
+inside this class.</p>
+
</div>
</div>
<div class="tags">
@@ -118,11 +124,11 @@
<ul class="summary">
<li class="public ">
<span class="summary_signature">
- <a href="#optional-instance_method" title="#optional (instance method)">- (Object) <strong>optional</strong> </a>
+ <a href="#match-instance_method" title="#match (instance method)">- (Array) <strong>match</strong> </a>
</span>
@@ -137,21 +143,19 @@
- <span class="summary_desc"><div class='inline'>
-<p>Returns the value of attribute optional.</p>
-</div></span>
+ <span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
- <a href="#required-instance_method" title="#required (instance method)">- (Object) <strong>required</strong> </a>
+ <a href="#match_values-instance_method" title="#match_values (instance method)">- (Array) <strong>match_values</strong> </a>
</span>
@@ -166,17 +170,69 @@
- <span class="summary_desc"><div class='inline'>
-<p>Returns the value of attribute required.</p>
-</div></span>
+ <span class="summary_desc"><div class='inline'></div></span>
</li>
+ <li class="public ">
+ <span class="summary_signature">
+
+ <a href="#optional-instance_method" title="#optional (instance method)">- (Array) <strong>optional</strong> </a>
+
+
+
+ </span>
+
+
+
+
+ <span class="note title readonly">readonly</span>
+
+
+
+
+
+
+
+
+
+ <span class="summary_desc"><div class='inline'></div></span>
+
+</li>
+
+
+ <li class="public ">
+ <span class="summary_signature">
+
+ <a href="#required-instance_method" title="#required (instance method)">- (Array) <strong>required</strong> </a>
+
+
+
+ </span>
+
+
+
+
+ <span class="note title readonly">readonly</span>
+
+
+
+
+
+
+
+
+
+ <span class="summary_desc"><div class='inline'></div></span>
+
+</li>
+
+
</ul>
@@ -215,10 +271,54 @@
<li class="public ">
<span class="summary_signature">
+ <a href="#to_h-instance_method" title="#to_h (instance method)">- (Hash) <strong>to_h</strong> </a>
+
+
+
+ </span>
+
+
+
+
+
+
+
+
+
+ <span class="summary_desc"><div class='inline'></div></span>
+
+</li>
+
+
+ <li class="public ">
+ <span class="summary_signature">
+
+ <a href="#to_yaml-instance_method" title="#to_yaml (instance method)">- (YAML) <strong>to_yaml</strong> </a>
+
+
+
+ </span>
+
+
+
+
+
+
+
+
+
+ <span class="summary_desc"><div class='inline'></div></span>
+
+</li>
+
+
+ <li class="public ">
+ <span class="summary_signature">
+
<a href="#validate_subject-instance_method" title="#validate_subject (instance method)">- (R509::Subject) <strong>validate_subject</strong>(subject) </a>
</span>
@@ -269,17 +369,17 @@
<p class="example_title"><div class='inline'>
<p>sample hash</p>
</div></p>
- <pre class="example code"><code><span class='lbrace'>{</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>CN</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>required</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
-<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>O</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>required</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
-<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>OU</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>optional</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
-<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>ST</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>required</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
-<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>C</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>required</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
-<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>L</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>required</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
-<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>emailAddress</span><span class='tstring_end'>"</span></span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>optional</span><span class='tstring_end'>"</span></span><span class='rbrace'>}</span></code></pre>
+ <pre class="example code"><code>{"CN" => { :policy => "required" },
+"O" => { :policy => "required" },
+"OU" => { :policy => "optional" },
+"ST" => { :policy => "required" },
+"C" => { :policy => "required" },
+"L" => { :policy => "match", :value => "Chicago" },
+"emailAddress" => { :policy => "optional" }</code></pre>
</div>
<p class="tag_title">Parameters:</p>
<ul class="param">
@@ -294,12 +394,12 @@
<em class="default">(defaults to: <tt>{}</tt>)</em>
—
<div class='inline'>
-<p>of required/optional subject items. These must be in OpenSSL shortname
-format.</p>
+<p>of required/optional/matching subject items. These must be in OpenSSL
+shortname format.</p>
</div>
</li>
</ul>
@@ -309,46 +409,60 @@
<tr>
<td>
<pre class="lines">
-211
-212
-213
-214
-215
-216
-217
-218
-219
-220
-221
-222
-223
-224
-225
-226
-227
-228</pre>
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'lib/r509/config.rb', line 211</span>
+ <pre class="code"><span class="info file"># File 'lib/r509/config/subject_item_policy.rb', line 33</span>
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_hash'>hash</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>if</span> <span class='kw'>not</span> <span class='id identifier rubyid_hash'>hash</span><span class='period'>.</span><span class='id identifier rubyid_kind_of?'>kind_of?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span>
- <span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Must supply a hash in form 'shortname'=>'required/optional'</span><span class='tstring_end'>"</span></span>
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Must supply a hash in form 'shortname'=>hash_with_policy_info</span><span class='tstring_end'>"</span></span>
<span class='kw'>end</span>
<span class='ivar'>@required</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
<span class='ivar'>@optional</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
+ <span class='ivar'>@match_values</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
+ <span class='ivar'>@match</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
<span class='kw'>if</span> <span class='kw'>not</span> <span class='id identifier rubyid_hash'>hash</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
<span class='id identifier rubyid_hash'>hash</span><span class='period'>.</span><span class='id identifier rubyid_each_pair'>each_pair</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span><span class='id identifier rubyid_value'>value</span><span class='op'>|</span>
- <span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>required</span><span class='tstring_end'>"</span></span>
- <span class='ivar'>@required</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
- <span class='kw'>elsif</span> <span class='id identifier rubyid_value'>value</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>optional</span><span class='tstring_end'>"</span></span>
- <span class='ivar'>@optional</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
+ <span class='kw'>if</span> <span class='kw'>not</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_kind_of?'>kind_of?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span>
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Each value must be a hash with a :policy key</span><span class='tstring_end'>"</span></span>
+ <span class='kw'>end</span>
+ <span class='kw'>case</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='symbol'>:policy</span><span class='rbracket'>]</span>
+ <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>required</span><span class='tstring_end'>'</span></span> <span class='kw'>then</span> <span class='ivar'>@required</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
+ <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>optional</span><span class='tstring_end'>'</span></span> <span class='kw'>then</span> <span class='ivar'>@optional</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
+ <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>match</span><span class='tstring_end'>'</span></span> <span class='kw'>then</span>
+ <span class='ivar'>@match_values</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='symbol'>:value</span><span class='rbracket'>]</span>
+ <span class='ivar'>@match</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
<span class='kw'>else</span>
- <span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Unknown subject item policy value. Allowed values are required and optional</span><span class='tstring_end'>"</span></span>
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Unknown subject item policy value. Allowed values are required, optional, or match</span><span class='tstring_end'>"</span></span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
@@ -362,42 +476,161 @@
<h2>Instance Attribute Details</h2>
<span id=""></span>
<div class="method_details first">
- <h3 class="signature first" id="optional-instance_method">
+ <h3 class="signature first" id="match-instance_method">
- - (<tt>Object</tt>) <strong>optional</strong> <span class="extras">(readonly)</span>
+ - (<tt>Array</tt>) <strong>match</strong> <span class="extras">(readonly)</span>
</h3><div class="docstring">
<div class="discussion">
-<p>Returns the value of attribute optional</p>
+ </div>
+</div>
+<div class="tags">
+
+<p class="tag_title">Returns:</p>
+<ul class="return">
+
+ <li>
+
+
+ <span class='type'>(<tt>Array</tt>)</span>
+
+
+
+ </li>
+
+</ul>
+</div><table class="source_code">
+ <tr>
+ <td>
+ <pre class="lines">
+
+
+22
+23
+24</pre>
+ </td>
+ <td>
+ <pre class="code"><span class="info file"># File 'lib/r509/config/subject_item_policy.rb', line 22</span>
+
+<span class='kw'>def</span> <span class='id identifier rubyid_match'>match</span>
+ <span class='ivar'>@match</span>
+<span class='kw'>end</span></pre>
+ </td>
+ </tr>
+</table>
+</div>
+
+
+ <span id=""></span>
+ <div class="method_details ">
+ <h3 class="signature " id="match_values-instance_method">
+
+ - (<tt>Array</tt>) <strong>match_values</strong> <span class="extras">(readonly)</span>
+
+
+
+
+
+</h3><div class="docstring">
+ <div class="discussion">
+
+
</div>
</div>
<div class="tags">
+<p class="tag_title">Returns:</p>
+<ul class="return">
+
+ <li>
+
+
+ <span class='type'>(<tt>Array</tt>)</span>
+
+
+
+ </li>
+
+</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
-200
-201
-202</pre>
+22
+23
+24</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'lib/r509/config.rb', line 200</span>
+ <pre class="code"><span class="info file"># File 'lib/r509/config/subject_item_policy.rb', line 22</span>
+<span class='kw'>def</span> <span class='id identifier rubyid_match_values'>match_values</span>
+ <span class='ivar'>@match_values</span>
+<span class='kw'>end</span></pre>
+ </td>
+ </tr>
+</table>
+</div>
+
+
+ <span id=""></span>
+ <div class="method_details ">
+ <h3 class="signature " id="optional-instance_method">
+
+ - (<tt>Array</tt>) <strong>optional</strong> <span class="extras">(readonly)</span>
+
+
+
+
+
+</h3><div class="docstring">
+ <div class="discussion">
+
+
+ </div>
+</div>
+<div class="tags">
+
+<p class="tag_title">Returns:</p>
+<ul class="return">
+
+ <li>
+
+
+ <span class='type'>(<tt>Array</tt>)</span>
+
+
+
+ </li>
+
+</ul>
+
+</div><table class="source_code">
+ <tr>
+ <td>
+ <pre class="lines">
+
+
+22
+23
+24</pre>
+ </td>
+ <td>
+ <pre class="code"><span class="info file"># File 'lib/r509/config/subject_item_policy.rb', line 22</span>
+
<span class='kw'>def</span> <span class='id identifier rubyid_optional'>optional</span>
<span class='ivar'>@optional</span>
<span class='kw'>end</span></pre>
</td>
</tr>
@@ -407,39 +640,50 @@
<span id=""></span>
<div class="method_details ">
<h3 class="signature " id="required-instance_method">
- - (<tt>Object</tt>) <strong>required</strong> <span class="extras">(readonly)</span>
+ - (<tt>Array</tt>) <strong>required</strong> <span class="extras">(readonly)</span>
</h3><div class="docstring">
<div class="discussion">
-<p>Returns the value of attribute required</p>
-
</div>
</div>
<div class="tags">
+<p class="tag_title">Returns:</p>
+<ul class="return">
+
+ <li>
+
+
+ <span class='type'>(<tt>Array</tt>)</span>
+
+
+
+ </li>
+
+</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
-200
-201
-202</pre>
+22
+23
+24</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'lib/r509/config.rb', line 200</span>
+ <pre class="code"><span class="info file"># File 'lib/r509/config/subject_item_policy.rb', line 22</span>
<span class='kw'>def</span> <span class='id identifier rubyid_required'>required</span>
<span class='ivar'>@required</span>
<span class='kw'>end</span></pre>
</td>
@@ -453,12 +697,124 @@
<div id="instance_method_details" class="method_details_list">
<h2>Instance Method Details</h2>
<div class="method_details first">
- <h3 class="signature first" id="validate_subject-instance_method">
+ <h3 class="signature first" id="to_h-instance_method">
+ - (<tt>Hash</tt>) <strong>to_h</strong>
+
+
+
+
+
+</h3><div class="docstring">
+ <div class="discussion">
+
+
+ </div>
+</div>
+<div class="tags">
+
+<p class="tag_title">Returns:</p>
+<ul class="return">
+
+ <li>
+
+
+ <span class='type'>(<tt>Hash</tt>)</span>
+
+
+
+ </li>
+
+</ul>
+
+</div><table class="source_code">
+ <tr>
+ <td>
+ <pre class="lines">
+
+
+74
+75
+76
+77
+78
+79
+80</pre>
+ </td>
+ <td>
+ <pre class="code"><span class="info file"># File 'lib/r509/config/subject_item_policy.rb', line 74</span>
+
+<span class='kw'>def</span> <span class='id identifier rubyid_to_h'>to_h</span>
+ <span class='id identifier rubyid_hash'>hash</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
+ <span class='ivar'>@required</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_r'>r</span><span class='op'>|</span> <span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='id identifier rubyid_r'>r</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='symbol'>:policy</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>required</span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span> <span class='rbrace'>}</span>
+ <span class='ivar'>@optional</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_o'>o</span><span class='op'>|</span> <span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='id identifier rubyid_o'>o</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='symbol'>:policy</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>optional</span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span> <span class='rbrace'>}</span>
+ <span class='ivar'>@match</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_m'>m</span><span class='op'>|</span> <span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='id identifier rubyid_m'>m</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='symbol'>:policy</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>match</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='symbol'>:value</span> <span class='op'>=></span> <span class='ivar'>@match_values</span><span class='lbracket'>[</span><span class='id identifier rubyid_m'>m</span><span class='rbracket'>]</span><span class='rbrace'>}</span> <span class='rbrace'>}</span>
+ <span class='id identifier rubyid_hash'>hash</span>
+<span class='kw'>end</span></pre>
+ </td>
+ </tr>
+</table>
+</div>
+
+ <div class="method_details ">
+ <h3 class="signature " id="to_yaml-instance_method">
+
+ - (<tt>YAML</tt>) <strong>to_yaml</strong>
+
+
+
+
+
+</h3><div class="docstring">
+ <div class="discussion">
+
+
+ </div>
+</div>
+<div class="tags">
+
+<p class="tag_title">Returns:</p>
+<ul class="return">
+
+ <li>
+
+
+ <span class='type'>(<tt>YAML</tt>)</span>
+
+
+
+ </li>
+
+</ul>
+
+</div><table class="source_code">
+ <tr>
+ <td>
+ <pre class="lines">
+
+
+83
+84
+85</pre>
+ </td>
+ <td>
+ <pre class="code"><span class="info file"># File 'lib/r509/config/subject_item_policy.rb', line 83</span>
+
+<span class='kw'>def</span> <span class='id identifier rubyid_to_yaml'>to_yaml</span>
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_to_h'>to_h</span><span class='period'>.</span><span class='id identifier rubyid_to_yaml'>to_yaml</span>
+<span class='kw'>end</span></pre>
+ </td>
+ </tr>
+</table>
+</div>
+
+ <div class="method_details ">
+ <h3 class="signature " id="validate_subject-instance_method">
+
- (<tt><span class='object_link'><a href="../Subject.html" title="R509::Subject (class)">R509::Subject</a></span></tt>) <strong>validate_subject</strong>(subject)
@@ -511,52 +867,34 @@
<tr>
<td>
<pre class="lines">
-232
-233
-234
-235
-236
-237
-238
-239
-240
-241
-242
-243
-244
-245
-246
-247
-248
-249
-250
-251</pre>
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'lib/r509/config.rb', line 232</span>
+ <pre class="code"><span class="info file"># File 'lib/r509/config/subject_item_policy.rb', line 61</span>
<span class='kw'>def</span> <span class='id identifier rubyid_validate_subject'>validate_subject</span><span class='lparen'>(</span><span class='id identifier rubyid_subject'>subject</span><span class='rparen'>)</span>
- <span class='comment'># convert the subject components into an array of component names that match
-</span> <span class='comment'># those that are on the required list
-</span> <span class='id identifier rubyid_supplied'>supplied</span> <span class='op'>=</span> <span class='id identifier rubyid_subject'>subject</span><span class='period'>.</span><span class='id identifier rubyid_to_a'>to_a</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_item'>item</span><span class='op'>|</span>
- <span class='ivar'>@required</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_item'>item</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rparen'>)</span>
- <span class='kw'>end</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_item'>item</span><span class='op'>|</span>
- <span class='id identifier rubyid_item'>item</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span>
- <span class='kw'>end</span>
- <span class='comment'># so we can make sure they gave us everything that's required
-</span> <span class='id identifier rubyid_diff'>diff</span> <span class='op'>=</span> <span class='ivar'>@required</span> <span class='op'>-</span> <span class='id identifier rubyid_supplied'>supplied</span>
- <span class='kw'>if</span> <span class='kw'>not</span> <span class='id identifier rubyid_diff'>diff</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
- <span class='id identifier rubyid_raise'>raise</span> <span class='const'>R509</span><span class='op'>::</span><span class='const'>R509Error</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>This profile requires you supply </span><span class='tstring_end'>"</span></span><span class='op'>+</span><span class='ivar'>@required</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>, </span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
- <span class='kw'>end</span>
+ <span class='comment'># check if match components are present and match
+</span> <span class='id identifier rubyid_validate_match'>validate_match</span><span class='lparen'>(</span><span class='id identifier rubyid_subject'>subject</span><span class='rparen'>)</span>
+ <span class='id identifier rubyid_validate_required_match'>validate_required_match</span><span class='lparen'>(</span><span class='id identifier rubyid_subject'>subject</span><span class='rparen'>)</span>
<span class='comment'># the validated subject contains only those subject components that are either
-</span> <span class='comment'># required or optional
+</span> <span class='comment'># required, optional, or match
</span> <span class='const'>R509</span><span class='op'>::</span><span class='const'>Subject</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_subject'>subject</span><span class='period'>.</span><span class='id identifier rubyid_to_a'>to_a</span><span class='period'>.</span><span class='id identifier rubyid_select'>select</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_item'>item</span><span class='op'>|</span>
- <span class='ivar'>@required</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_item'>item</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='kw'>or</span> <span class='ivar'>@optional</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_item'>item</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rparen'>)</span>
+ <span class='ivar'>@required</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_item'>item</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='kw'>or</span> <span class='ivar'>@optional</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_item'>item</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='kw'>or</span> <span class='ivar'>@match</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_item'>item</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rparen'>)</span>
<span class='kw'>end</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
@@ -565,12 +903,12 @@
</div>
</div>
<div id="footer">
- Generated on Tue Apr 23 10:46:05 2013 by
+ Generated on Sun Jan 26 13:37:27 2014 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
- 0.8.5 (ruby-1.9.3).
+ 0.8.6.1 (ruby-2.0.0).
</div>
</body>
</html>
\ No newline at end of file