zot/salmon new key format for batch keys
This commit is contained in:
parent
59525e1e32
commit
75af366122
|
@ -1,11 +1,13 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
require_once('include/crypto.php');
|
||||||
|
|
||||||
function hostxrd_init(&$a) {
|
function hostxrd_init(&$a) {
|
||||||
header('Access-Control-Allow-Origin: *');
|
header('Access-Control-Allow-Origin: *');
|
||||||
header("Content-type: text/xml");
|
header("Content-type: text/xml");
|
||||||
$tpl = file_get_contents('view/xrd_host.tpl');
|
$tpl = file_get_contents('view/xrd_host.tpl');
|
||||||
echo str_replace(array(
|
echo str_replace(array(
|
||||||
'$zroot','$domain','$zot_post'),array(z_root(),z_path(),z_root() . '/post'),$tpl);
|
'$zroot','$domain','$zot_post','$bigkey'),array(z_root(),z_path(),z_root() . '/post', salmon_key(get_config('system','site_pubkey'))),$tpl);
|
||||||
session_write_close();
|
session_write_close();
|
||||||
exit();
|
exit();
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,7 @@ function xrd_init(&$a) {
|
||||||
$tpl = file_get_contents('view/xrd_person.tpl');
|
$tpl = file_get_contents('view/xrd_person.tpl');
|
||||||
|
|
||||||
$o = replace_macros($tpl, array(
|
$o = replace_macros($tpl, array(
|
||||||
|
'$nick' => $r[0]['nickname'],
|
||||||
'$accturi' => $uri,
|
'$accturi' => $uri,
|
||||||
'$profile_url' => $a->get_baseurl() . '/profile/' . $r[0]['nickname'],
|
'$profile_url' => $a->get_baseurl() . '/profile/' . $r[0]['nickname'],
|
||||||
'$hcard_url' => $a->get_baseurl() . '/hcard/' . $r[0]['nickname'],
|
'$hcard_url' => $a->get_baseurl() . '/hcard/' . $r[0]['nickname'],
|
||||||
|
@ -50,7 +51,8 @@ function xrd_init(&$a) {
|
||||||
'$dspr' => $dspr,
|
'$dspr' => $dspr,
|
||||||
'$salmon' => $a->get_baseurl() . '/salmon/' . $r[0]['nickname'],
|
'$salmon' => $a->get_baseurl() . '/salmon/' . $r[0]['nickname'],
|
||||||
'$salmen' => $a->get_baseurl() . '/salmon/' . $r[0]['nickname'] . '/mention',
|
'$salmen' => $a->get_baseurl() . '/salmon/' . $r[0]['nickname'] . '/mention',
|
||||||
'$modexp' => 'data:application/magic-public-key,' . $salmon_key
|
'$modexp' => 'data:application/magic-public-key,' . $salmon_key,
|
||||||
|
'$bigkey' => salmon_key($r[0]['pubkey'])
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -21,5 +21,9 @@
|
||||||
type="http://purl.org/zot/1.0/accept"
|
type="http://purl.org/zot/1.0/accept"
|
||||||
zot:accept="application/atom+xml" />
|
zot:accept="application/atom+xml" />
|
||||||
|
|
||||||
|
<Property xmlns:mk="http://salmon-protocol.org/ns/magic-key"
|
||||||
|
type="http://salmon-protocol.org/ns/magic-key"
|
||||||
|
mk:key_id="1">$bigkey</Property>
|
||||||
|
|
||||||
|
|
||||||
</XRD>
|
</XRD>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<Alias>$accturi</Alias>
|
<Alias>$accturi</Alias>
|
||||||
<Alias>$profile_url</Alias>
|
<Alias>$profile_url</Alias>
|
||||||
|
|
||||||
<Link rel="http://purl.org/zot/1.0/post"
|
<Link rel="http://purl.org/zot/1.0/post/$nick"
|
||||||
href="$zot_post" />
|
href="$zot_post" />
|
||||||
|
|
||||||
<Property xmlns:zot="http://purl.og/zot/1.0"
|
<Property xmlns:zot="http://purl.og/zot/1.0"
|
||||||
|
@ -40,4 +40,8 @@
|
||||||
<Link rel="magic-public-key"
|
<Link rel="magic-public-key"
|
||||||
href="$modexp" />
|
href="$modexp" />
|
||||||
|
|
||||||
|
<Property xmlns:mk="http://salmon-protocol.org/ns/magic-key"
|
||||||
|
type="http://salmon-protocol.org/ns/magic-key"
|
||||||
|
mk:key_id="1">$bigkey</Property>
|
||||||
|
|
||||||
</XRD>
|
</XRD>
|
||||||
|
|
Loading…
Reference in a new issue