Contents
About
This proposal specifies the basic patterns for XDI link contracts, the portable authorization format that controls all data exchange in XDI.
Change Log
- 2014-10-1 - Dan Blum: Revising to consistency with XDI TC working drafts
- 2014-03-28 - Dan Blum: revised for symbol shift
2014-01-01 - Drummond Reed: revised the definition of <--template-id--> to <--template-authority--><--template-id--> to make it explicit that if there is a template authority, its XDI address must be included so the XDI address of the template is algorithmically derivable from any meta link contract or link contract instance.
2013-12-31 - Drummond Reed: updated terminology -- "party" --> "authority" (per 2013-12-20 XDI TC telecon).
- 2013-12-20 - Markus Sabadello: updated all patterns to be authority relative
- 2013-10-13 - Drummond Reed: revised patterns; revised examples; added more details about the relationship of link contract templates, meta link contracts, and link contract instances.
2013-10-10 - Drummond Reed & Markus Sabadello: clarified that a link contract template can originate from any XDI authority acting as a link contract publisher.
- 2013-10-08 - Drummond Reed: updated patterns to align with XDI messaging pattern, in particular standardizing the use of the {$from} variable.
2013-09-12 - Drummond Reed: updated terminology -- "acceptor" --> "requesting party" and "initiator" --> "authorizing party". (Note: see also 2013-12-31 change above.)
- 2013-09-11 - Drummond Reed: revised link contract instance and meta link contract patterns per feedback from 2013-09-06 TC telecon minutes.
- 2013-09-02 - Drummond Reed: updated to add link contract template and meta link contract rules.
- 2013-04-23 - Drummond Reed: updated to revised XDI syntax.
2013-02-24 - Drummond Reed: adapted into a proposal from definitions maintained in the XdiGraphModel documents.
Terminology
An XDI link contract is an XDI subgraph used for authorization. It is a machine-readable agreement describing data shared and permissions granted by one XDI authority to another. A link contract describes both the policies that must be satisfied by an XDI message to perform a requested operation and the permissions granted to the requesting authority if those conditions are met.
Link contracts may be used to apply and enforce any type of policy over shared data and messages, including security, privacy, re-sharing, synchronization, and termination.
Link Contract Participants
The parties to the establishment of a link contract are:
Requesting authority: the XDI authority requesting data and permissions under a link contract.
Authorizing authority: the XDI authority authorizing an instance of a link contract in order to grant permissions to data under its authority.
Template authority: the XDI authority publishing a link contract template, which may or may not be the requesting authority or authorizing authority.
Community authority: the XDI authority for a community link contract
Link Contract Pattern Types
There are three core link contract patterns used for different stages of defining an XDI authorization relationship.
A link contract template is a link contract containing XDI variables that must be replaced by the authorizing authority in order to create a valid link contract instance. A link contract template may be published by any XDI authority, not just a requesting or authorizing authority. Templates provided by neutral third parties make it much easier for link contracts to be standardized, promoting interoperability of XDI vocabulary and permissions.
A link contract instance is produced by replacing the variables in a link contract template.
A requester link contract is a special link contract used by a requesting authority (RA) to govern acceptance of link contract instances conforming to a specific link contract template. The requester link contract expresses the policies enforced by a specific requesting authority for accepting instances of a specific link contract template to be written by an authorizing authority (AA) into the RA's own graph. The address of a requester link contract is algorithmically derived from the name of the AA, the name of the RA and the address of the link contract template on which it is based, providing a standard way to authorize acceptance of link contract instances based on a known template.
A community contract is a link contract issued by a community authority that is stored in an AA's graph and used to authorize a link contract instantiation request ({$do} message) from an RA. All link contract requests must reference a valid community contract, which may state policies on allowable request originators, link contract templates or template authorities to be used, as well as specify rules for processing requests, such as enabling automated approval or required interactive human review.
Summary of Link Contract Patterns
Following is a high-level summary of the three link contract pattern types.
Singleton Patterns
SPECIFIC INSTANCE: (<--AA-->/<--RA-->)<--TA--><--ID-->$do/<--operation-->/<--AA--><--object-graph-->
GENERIC INSTANCE: (<--AA-->/<--class-->)<--TA--><--ID-->$do/<--operation-->/<--AA-->/<--class--><--AA--><--object-graph-->
COMMUNITY CONTRACT PATTERN: To be completed.
TEMPLATE PATTERN: <--TA--><--ID-->{$do}/<--operation-->/{$to}<--object-graph-->
REQUESTER PATTERN: (<--RA-->/<--TA--><--ID-->{$do})$do/$set{$do}/({$to}/<--RA-->)<--TA--><--ID-->$do
Collection Patterns
SPECIFIC INSTANCE: (<--AA-->/<--RA-->)<--TA--><--ID-->[$do]!<--member-id-->/<--operation-->/<--AA--><--object-graph-->
GENERIC INSTANCE: (<--AA-->/<--class-->)<--TA--><--ID-->[$do]!<--member-id-->/<--operation-->/(<--AA-->/<--class-->)<--AA--><--object-graph-->
TEMPLATE PATTERN: <--TA--><--ID-->{$do}!<--member-id--><--operation-->/{$to}<--object-graph-->
REQUESTER PATTERN: TBD
Where:
<--TA--> is the XDI address of the template authority. It is only optional for fully generic link contract templates such as those defined on this page.
<--RA--> is the XDI address of the requesting authority.
<--AA--> is the XDI address of the authorizing authority.
<--ID--> is an OPTIONAL context for specialization of the singleton $do or collection [$do]<--member-id-->. It can serve as a "qualifier" or "tag" that describes the intention of the link contract, e.g. #registration.
<--member-id--> is a unique immutable ID for a member of a link contract collection. (Unordered members start with !, ordered members start with @.)
<--operation--> is an XDI operation permitted by this link contract (e.g., $get, $set, $del, $copy, $move, or $do<--extension-->).
<--object-graph--> is the XDI graph that is the object of the operations permitted by the link contract.
<--boolean-context--> is defined by XdiPolicyExpression.
<--operator--> is defined by XdiPolicyExpression.
<--condition--> is defined by XdiPolicyExpression.
Notes about this overall architecture:
- The only difference between the singleton and collection patterns is whether the link contract node itself is an XDI entity singleton or entity collection.
- Both the instance and the requester patterns begin with an inner root so that they can have an algorithmically-generated address relative to an AA and RR that is always identical in both authorities’ graphs. `The template and the requester contain an XDI {$to} variable to refer to AA variables outside of the policy expression branch. The instance pattern does not include XDI variables because they have been instantiated in order to create the instance.
- In the instance pattern, each of the three components specializes the associated $word that follows it, i.e.:
<--authorizing-authority--> specializes $to.
<--requesting-authority--> specializes $from.
<--template-authority--><--template-id--> specializes $do.
Link Contract Template Pattern
All link contract templates MUST consist of a set of XDI statements in one of the two following patterns:
Link Contract Template Singleton Pattern
<--TA--><--ID-->{$do}/<--operation-->/{$to}<--object-graph-->
Link Contract Template Collection Pattern
<--TA--><--ID-->{$do}!<--member-id->>/<--operation-->/{$to}<--object-graph-->
The {$to} Variable
The {$to} variable represents the authorizing authority who will authorize a link contract instance. This is the same variable used to represent the receiver of an XDI message in XDI messaging.
Link Contract Permissions
Each relational <--operation--> predicate in the $do or [$do]<--member-id--> context MUST define a permission granted by the link contract to an XDI message that satisfies the link contract policies.
The <--object-graph--> of each <--operation--> predicate defines the XDI graph or subgraph over which the permission for the specified operation is granted.
Link Contract Policies
A link contract MAY contain one or more $do$if or [$do]<--member-id-->$if statements. These are the policy expression branch of the link contract. They express the policies that an authorizing authority will apply to allow or deny XDI messages that claim to be authorized under the link contract. XDI policies can express any set of rules that can be captured using XDI policy expression syntax.
Requester Link Contract Pattern
A meta link contract is used by a requesting authority to authorize acceptance of link contract instances based on a link contract template. IMPORTANT: the XDI address of the requester link contract is algorithmically composed by placing the XDI address of the link contract template under the inner root of the requesting authority followed by template authority context. This enables XDI clients to reference the requesterlink contract for authorization in an XDI $set{$do} message for a new link contract instance (see XDI messaging).
All meta link contracts except a root meta link contract (see below) MUST consist of a set of XDI statements in one of the two following patterns:
Requester Link Contract Singleton Pattern
(<--RA-->/<--TA--><--ID-->{$do})$do/$set{$do}/({$to}/<--RA-->)<--TA--><--ID-->$doRequester Link Contract Collection Pattern
TBD
$set{$do} Operation
A requester link contract uses the $set{$do} operation that is used to authorize new link contract instances. The object of this predicate MUST be the XDI address of the link contract template for which it will authorize instances.
Requester Link Contract Policies
The XDI policy expression statements in a requester link contract expresses the requesting authority's policy for accepting instances of a specific link contract template. For example, these policy statements might require the authorizing authority to:
- Be an employee of a company.
- Be under or over a certain age.
- Have a certain reputation or trust level.
Link Contract Instance Pattern
All link contract instances except a root link contract or public link contract (see below) MUST consist of a set of XDI statements in one of the two following patterns:
Link Contract Instance Singleton Pattern
(<--AA-->/<--RA-->)<--TA--><--ID-->$do/<--operation-->/<--AA--><--object-graph--> (<--AA-->/<--RA-->)<--TA--><--ID-->$do$if<--boolean-context-->/<--operator-->/<--condition-->
Link Contract Instance Collection Pattern
(<--AA-->/<--RA-->)<--TA--><--ID-->[$do]!<--member-id-->/<--operation-->/<--AA--><--object-graph-->
Note that in link contract instances, all XDI variables have been replaced.
Root Link Contract
The root link contract is the bootstrap link contract that gives an XDI authority access to its own XDI subgraph.
- The root link contract is based on the generic link contract instance pattern, with the following constraints:
- The requesting authority is set to the XDI authority.
- The authorizing authority is set to the XDI authority.
- The template ID is empty.
- The root link contract MUST use the singleton pattern, i.e. there MUST only be one per XDI authority.
The root link contract SHOULD grant $all permission to the XDI authority's subgraph.
- The root link contract SHOULD contain a policy that restricts the sender of an XDI message to the XDI authority's subgraph.
- Authentication SHOULD be required for access to a root link contract. However the XDI authority is the ultimate authority for the policies pertaining to any link contract.
Root Link Contract Pattern
(<--AA-->/<--AA-->)$do$all
Public Link Contract
The public link contract is the well-known link contract that an XDI authority can offer for access to the portion of its XDI subgraph (if any) that is publicly available.
- The public link contract is based on the generic link contract instance pattern, with the following constraints:
The requesting authority is set to $anon.
- The authorizing authority is set to the XDI authority.
The template ID is set to $public.
- The public link contract MUST use the singleton pattern, i.e. there MUST only be one per XDI authority.
The public link contract SHOULD grant $get permission to the $public subgraph of the XDI authority's subgraph.
- In addition, the public link contract MAY grant permissions to other parts of the XDI authority's subgraph.
- The public link contract SHOULD NOT contain a policy.
- Authentication SHOULD NOT be required for access to a public link contract. However the XDI authority is the ultimate authority for the policies pertaining to any link contract.
Public Link Contract Pattern
(<--AA-->/$public)$public$do/$get/<--AA-->$public
XDI Wiki