Commit 2b683c59 authored by frederic motte's avatar frederic motte
Browse files

add new version of model

parent bc44a343
<?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" domainName="domain2" serviceName="POI">
<authentication name="authentication"/>
<communication name="communication" SecuredCommunication="false"/>
</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" domainName="domain2" serviceName="TrafficInformation">
<authentication name="authentication" AuthNTypeForwarded="GenericAccount"/>
<communication name="communication" SecuredCommunication="true"/>
</securitypolicyset>
</security:SecurityModel>
\ No newline at end of file
......@@ -87,6 +87,7 @@ public class SFGeneratorImpl implements SFGenerator {
{
if (account instanceof LoginPasswordConnectionAccount) {
LoginPasswordConnectionAccount lpAccount = (LoginPasswordConnectionAccount) account;
e.setCredentialType(authentication.getCredentialType().getName());
e.setGenericAccount(null);
e.setGenericCredential(null);
......@@ -101,7 +102,7 @@ public class SFGeneratorImpl implements SFGenerator {
e.setGenericCredential(authentication.getGenericCredential());
e.setAuthNElement(null);
} else {
throw new SFGeneratorException("Generic account required bu not provided");
throw new SFGeneratorException("Generic account required but not provided");
}
}
else{
......@@ -207,7 +208,7 @@ public class SFGeneratorImpl implements SFGenerator {
}
{
System.out.println("Generation of a SF in front of a lagacy Service. During the service definition, the service owner has provided an account to access it");
System.out.println("Generation of a SF in front of a legacy Service. During the service definition, the service owner has provided an account to access it");
String SFName = "testGenAccountWithCred";
Path securityPath = Paths.get("SecModelGenAccountWithCred.security");
byte[] securityModel = Files.readAllBytes(securityPath);
......@@ -218,7 +219,7 @@ public class SFGeneratorImpl implements SFGenerator {
}
{
System.out.println("Generation of a SF in front of a lagacy Service. During the service definition, the service owner has not provided an account to access it. the account must be provided by the designer");
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);
......@@ -233,7 +234,7 @@ public class SFGeneratorImpl implements SFGenerator {
}
{
System.out.println("Generation of a SF in front of a lagacy Service. During the service definition, the service owner has required a nominative user account");
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");
byte[] securityModel = Files.readAllBytes(securityPath);
......@@ -243,6 +244,30 @@ 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 POI Service.");
String SFName = "POISF";
Path securityPath = Paths.get("POIService.security");
byte[] securityModel = Files.readAllBytes(securityPath);
SFGenerator cdGenerator = new SFGeneratorImpl();
SF cd = cdGenerator.generateSecurityFilter(SFName,"SF", "http://127.0.0.1:8080/SecurityTokenService", 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 Traffic Information Service.");
String SFName = "TrafficInformationSF";
Path securityPath = Paths.get("TrafficInformationService.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,"SF", "http://127.0.0.1:8080/SecurityTokenService", 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