Skip to content

Commit

Permalink
docs: updates from Homebrew/brew
Browse files Browse the repository at this point in the history
  • Loading branch information
BrewTestBot committed Jun 6, 2024
1 parent dfa18b4 commit 5e7921d
Showing 1 changed file with 47 additions and 19 deletions.
66 changes: 47 additions & 19 deletions docs/Homebrew/Attestation.html
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,21 @@ <h3 class="signature first" id="check_attestation-class_method">
110
111
112
113</pre>
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'attestation.rb', line 74</span>
Expand Down Expand Up @@ -501,8 +515,22 @@ <h3 class="signature first" id="check_attestation-class_method">
</span> <span class='comment'># for all attestations that match the input&#39;s digest. We want to additionally
</span> <span class='comment'># filter these down to just the attestation whose subject matches the bottle&#39;s name.
</span> <span class='id identifier rubyid_subject'>subject</span> <span class='op'>=</span> <span class='id identifier rubyid_bottle'>bottle</span><span class='period'>.</span><span class='id identifier rubyid_filename'>filename</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> <span class='kw'>if</span> <span class='id identifier rubyid_subject'>subject</span><span class='period'>.</span><span class='id identifier rubyid_blank?'>blank?</span>
<span class='id identifier rubyid_attestation'>attestation</span> <span class='op'>=</span> <span class='id identifier rubyid_attestations'>attestations</span><span class='period'>.</span><span class='id identifier rubyid_find'>find</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_a'>a</span><span class='op'>|</span>
<span class='id identifier rubyid_a'>a</span><span class='period'>.</span><span class='id identifier rubyid_dig'>dig</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>verificationResult</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>statement</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>subject</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='int'>0</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>name</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='op'>==</span> <span class='id identifier rubyid_subject'>subject</span>

<span class='id identifier rubyid_attestation'>attestation</span> <span class='op'>=</span> <span class='kw'>if</span> <span class='id identifier rubyid_bottle'>bottle</span><span class='period'>.</span><span class='id identifier rubyid_tag'>tag</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span> <span class='op'>==</span> <span class='symbol'>:all</span>
<span class='comment'># :all-tagged bottles are created by `brew bottle --merge`, and are not directly
</span> <span class='comment'># bound to their own filename (since they&#39;re created by deduplicating other filenames).
</span> <span class='comment'># To verify these, we parse each attestation subject and look for one with a matching
</span> <span class='comment'># formula (name, version), but not an exact tag match.
</span> <span class='comment'># This is sound insofar as the signature has already been verified. However,
</span> <span class='comment'># longer term, we should also directly attest to `:all`-tagged bottles.
</span> <span class='id identifier rubyid_attestations'>attestations</span><span class='period'>.</span><span class='id identifier rubyid_find'>find</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_a'>a</span><span class='op'>|</span>
<span class='id identifier rubyid_actual_subject'>actual_subject</span> <span class='op'>=</span> <span class='id identifier rubyid_a'>a</span><span class='period'>.</span><span class='id identifier rubyid_dig'>dig</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>verificationResult</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>statement</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>subject</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='int'>0</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>name</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
<span class='id identifier rubyid_actual_subject'>actual_subject</span><span class='period'>.</span><span class='id identifier rubyid_start_with?'>start_with?</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_bottle'>bottle</span><span class='period'>.</span><span class='id identifier rubyid_filename'>filename</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_content'>--</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_bottle'>bottle</span><span class='period'>.</span><span class='id identifier rubyid_filename'>filename</span><span class='period'>.</span><span class='id identifier rubyid_version'>version</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
<span class='kw'>end</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_attestations'>attestations</span><span class='period'>.</span><span class='id identifier rubyid_find'>find</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_a'>a</span><span class='op'>|</span>
<span class='id identifier rubyid_a'>a</span><span class='period'>.</span><span class='id identifier rubyid_dig'>dig</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>verificationResult</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>statement</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>subject</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='int'>0</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>name</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='op'>==</span> <span class='id identifier rubyid_subject'>subject</span>
<span class='kw'>end</span>
<span class='kw'>end</span>

<span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="Attestation/InvalidAttestationError.html" title="Homebrew::Attestation::InvalidAttestationError (class)">InvalidAttestationError</a></span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>no attestation matches subject</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_attestation'>attestation</span><span class='period'>.</span><span class='id identifier rubyid_blank?'>blank?</span>
Expand Down Expand Up @@ -609,20 +637,6 @@ <h3 class="signature " id="check_core_attestation-class_method">
<pre class="lines">


126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
Expand Down Expand Up @@ -655,10 +669,24 @@ <h3 class="signature " id="check_core_attestation-class_method">
169
170
171
172</pre>
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'attestation.rb', line 126</span>
<pre class="code"><span class="info file"># File 'attestation.rb', line 140</span>

<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_check_core_attestation'>check_core_attestation</span><span class='lparen'>(</span><span class='id identifier rubyid_bottle'>bottle</span><span class='rparen'>)</span>
<span class='kw'>begin</span>
Expand Down

0 comments on commit 5e7921d

Please sign in to comment.