-
Notifications
You must be signed in to change notification settings - Fork 17
BootstrapInterceptor
Markus Sabadello edited this page Dec 4, 2015
·
31 revisions
This interceptor can initialize an empty XDI graph with basic bootstrapping data, such as the graph owner's XDI authority, service endpoints, or initial link contracts.
- bootstrapOwner: The graph owner's XDI authority.
- bootstrapOwnerSynonyms: A list of synonyms of the graph owner's XDI authority.
- bootstrapRootLinkContract: Whether to create a "root" link contract in the graph that gives full access to the owner XDI authority.
- bootstrapPublicLinkContract: Whether to create a "public" link contract in the graph that gives public $get access to a public context in the graph.
- bootstrapConnectLinkContract: Whether to create a "connect" link contract in the graph that handles incoming $connect requests..
- bootstrapSendLinkContract: Whether to create a "send" link contract in the graph that handles incoming $send requests.
- bootstrapTimestamp: Whether to store a timestamp when the graph is created.
- bootstrapGraph: Additional initial graph contents, i.e. all XDI statements from this property will be added to new graph.
- bootstrapMessageEnvelope: An initial message envelope that will be executed against the new graph.
<bean class="xdi2.messaging.target.interceptor.impl.BootstrapInterceptor">
<property name="bootstrapOwner" value="=!:uuid:1111" />
<property name="bootstrapOwnerSynonyms">
<util:list>
<value>=alice</value>
</util:list>
</property>
<property name="bootstrapRootLinkContract" value="true" />
<property name="bootstrapPublicLinkContract" value="true" />
<property name="bootstrapConnectLinkContract" value="true" />
<property name="bootstrapSendLinkContract" value="true" />
<property name="bootstrapTimestamp" value="true" />
<property name="bootstrapGraph">
<value>
({$self}/$public)$do/$get/{$self}$msg$encrypt$keypair<$public><$key>
({$self}/$public)($do/$get){$self}$msg$encrypt$keypair/$is#/{}
({$self}/$public)$do/$get/{$self}$msg$sig$keypair<$public><$key>
({$self}/$public)($do/$get){$self}$msg$sig$keypair/$is#/{}
<$xdi><$uri>/&/"http://localhost:8080/xdi/=alice"
<$websocket><$xdi><$uri>/&/"ws://localhost:8080/xdi/=alice"
<$connect><$xdi><$uri>/&/"http://localhost:9202/auth"
({$self}/$public)$do/$get/<$xdi><$uri>
({$self}/$public)$do/$get/<$websocket><$xdi><$uri>
({$self}/$public)$do/$get/<$connect><$xdi><$uri>
</value>
</property>
<property name="bootstrapMessageEnvelope">
<value>
($anon[$msg]*!1$do/$do$keypair){$self}$msg$encrypt$keypair/$is#/$rsa$2048
($anon[$msg]*!1$do/$do$keypair){$self}$msg$sig$keypair/$is#/$rsa$2048
</value>
</property>
</bean>
With the above configuration, the new graph will be initialized as follows:
=alice/$ref/=!:uuid:1111
/$is$ref/(=!:uuid:1111)
(=alice)/$ref/(=!:uuid:1111)
(=!:uuid:1111)/$ref/
=!:uuid:1111/$is$ref/=alice
=!:uuid:1111$msg$encrypt$keypair<$public><$key>/&/"..."
=!:uuid:1111$msg$encrypt$keypair<$private><$key>/&/"..."
=!:uuid:1111$msg$encrypt$keypair/$is#/$rsa$2048
=!:uuid:1111$msg$sig$keypair<$public><$key>/&/"..."
=!:uuid:1111$msg$sig$keypair<$private><$key>/&/"..."
=!:uuid:1111$msg$sig$keypair/$is#/$rsa$2048
<#creation><$t>/&/"2015-12-04T14:05:21Z"
<$xdi><$uri>/&/"http://localhost:8080/xdi/=alice"
<$websocket><$xdi><$uri>/&/"ws://localhost:8080/xdi/=alice"
<$connect><$xdi><$uri>/&/"http://localhost:9202/auth"
(=!:uuid:1111/=!:uuid:1111)($do$if$and/$true){$from}/$is/=!:uuid:1111
(=!:uuid:1111/=!:uuid:1111)($do$if$and$or/$true){$msg}<$secret><$token><$valid>/&/true
(=!:uuid:1111/=!:uuid:1111)($do$if$and$or/$true){$msg}<$sig><$valid>/&/true
(=!:uuid:1111/=!:uuid:1111)$do/$all/
(=!:uuid:1111/$public)($do/$get)=alice/$ref/=!:uuid:1111
(=!:uuid:1111/$public)($do/$get)=!:uuid:1111$msg$encrypt$keypair/$is#/{}
(=!:uuid:1111/$public)($do/$get)=!:uuid:1111$msg$sig$keypair/$is#/{}
(=!:uuid:1111/$public)($do/$get)=!:uuid:1111/$is$ref/{}
(=!:uuid:1111/$public)($do/$get)/$is$ref/{}
(=!:uuid:1111/$public)$do/$get/=!:uuid:1111$msg$sig$keypair<$public><$key>
(=!:uuid:1111/$public)$do/$get/<$xdi><$uri>
(=!:uuid:1111/$public)$do/$get/=!:uuid:1111$public
(=!:uuid:1111/$public)$do/$get/<$websocket><$xdi><$uri>
(=!:uuid:1111/$public)$do/$get/<$connect><$xdi><$uri>
(=!:uuid:1111/$public)$do/$get/=!:uuid:1111$msg$encrypt$keypair<$public><$key>
(=!:uuid:1111/$connect)($do$hold$push$if$and/$true){$msg}<$sig><$valid>/&/true
(=!:uuid:1111/$connect)$do$if//$not
(=!:uuid:1111/$connect)$do/$connect/
(=!:uuid:1111/$send)($do$hold$if$and/$true){$msg}<$sig><$valid>/&/true
(=!:uuid:1111/$send)$do$if//$not
(=!:uuid:1111/$send)$do/$send/
This work is licensed under a Creative Commons Attribution 4.0 International License.