Commit 35acf00c authored by frederic motte's avatar frederic motte
Browse files

add new model examples

parent 6f8b56e7
<?xml version="1.0" encoding="UTF-8"?>
<security:SecurityModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:security="http://www.thalesgroup.com/chorevolution/spec/security">
<securitypolicyset name="SecurityPolicy" serviceName="POI">
<authentication name="authentication" AuthNTypeForwarded="GenericAccount"/>
<communication name="communication" SecuredCommunication="true"/>
</securitypolicyset>
</security:SecurityModel>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<security:SecurityModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:security="http://www.thalesgroup.com/chorevolution/spec/security">
<securitypolicyset name="SecurityPolicy" serviceName="POI">
<authentication name="authentication"/>
<communication name="communication" SecuredCommunication="false"/>
<securitypolicyset name="SecurityPolicy" serviceName="JourneyPlanner">
<authentication name="authentication" AuthNTypeForwarded="GenericAccount"/>
<communication name="communication" SecuredCommunication="true"/>
</securitypolicyset>
</security:SecurityModel>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<security:SecurityModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:security="http://www.thalesgroup.com/chorevolution/spec/security">
<securitypolicyset name="SecurityPolicy" serviceName="Parking">
<authentication name="authentication"/>
<communication name="communication" SecuredCommunication="false"/>
</securitypolicyset>
</security:SecurityModel>
\ No newline at end of file
......@@ -269,9 +269,9 @@ public class SFGeneratorImpl implements SFGenerator {
SF cd = cdGenerator.generateSecurityFilter(SFName, "http://127.0.0.1:8080/SecurityTokenService", domain , securityModel, groups, account);
FileUtils.writeByteArrayToFile(new File( "." + File.separatorChar + SFName + File.separatorChar + "SecurityfilterServletProxy.war"), cd.getWar());
}
groups = null;
{
groups = null;
System.out.println("Generation of a SF in front of a legacy Service. During the service definition, the service owner has required a nominative user account");
String SFName = "testUserAccount";
Path securityPath = Paths.get("SecModelUserAccount.security");
......@@ -282,14 +282,27 @@ public class SFGeneratorImpl implements SFGenerator {
FileUtils.writeByteArrayToFile(new File( "." + File.separatorChar + SFName + File.separatorChar + "SecurityfilterServletProxy.war"), cd.getWar());
}
{
System.out.println("Generation of a SF in front of a Parking Service.");
String SFName = "ParkingSF";
Path securityPath = Paths.get("ParkingService.security");
byte[] securityModel = Files.readAllBytes(securityPath);
SFGenerator cdGenerator = new SFGeneratorImpl();
SF cd = cdGenerator.generateSecurityFilter(SFName, "http://127.0.0.1:8080/SecurityTokenService", domain , securityModel, groups, null);
FileUtils.writeByteArrayToFile(new File( "." + File.separatorChar + SFName + File.separatorChar + "SecurityfilterServletProxy.war"), cd.getWar());
}
{
System.out.println("Generation of a SF in front of a POI Service.");
String SFName = "POISF";
Path securityPath = Paths.get("POIService.security");
byte[] securityModel = Files.readAllBytes(securityPath);
LoginPasswordConnectionAccount account = new LoginPasswordConnectionAccount();
account.setLogin("root");
account.setPassword("password");
SFGenerator cdGenerator = new SFGeneratorImpl();
SF cd = cdGenerator.generateSecurityFilter(SFName, "http://127.0.0.1:8080/SecurityTokenService", domain , securityModel, groups, null);
SF cd = cdGenerator.generateSecurityFilter(SFName, "http://127.0.0.1:8080/SecurityTokenService", domain , securityModel, groups, account);
FileUtils.writeByteArrayToFile(new File( "." + File.separatorChar + SFName + File.separatorChar + "SecurityfilterServletProxy.war"), cd.getWar());
}
......@@ -306,22 +319,18 @@ public class SFGeneratorImpl implements SFGenerator {
FileUtils.writeByteArrayToFile(new File( "." + File.separatorChar + SFName + File.separatorChar + "SecurityfilterServletProxy.war"), cd.getWar());
}
// {
// System.out.println("Generation of a SF in front of a legacy Service. During the service definition, the service owner has not provided an account to access it. the account must be provided by the designer");
// String SFName = "testGenAccountWithoutCred";
// Path securityPath = Paths.get("SecModelGenAccountWithoutCred.security");
// byte[] securityModel = Files.readAllBytes(securityPath);
//
// SFGenerator cdGenerator = new SFGeneratorImpl();
// LoginPasswordConnectionAccount account = new LoginPasswordConnectionAccount();
// account.setLogin("root");
// account.setPassword("password");
//
// SF cd = cdGenerator.generateSecurityFilter(SFName,"SF", "http://127.0.0.1:8080/SecurityTokenService", securityModel, groups, account);
// FileUtils.writeByteArrayToFile(new File( "." + File.separatorChar + SFName + File.separatorChar + "SecurityfilterServletProxy.war"), cd.getWar());
// }
{
System.out.println("Generation of a SF in front of a JourneyPlanner Service.");
String SFName = "JourneyPlannerSF";
Path securityPath = Paths.get("JourneyPlannerService.security");
byte[] securityModel = Files.readAllBytes(securityPath);
LoginPasswordConnectionAccount account = new LoginPasswordConnectionAccount();
account.setLogin("root");
account.setPassword("password");
SFGenerator cdGenerator = new SFGeneratorImpl();
SF cd = cdGenerator.generateSecurityFilter(SFName, "http://127.0.0.1:8080/SecurityTokenService", domain , securityModel, groups, account);
FileUtils.writeByteArrayToFile(new File( "." + File.separatorChar + SFName + File.separatorChar + "SecurityfilterServletProxy.war"), cd.getWar());
}
}
......
Supports Markdown
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