[Igf-dev] Sample carml with appIdPolicy from JUnit test...

Phil Hunt phil.hunt at oracle.com
Wed Apr 2 20:30:05 PDT 2008


Attached is a sample carml file from the JUnit test. You'll notice  
there are now various WS-Policy forms included.

In the DataDefs section is a policy entitled "SchemaTestPolicy". This  
policy is then referenced in connection with an attribute  
(userPassword) used in a find interaction.

Also note that each interaction can have their own policy statements.

Note that the only policy I have so far is a "PurposeAssertion" so I  
have just created multiple different purpose assertions to test  
multiple policies and data vs. transaction policy.

Phil Hunt
Oracle

<?xml version="1.0" encoding="UTF-8"?>

<ClientAttrReq xmlns:carml="urn:igf:client:0.9:carml" xmlns:wsp="http://www.w3.org/ns/ws-policy 
" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
AppName="BasicTestCase" Description="A test of the CARML API app.">
	<DataDefs>
		<Attributes>
			<Attribute Cardinality="single" DataType="urn:oasis:names:tc:xacml:1.0:data-type:rfc822Name 
" Description="The email address of the user is used as the login  
identifier for the application" DisplayName="Email Address"  
Name="mail"/>
			<Attribute Cardinality="single" DataType="http://www.w3.org/2001/XMLSchema#string 
" Description="Password used for authentication purposes"  
DisplayName="Password" Name="userpassword"/>
			<Attribute Cardinality="single" DataType="http://www.w3.org/2001/XMLSchema#string 
" Description="Any descriptive text about the identity"  
DisplayName="Description" Name="description"/>
			<Attribute Cardinality="single" DataType="http://www.w3.org/2001/XMLSchema#string 
" Description="Given name and any middle names" DisplayName="Given  
name" Name="givenname"/>
			<Attribute Cardinality="single" DataType="http://www.w3.org/2001/XMLSchema#string 
" Description="Surname or Family name" DisplayName="Surname"  
Name="surname"/>
		</Attributes>
		<Predicates/>
		<Roles>
			<Role Description="A full-time employee" DisplayName="Employee  
Worker" Name="IsEmployee"/>
			<Role Description="A person working on contract"  
DisplayName="Contract Worker" Name="IsContractor"/>
		</Roles>
		<Policies>
			<wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/ 
policy" xmlns:appIdPol="urn:LibertyAlliance:igf:0.1:appIdPolicy"  
Name="SchemaTestPolicy">
				<appIdPol:PurposeAssertion Value="urn:openLiberty:igf:appIdPolicy:0.1:purposeAssertionTest 
"/>
				<appIdPol:PurposeAssertion Value="urn:openLiberty:igf:appIdPolicy:0.1:PasswordPolicy 
"/>
			</wsp:Policy>
		</Policies>
	</DataDefs>
	<ReadInteraction Description="Obtains basic information about user"  
Name="ReadUser">
		<AttributeRef Optional="false" Ref="mail"/>
		<AttributeRef Optional="false" Ref="userpassword"/>
		<AttributeRef Optional="false" Ref="description"/>
		<AttributeRef Optional="false" Ref="givenname"/>
		<AttributeRef Optional="false" Ref="surname"/>
		<RoleRef Optional="false" Ref="IsEmployee"/>
		<RoleRef Optional="false" Ref="IsContractor"/>
	</ReadInteraction>
	<ModifyInteraction Description="Transaction to update description of  
user" Name="Update user">
		<AttributeRef Optional="false" Ref="description"/>
		<wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"  
xmlns:appIdPol="urn:LibertyAlliance:igf:0.1:appIdPolicy"  
Name="TestModify">
			<appIdPol:PurposeAssertion Value="urn:openLiberty:igf:appIdPolicy:0.1:TestModify 
"/>
			<appIdPol:PurposeAssertion Value="urn:openLiberty:igf:appIdPolicy:0.1:purposeAssertionTest 
"/>
		</wsp:Policy>
	</ModifyInteraction>
	<AddInteraction Description="Demonstrates adding a new user context"  
Name="AddNewUser">
		<AttributeRef Optional="false" Ref="mail"/>
		<AttributeRef Optional="false" Ref="userpassword"/>
		<AttributeRef Optional="false" Ref="description"/>
		<AttributeRef Optional="false" Ref="givenname"/>
		<AttributeRef Optional="false" Ref="surname"/>
		<RoleRef Optional="false" Ref="IsEmployee"/>
		<RoleRef Optional="false" Ref="IsContractor"/>
		<wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"  
xmlns:appIdPol="urn:LibertyAlliance:igf:0.1:appIdPolicy" Name="TestAdd">
			<appIdPol:PurposeAssertion Value="urn:openLiberty:igf:appIdPolicy:0.1:TestAdd 
"/>
		</wsp:Policy>
	</AddInteraction>
	<DeleteInteraction Description="Transaction to remove user profile"  
Name="Delete user"/>
	<FindInteraction Description="This will authenticate by username and  
password" Name="AuthenticateUser">
		<Filter Match="all">
			<AttrRefFilter Cardinality="single" Operator="equals"  
Optional="false" PrimaryKey="true" Ref="mail"/>
			<AttrRefFilter Cardinality="single" Operator="equals"  
Optional="false" PolicyRef="SchemaTestPolicy" PrimaryKey="false"  
Ref="userpassword"/>
			<RoleRefFilter Optional="false" Ref="IsEmployee"/>
		</Filter>
		<wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"  
xmlns:appIdPol="urn:LibertyAlliance:igf:0.1:appIdPolicy"  
Name="TestFind">
			<appIdPol:PurposeAssertion Value="urn:openLiberty:igf:appIdPolicy:0.1:TestFind 
"/>
		</wsp:Policy>
	</FindInteraction>
</ClientAttrReq>




More information about the Igf-dev mailing list