Commit 74f3a79e authored by Robert Ricci's avatar Robert Ricci

Merge the ticket in with credentials

parent 17659ffc
......@@ -14,16 +14,21 @@
# blob will be signed. So, there will be multiple signatures in the
# document, each with a reference to the credential it signs.
#
default namespace = "http://www.protogeni.net/resources/credential/0.1"
namespace sig = "http://www.w3.org/2000/09/xmldsig#"
datatypes xs = "http://www.w3.org/2001/XMLSchema-datatypes"
anyelementbody = (attribute * {text} | text | element * {anyelementbody} )*
# This is where we get the definition of RSpec from
include "../rspec/protogeni-rspec-common.rnc"
## Representation of a single capability.
CapabilitySpec = element capability {
# Name of the capability.
element capability_name { xsd:string { minLength = "1" }},
# Flag indicating this capability can be delegated
element can_delegate { "0" | "1" }
element can_delegate { xsd:boolean }
}
## A set of capabilities.
......@@ -34,8 +39,14 @@ CapabilitiesSpec = element capabilities {
## Define a stub for future ticket.
TicketSpec = element ticket {
## Can the ticket be delegated?
element can_delegate { "0" | "1" },
anyelementbody
element can_delegate { xsd:boolean },
## The ticket must be "cashed in" by this date
element redeem_before { xsd:dateTime },
## A desciption of the resources that are being promised
# Note: What I really want to do here is reference RSpec as being
# in a separate namespace. But, it's not clear to me how to do this,
# so we basically just use by inclusion
RSpec
}
## A list of signatures.
......@@ -61,8 +72,9 @@ credentials = element credential {
element parent { credentials }?
}
start = element signed-credential {
SignedCredential = element signed-credential {
credentials,
signatures
}
start = SignedCredential
......@@ -18,29 +18,23 @@
document, each with a reference to the credential it signs.
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" xmlns:sig="http://www.w3.org/2000/09/xmldsig#">
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.protogeni.net/resources/credential/0.1" xmlns:sig="http://www.w3.org/2000/09/xmldsig#" xmlns:credential="http://www.protogeni.net/resources/credential/0.1" xmlns:top="http://emulab.net/resources/top/0.2">
<xs:include schemaLocation="protogeni-rspec-common.xsd"/>
<xs:import namespace="http://emulab.net/resources/top/0.2" schemaLocation="top.xsd"/>
<xs:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="sig.xsd"/>
<xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/>
<xs:group name="anyelementbody">
<xs:complexType name="anyelementbody" mixed="true">
<xs:sequence>
<xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
</xs:sequence>
</xs:group>
<xs:attributeGroup name="anyelementbody">
<xs:anyAttribute processContents="skip"/>
</xs:attributeGroup>
</xs:complexType>
<!-- This is where we get the definition of RSpec from -->
<xs:element name="capability">
<xs:complexType>
<xs:sequence>
<xs:element ref="capability_name"/>
<xs:element name="can_delegate">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="0"/>
<xs:enumeration value="1"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element ref="credential:capability_name"/>
<xs:element name="can_delegate" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
......@@ -54,29 +48,32 @@
<xs:element name="capabilities">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="capability"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="credential:capability"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ticket">
<xs:complexType mixed="true">
<xs:complexType>
<xs:sequence>
<xs:element name="can_delegate">
<xs:element name="can_delegate" type="xs:boolean">
<xs:annotation>
<xs:documentation>Can the ticket be delegated?</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="0"/>
<xs:enumeration value="1"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:group ref="anyelementbody"/>
<xs:element ref="credential:redeem_before"/>
<xs:element ref="credential:rspec">
<xs:annotation>
<xs:documentation>A desciption of the resources that are being promised</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
<xs:attributeGroup ref="anyelementbody"/>
</xs:complexType>
</xs:element>
<xs:element name="redeem_before" type="xs:dateTime">
<xs:annotation>
<xs:documentation>The ticket must be "cashed in" by this date </xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="signatures">
<xs:complexType>
<xs:sequence>
......@@ -89,24 +86,24 @@
<xs:documentation>A credential granting capabilities or a ticket.</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element ref="credential"/>
<xs:element ref="credential:credential"/>
</xs:sequence>
</xs:complexType>
<xs:element name="credential">
<xs:complexType>
<xs:sequence>
<xs:element ref="type"/>
<xs:element ref="serial"/>
<xs:element ref="owner_uuid"/>
<xs:element ref="this_uuid"/>
<xs:element ref="credential:type"/>
<xs:element ref="credential:serial"/>
<xs:element ref="credential:owner_uuid"/>
<xs:element ref="credential:this_uuid"/>
<xs:choice>
<xs:annotation>
<xs:documentation>Capabilities or a ticket</xs:documentation>
</xs:annotation>
<xs:element ref="capabilities"/>
<xs:element ref="ticket"/>
<xs:element ref="credential:capabilities"/>
<xs:element ref="credential:ticket"/>
</xs:choice>
<xs:element minOccurs="0" ref="parent"/>
<xs:element minOccurs="0" ref="credential:parent"/>
</xs:sequence>
<xs:attribute ref="xml:id" use="required"/>
</xs:complexType>
......@@ -137,7 +134,7 @@
<xs:documentation>UUID of this credential</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="parent" type="credentials">
<xs:element name="parent" type="credential:credentials">
<xs:annotation>
<xs:documentation>Parent that delegated to us</xs:documentation>
</xs:annotation>
......@@ -145,9 +142,9 @@
<xs:element name="signed-credential">
<xs:complexType>
<xs:complexContent>
<xs:extension base="credentials">
<xs:extension base="credential:credentials">
<xs:sequence>
<xs:element ref="signatures"/>
<xs:element ref="credential:signatures"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
......
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.protogeni.net/resources/credential/0.1" xmlns:sig="http://www.w3.org/2000/09/xmldsig#" xmlns:credential="http://www.protogeni.net/resources/credential/0.1" xmlns:top="http://emulab.net/resources/top/0.2">
<xs:import namespace="http://emulab.net/resources/top/0.2" schemaLocation="top.xsd"/>
<xs:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="sig.xsd"/>
<xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/>
<!--
EMULAB-COPYRIGHT
Copyright (c) 2008 University of Utah and the Flux Group.
All rights reserved.
-->
<!--
Simple prototype of an RSpec, to be used by ProtoGENI
-->
<!-- Add some more stuff to nodes -->
<xs:group name="NodeSpec">
<xs:sequence>
<xs:element minOccurs="0" ref="credential:avaiable"/>
</xs:sequence>
</xs:group>
<xs:element name="avaiable" type="xs:boolean"/>
<xs:attributeGroup name="NodeSpec">
<xs:attribute name="uuid" use="required"/>
<xs:attribute name="name"/>
<xs:attribute name="virtualization_type">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="raw"/>
<xs:enumeration value="trellis-vserver"/>
<xs:enumeration value="planetlab-vserver"/>
<xs:enumeration value="emulab-vnode"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:attributeGroup>
<xs:element name="rspec">
<xs:complexType>
<xs:sequence>
<xs:group minOccurs="0" maxOccurs="unbounded" ref="credential:NodeSpec"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="top:link"/>
</xs:sequence>
<xs:attribute name="generated" use="required" type="xs:dateTime"/>
<xs:attribute name="valid_until" use="required" type="xs:dateTime"/>
<xs:attribute name="uuid"/>
<xs:attribute name="name"/>
<xs:attribute name="virtualization_type">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="raw"/>
<xs:enumeration value="trellis-vserver"/>
<xs:enumeration value="planetlab-vserver"/>
<xs:enumeration value="emulab-vnode"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="uuid"/>
<xs:attribute name="name"/>
</xs:complexType>
</xs:element>
</xs:schema>
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.w3.org/2000/09/xmldsig#" xmlns:sig="http://www.w3.org/2000/09/xmldsig#">
<xs:import schemaLocation="credential.xsd"/>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.w3.org/2000/09/xmldsig#" xmlns:sig="http://www.w3.org/2000/09/xmldsig#" xmlns:credential="http://www.protogeni.net/resources/credential/0.1" xmlns:top="http://emulab.net/resources/top/0.2">
<xs:import namespace="http://emulab.net/resources/top/0.2" schemaLocation="top.xsd"/>
<xs:import namespace="http://www.protogeni.net/resources/credential/0.1" schemaLocation="credential.xsd"/>
<xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/>
<xs:element name="Signature">
<xs:complexType mixed="true">
<xs:group ref="anyelementbody"/>
<xs:attributeGroup ref="anyelementbody"/>
</xs:complexType>
</xs:element>
<xs:element name="Signature" type="credential:anyelementbody"/>
</xs:schema>
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.w3.org/XML/1998/namespace" xmlns:sig="http://www.w3.org/2000/09/xmldsig#">
<xs:import schemaLocation="credential.xsd"/>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.w3.org/XML/1998/namespace" xmlns:sig="http://www.w3.org/2000/09/xmldsig#" xmlns:credential="http://www.protogeni.net/resources/credential/0.1" xmlns:top="http://emulab.net/resources/top/0.2">
<xs:import namespace="http://emulab.net/resources/top/0.2" schemaLocation="top.xsd"/>
<xs:import namespace="http://www.protogeni.net/resources/credential/0.1" schemaLocation="credential.xsd"/>
<xs:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="sig.xsd"/>
<xs:attribute name="id" type="xs:ID">
<xs:annotation>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment