mirror of
https://gitlab.com/keys.openpgp.org/hagrid.git
synced 2025-10-08 01:22:43 +02:00
Compare commits
3 Commits
master
...
show-profi
Author | SHA1 | Date | |
---|---|---|---|
|
27c86a3ea7 | ||
|
e3b839b9e0 | ||
|
9b44868e27 |
6
dist/assets/js/proofs.js
vendored
6
dist/assets/js/proofs.js
vendored
@@ -36,8 +36,9 @@
|
||||
return null;
|
||||
}
|
||||
|
||||
const email = location.href.split('/').pop();
|
||||
const keyUrl = "/vks/v1/by-email/" + email;
|
||||
const query = decodeURIComponent(location.href.split(/[=/]/).pop());
|
||||
const type = query.indexOf('@') == -1 ? 'fingerprint' : 'email';
|
||||
const keyUrl = `/vks/v1/by-${type}/${query}`;
|
||||
const response = await fetch(keyUrl);
|
||||
const armor = await response.text();
|
||||
const key = (await openpgp.key.readArmored(armor)).keys[0];
|
||||
@@ -62,6 +63,7 @@
|
||||
|
||||
// grab avatar from MD5 of primary user's e-mail address
|
||||
const util = openpgp.util;
|
||||
const email = primaryUser.user.userId.email;
|
||||
const digest = await openpgp.crypto.hash.md5(util.str_to_Uint8Array(email));
|
||||
const profileHash = util.str_to_hex(util.Uint8Array_to_str(digest));
|
||||
|
||||
|
16
dist/templates/found-profile.html.hbs
vendored
16
dist/templates/found-profile.html.hbs
vendored
@@ -59,7 +59,21 @@
|
||||
<script src="/assets/openpgp.min.js" integrity="sha384-/N1ZJTH7aZFvzCM9Jy9dQmQzroYQpB5L2qrNPgYpg1/tbwVDvaqWwGHfHeFhSpcn" crossorigin="anonymous"></script>
|
||||
<script src="/assets/js/proofs.js"></script>
|
||||
<noscript>This page contents are generated and validated by JavaScript code running in your browser.
|
||||
Please enable JavaScript to see user's profile page.</noscript>
|
||||
Please enable JavaScript to see user's profile page.
|
||||
{{#with page}}
|
||||
<p>
|
||||
{{ text "We found an entry for <span class=\"email\">{{ query }}</span>." rerender }}
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="{{ ../base_uri }}/vks/v1/by-fingerprint/{{ fpr }}">{{ ../base_uri }}/vks/v1/by-fingerprint/{{ fpr }}</a>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
{{text "<strong>Hint:</strong> It's more convenient to use <span class=\"brand\">keys.openpgp.org</span> from your OpenPGP software.<br /> Take a look at our <a href=\"/about/usage\">usage guide</a> for details." }}
|
||||
</p>
|
||||
{{/with}}
|
||||
</noscript>
|
||||
<div class="spacer"></div>
|
||||
</div>
|
||||
<div class="attribution">
|
||||
|
@@ -287,7 +287,7 @@ fn key_to_response(
|
||||
fpr: fp.to_string(),
|
||||
};
|
||||
|
||||
MyResponse::ok("found", context)
|
||||
MyResponse::ok("found-profile", context)
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user