<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://wiki.erights.org/mediawiki/skins/common/feed.css?207"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>User:Kevin Reid/Offline delegation - Revision history</title>
		<link>http://wiki.erights.org/mediawiki/index.php?title=User:Kevin_Reid/Offline_delegation&amp;action=history</link>
		<description>Revision history for this page on the wiki</description>
		<language>en</language>
		<generator>MediaWiki 1.15.5-7</generator>
		<lastBuildDate>Sun, 19 Apr 2026 05:59:08 GMT</lastBuildDate>
		<item>
			<title>Kevin Reid:&amp;#32;link to mailing list message</title>
			<link>http://wiki.erights.org/mediawiki/index.php?title=User:Kevin_Reid/Offline_delegation&amp;diff=1664&amp;oldid=prev</link>
			<guid>http://wiki.erights.org/mediawiki/index.php?title=User:Kevin_Reid/Offline_delegation&amp;diff=1664&amp;oldid=prev</guid>
			<description>&lt;p&gt;link to mailing list message&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Mailing list post of this: [http://www.eros-os.org/pipermail/cap-talk/2008-May/011062.html]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Copyright 2008 Kevin Reid, under the terms of the MIT X license&lt;br /&gt;
# found at http://www.opensource.org/licenses/mit-license.html ................&lt;br /&gt;
&lt;br /&gt;
pragma.syntax(&amp;quot;0.9&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# --- Utilities ---&lt;br /&gt;
&lt;br /&gt;
def makeProxy := &amp;lt;elib:ref.makeProxy&amp;gt;&lt;br /&gt;
def makeBrand := &amp;lt;elib:sealing.makeBrand&amp;gt;&lt;br /&gt;
&lt;br /&gt;
def everything {&lt;br /&gt;
  to contains(_) { return true }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# --- Signing ---&lt;br /&gt;
&lt;br /&gt;
interface ::&amp;quot;Signed&amp;quot; guards SignedStamp {}&lt;br /&gt;
&lt;br /&gt;
def makeSigner(label) {&lt;br /&gt;
  def who {&lt;br /&gt;
    to __printOn(out) {&lt;br /&gt;
      out.print(&amp;quot;&amp;lt;&amp;quot;, label, &amp;quot;&amp;gt;&amp;quot;)&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  def signer {&lt;br /&gt;
    to __printOn(out) {&lt;br /&gt;
      out.print(&amp;quot;&amp;lt;signing as &amp;quot;, label, &amp;quot;&amp;gt;&amp;quot;)&lt;br /&gt;
    }&lt;br /&gt;
    to who() { return who }&lt;br /&gt;
    to run(what) {&lt;br /&gt;
      def ::&amp;quot;signed&amp;quot; implements SignedStamp {&lt;br /&gt;
        to _who() { return who }&lt;br /&gt;
        to _get() { return what }&lt;br /&gt;
      }&lt;br /&gt;
      return ::&amp;quot;signed&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  return signer&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
def verifyAndGet(::&amp;quot;signed&amp;quot; : ::&amp;quot;Signed&amp;quot;) {&lt;br /&gt;
  return [::&amp;quot;signed&amp;quot;._get(), ::&amp;quot;signed&amp;quot;._who()]&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# --- Operations ---&lt;br /&gt;
&lt;br /&gt;
def ::&amp;quot;delegate&amp;quot;(scap, filter, note) {&lt;br /&gt;
  def [cert, signer, host] := scap&lt;br /&gt;
  def newSigner := makeSigner(note)&lt;br /&gt;
  return [signer([&amp;quot;delegate&amp;quot;, cert, newSigner.who(), filter]), newSigner, host]&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/** Turn an object whose methods take an extra argument for the delegation chain into a scap. */&lt;br /&gt;
def exportOD(handler) {&lt;br /&gt;
  def rootSigner := makeSigner(&amp;quot;export root&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
  def handleMessage(delegators, verb :String, args :List, cert) {&lt;br /&gt;
    def [[==&amp;quot;delegate&amp;quot;, prevCert, whoTo, filter], whoBy] := verifyAndGet(cert)&lt;br /&gt;
    if (!filter.contains(verb)) {&lt;br /&gt;
      throw(`$verb not permitted by $whoBy`)&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    def delegators1 := delegators.with(whoTo)&lt;br /&gt;
    return if (whoBy != rootSigner.who()) {&lt;br /&gt;
      handleMessage(delegators1, verb, args, prevCert)&lt;br /&gt;
    } else {&lt;br /&gt;
      E.call(handler, verb, [delegators1] + args)&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  def host(verb, args, cert) {&lt;br /&gt;
    handleMessage([], verb, args, cert)&lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  return [rootSigner([&amp;quot;delegate&amp;quot;, Ref.broken(&amp;quot;n/a&amp;quot;), rootSigner.who(), everything]), rootSigner, host]&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/** Turn a scap into a normal invokable reference. */&lt;br /&gt;
def importOD(scap) {&lt;br /&gt;
  def [cert, signer, host] := scap&lt;br /&gt;
  return makeProxy(def handler {&lt;br /&gt;
    to handleSend(verb, args) {&lt;br /&gt;
      return host &amp;lt;- (verb, args, cert)&lt;br /&gt;
    }&lt;br /&gt;
    to handleSendOnly(verb, args) {&lt;br /&gt;
      return host &amp;lt;- (verb, args, cert)&lt;br /&gt;
    }&lt;br /&gt;
    to handleOptSealedDispatch(_) {}&lt;br /&gt;
  }, Ref.whenBroken(host, fn _ {Ref.optProblem(host)}), true)&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# --- Example ---&lt;br /&gt;
&lt;br /&gt;
def carol(x) {&lt;br /&gt;
  def xr := importOD(x)&lt;br /&gt;
  xr &amp;lt;- hello(&amp;quot;world&amp;quot;)&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
def bob(x) {&lt;br /&gt;
  def xr := importOD(x)&lt;br /&gt;
  when ( carol &amp;lt;- (::&amp;quot;delegate&amp;quot;(x, [&amp;quot;hello&amp;quot;].asSet(), &amp;quot;Carol&amp;quot;)) ) -&amp;gt; {&lt;br /&gt;
    xr &amp;lt;- goodbye()&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
def alice(x) {&lt;br /&gt;
  bob &amp;lt;- (::&amp;quot;delegate&amp;quot;(x, [&amp;quot;hello&amp;quot;, &amp;quot;goodbye&amp;quot;].asSet(), &amp;quot;Bob&amp;quot;))&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def root := exportOD(def root0 {&lt;br /&gt;
  to hello(chain, greeted) {&lt;br /&gt;
    println(chain, &amp;quot; greeted &amp;quot;, greeted)&lt;br /&gt;
  }&lt;br /&gt;
  to goodbye(chain) {&lt;br /&gt;
    println(chain, &amp;quot; said goodbye&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
})&lt;br /&gt;
alice(::&amp;quot;delegate&amp;quot;(root, [&amp;quot;hello&amp;quot;, &amp;quot;goodbye&amp;quot;].asSet(), &amp;quot;Alice&amp;quot;))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</description>
			<pubDate>Mon, 22 Nov 2010 21:44:47 GMT</pubDate>			<dc:creator>Kevin Reid</dc:creator>			<comments>http://wiki.erights.org/wiki/User_talk:Kevin_Reid/Offline_delegation</comments>		</item>
		<item>
			<title>Kevin Reid:&amp;#32;fix missed &quot;certificate&quot; -&gt; &quot;scap&quot;</title>
			<link>http://wiki.erights.org/mediawiki/index.php?title=User:Kevin_Reid/Offline_delegation&amp;diff=3585&amp;oldid=prev</link>
			<guid>http://wiki.erights.org/mediawiki/index.php?title=User:Kevin_Reid/Offline_delegation&amp;diff=3585&amp;oldid=prev</guid>
			<description>&lt;p&gt;fix missed &amp;quot;certificate&amp;quot; -&amp;gt; &amp;quot;scap&amp;quot;&lt;/p&gt;

		&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
		&lt;col class='diff-marker' /&gt;
		&lt;col class='diff-content' /&gt;
		&lt;col class='diff-marker' /&gt;
		&lt;col class='diff-content' /&gt;
		&lt;tr valign='top'&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←Older revision&lt;/td&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 21:05, 31 May 2008&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 52:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 52:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;/** Turn an object whose methods take an extra argument for the delegation chain into a &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;certificate&lt;/del&gt;. */&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;/** Turn an object whose methods take an extra argument for the delegation chain into a &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;scap&lt;/ins&gt;. */&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;def exportOD(handler) {&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;def exportOD(handler) {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; def rootSigner := makeSigner(&amp;quot;export root&amp;quot;)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; def rootSigner := makeSigner(&amp;quot;export root&amp;quot;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff generator: internal 2026-04-19 05:59:09 --&gt;
&lt;/table&gt;</description>
			<pubDate>Sat, 31 May 2008 21:05:20 GMT</pubDate>			<dc:creator>Kevin Reid</dc:creator>			<comments>http://wiki.erights.org/wiki/User_talk:Kevin_Reid/Offline_delegation</comments>		</item>
		<item>
			<title>Kevin Reid:&amp;#32;publishing offline delegation attempt #2</title>
			<link>http://wiki.erights.org/mediawiki/index.php?title=User:Kevin_Reid/Offline_delegation&amp;diff=3584&amp;oldid=prev</link>
			<guid>http://wiki.erights.org/mediawiki/index.php?title=User:Kevin_Reid/Offline_delegation&amp;diff=3584&amp;oldid=prev</guid>
			<description>&lt;p&gt;publishing offline delegation attempt #2&lt;/p&gt;

		&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
		&lt;col class='diff-marker' /&gt;
		&lt;col class='diff-content' /&gt;
		&lt;col class='diff-marker' /&gt;
		&lt;col class='diff-content' /&gt;
		&lt;tr valign='top'&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←Older revision&lt;/td&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 16:59, 30 May 2008&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Mailing list post of this: [http://www.eros-os.org/pipermail/cap-talk/2008-May/011062.html]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# Copyright 2008 Kevin Reid, under the terms of the MIT X license&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# Copyright 2008 Kevin Reid, under the terms of the MIT X license&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 54:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 52:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;/** Turn an object whose methods take an extra argument for the delegation chain into a &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;scap&lt;/del&gt;. */&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;/** Turn an object whose methods take an extra argument for the delegation chain into a &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;certificate&lt;/ins&gt;. */&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;def exportOD(handler) {&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;def exportOD(handler) {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; def rootSigner := makeSigner(&amp;quot;export root&amp;quot;)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; def rootSigner := makeSigner(&amp;quot;export root&amp;quot;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff generator: internal 2026-04-19 05:59:09 --&gt;
&lt;/table&gt;</description>
			<pubDate>Fri, 30 May 2008 16:59:26 GMT</pubDate>			<dc:creator>Kevin Reid</dc:creator>			<comments>http://wiki.erights.org/wiki/User_talk:Kevin_Reid/Offline_delegation</comments>		</item>
	</channel>
</rss>