Skip to content

file-details: small tweaks #17072

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions warehouse/locale/messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,7 @@ msgstr ""
#: warehouse/templates/base.html:321 warehouse/templates/base.html:331
#: warehouse/templates/base.html:344
#: warehouse/templates/includes/accounts/profile-callout.html:18
#: warehouse/templates/includes/file-details.html:84
#: warehouse/templates/includes/file-details.html:94
#: warehouse/templates/index.html:100 warehouse/templates/index.html:104
#: warehouse/templates/manage/account.html:228
#: warehouse/templates/manage/account.html:234
Expand Down Expand Up @@ -2707,51 +2707,51 @@ msgstr ""
msgid "Public profile"
msgstr ""

#: warehouse/templates/includes/file-details.html:17
#: warehouse/templates/includes/file-details.html:27
msgid "File details"
msgstr ""

#: warehouse/templates/includes/file-details.html:28
#: warehouse/templates/includes/file-details.html:38
#, python-format
msgid "Upload date: %(upload_time)s"
msgstr ""

#: warehouse/templates/includes/file-details.html:29
#: warehouse/templates/includes/file-details.html:39
#, python-format
msgid "Size: %(size)s"
msgstr ""

#: warehouse/templates/includes/file-details.html:30
#: warehouse/templates/includes/file-details.html:40
#, python-format
msgid "Tags: %(tags)s"
msgstr ""

#: warehouse/templates/includes/file-details.html:32
#: warehouse/templates/includes/file-details.html:42
#, python-format
msgid "Uploaded using Trusted Publishing? %(is_tp)s"
msgstr ""

#: warehouse/templates/includes/file-details.html:37
#: warehouse/templates/includes/file-details.html:47
#, python-format
msgid "Uploaded via: %(uploaded_via)s"
msgstr ""

#: warehouse/templates/includes/file-details.html:45
#: warehouse/templates/includes/file-details.html:55
#, python-format
msgid "Hashes for %(filename)s"
msgstr ""

#: warehouse/templates/includes/file-details.html:48
#: warehouse/templates/includes/file-details.html:58
msgid "Algorithm"
msgstr ""

#: warehouse/templates/includes/file-details.html:49
#: warehouse/templates/includes/file-details.html:59
msgid "Hash digest"
msgstr ""

#: warehouse/templates/includes/file-details.html:58
#: warehouse/templates/includes/file-details.html:67
#: warehouse/templates/includes/file-details.html:76
#: warehouse/templates/includes/file-details.html:68
#: warehouse/templates/includes/file-details.html:77
#: warehouse/templates/includes/file-details.html:86
#: warehouse/templates/manage/account.html:206
#: warehouse/templates/manage/account/recovery_codes-provision.html:58
#: warehouse/templates/manage/account/totp-provision.html:57
Expand All @@ -2761,9 +2761,9 @@ msgstr ""
msgid "Copy to clipboard"
msgstr ""

#: warehouse/templates/includes/file-details.html:59
#: warehouse/templates/includes/file-details.html:68
#: warehouse/templates/includes/file-details.html:77
#: warehouse/templates/includes/file-details.html:69
#: warehouse/templates/includes/file-details.html:78
#: warehouse/templates/includes/file-details.html:87
#: warehouse/templates/manage/account.html:207
#: warehouse/templates/manage/account/recovery_codes-provision.html:59
#: warehouse/templates/manage/account/totp-provision.html:58
Expand All @@ -2772,7 +2772,7 @@ msgstr ""
msgid "Copy"
msgstr ""

#: warehouse/templates/includes/file-details.html:84
#: warehouse/templates/includes/file-details.html:94
#, python-format
msgid ""
"<a href=\"%(href)s\" title=\"%(title)s\" target=\"_blank\" "
Expand Down
24 changes: 15 additions & 9 deletions warehouse/templates/includes/file-details.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@
# limitations under the License.
-#}

{% macro publisher(publ) -%}
{% if publ.kind == "GitHub" %}
<p>
Publisher: <a href="https://github.com/{{ publ.repository }}/blob/HEAD/.github/workflows/{{ publ.workflow }}">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@woodruffw Do we not have the SHA or some other ref to link to instead here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do, although it's packed into the X.509 extensions within the attestation's certificate. I'll do a follow-up PR to extract and present that (along with the other useful stuff at the X.509 layer).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<i class="fa-brands fa-github" aria-hidden="true"></i>
<code>{{ publ.workflow }}</code> on {{ publ.repository }}
</a>
</p>
{% endif %}
{%- endmacro %}

<div id="{{ file.filename }}" data-project-tabs-target="content" class="vertical-tabs__content" role="tabpanel" aria-labelledby="file-tab mobile-file-tab" tabindex="-1">
<h2 class="page-title">{% trans %}File details{% endtrans %}</h2>
Expand Down Expand Up @@ -102,24 +112,20 @@ <h3>Provenance</h3>
</div>

<div class="card file__card">
Publisher: {{ bundle.publisher.kind }}
<ul>
<li>Repository: {{ bundle.publisher.repository }}</li>
<li>Workflow: {{ bundle.publisher.workflow }}</li>
</ul>
{{ publisher(bundle.publisher )}}
Attestations:
<ul>
{% for attestation in bundle.attestations %}
<li>
{% set statement = attestation.statement %}
Statement type: {{ statement._type }}
Statement type: <a href="{{ statement._type }}"><code>{{ statement._type }}</code></a>
<ul>
<li>Predicate type: <code>{{ statement.predicateType }}</code></li>
<li>Predicate type: <a href="{{ statement.predicateType }}"><code>{{ statement.predicateType }}</code></a></li>
<li>Subject name: <code>{{ statement.subject[0].name }}</code></li>
<li>Subject digest: <code>{{ statement.subject[0].digest.sha256 }}</code></li>
{% set tlog_entry = attestation.verification_material.transparency_entries[0] %}
<li>Transparency log index: <a href="https://search.sigstore.dev/?logIndex={{ tlog_entry.logIndex }}">{{ tlog_entry.logIndex }}</a> </li>
<li>Transparency log integration time: {{ humanize(tlog_entry.integratedTime | int | ctime, time="true") }} </li>
<li>Sigstore transparency entry: <a href="https://search.sigstore.dev/?logIndex={{ tlog_entry.logIndex }}">{{ tlog_entry.logIndex }}</a> </li>
<li>Sigstore integration time: {{ humanize(tlog_entry.integratedTime | int | ctime, time="true") }} </li>
</ul>
</li>
{% endfor %}
Expand Down