Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
CHOReVOLUTION
security-filter
Commits
0735faf2
Commit
0735faf2
authored
Oct 06, 2016
by
frederic motte
Browse files
remove the role of the SF
parent
b21e23b3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Security-filter-gen/src/main/java/eu/chorevolution/transformations/sfgenerator/SFGenerator.java
View file @
0735faf2
...
...
@@ -17,7 +17,7 @@ public interface SFGenerator {
* @return A SF element which contains the WAR element
* @throws SFGeneratorException
*/
SF
generateSecurityFilter
(
String
sfName
,
String
role
,
String
STSUrl
,
byte
[]
securityModel
,
List
<
String
>
groups
,
ConnectionAccount
account
)
throws
SFGeneratorException
;
SF
generateSecurityFilter
(
String
sfName
,
String
STSUrl
,
byte
[]
securityModel
,
List
<
String
>
groups
,
ConnectionAccount
account
)
throws
SFGeneratorException
;
/**
* Generation of the security filter present in front of the choreography
...
...
@@ -29,6 +29,6 @@ public interface SFGenerator {
* @return A SF element which contains the WAR element
* @throws SFGeneratorException
*/
SF
generateSecurityFilter
(
String
sfName
,
String
role
,
String
STSUrl
,
String
domain
,
List
<
String
>
groups
)
throws
SFGeneratorException
;
SF
generateSecurityFilter
(
String
sfName
,
String
STSUrl
,
String
domain
,
List
<
String
>
groups
)
throws
SFGeneratorException
;
}
Security-filter-gen/src/main/java/eu/chorevolution/transformations/sfgenerator/impl/SFGeneratorImpl.java
View file @
0735faf2
...
...
@@ -211,9 +211,9 @@ public class SFGeneratorImpl implements SFGenerator {
@Override
public
SF
generateSecurityFilter
(
String
sfName
,
String
role
,
String
STSUrl
,
byte
[]
securityModel
,
List
<
String
>
groups
,
ConnectionAccount
account
)
throws
SFGeneratorException
{
public
SF
generateSecurityFilter
(
String
sfName
,
String
STSUrl
,
byte
[]
securityModel
,
List
<
String
>
groups
,
ConnectionAccount
account
)
throws
SFGeneratorException
{
SF
sf
=
new
SF
(
sfName
,
role
);
SF
sf
=
new
SF
(
sfName
);
try
{
String
destDir
=
FileUtils
.
getTempDirectoryPath
();
String
initialDestDir
=
destDir
;
...
...
@@ -239,9 +239,9 @@ public class SFGeneratorImpl implements SFGenerator {
@Override
public
SF
generateSecurityFilter
(
String
sfName
,
String
role
,
String
STSUrl
,
String
domain
,
List
<
String
>
groups
)
public
SF
generateSecurityFilter
(
String
sfName
,
String
STSUrl
,
String
domain
,
List
<
String
>
groups
)
throws
SFGeneratorException
{
SF
sf
=
new
SF
(
sfName
,
role
);
SF
sf
=
new
SF
(
sfName
);
try
{
String
destDir
=
FileUtils
.
getTempDirectoryPath
();
String
initialDestDir
=
destDir
;
...
...
@@ -276,7 +276,7 @@ public class SFGeneratorImpl implements SFGenerator {
SFGenerator
cdGenerator
=
new
SFGeneratorImpl
();
String
domain
=
"domain2"
;
SF
cd
=
cdGenerator
.
generateSecurityFilter
(
SFName
,
"SF"
,
"http://127.0.0.1:8080/SecurityTokenService"
,
domain
,
groups
);
SF
cd
=
cdGenerator
.
generateSecurityFilter
(
SFName
,
"http://127.0.0.1:8080/SecurityTokenService"
,
domain
,
groups
);
FileUtils
.
writeByteArrayToFile
(
new
File
(
"."
+
File
.
separatorChar
+
SFName
+
File
.
separatorChar
+
"SecurityfilterServletProxy.war"
),
cd
.
getWar
());
}
...
...
@@ -287,7 +287,7 @@ public class SFGeneratorImpl implements SFGenerator {
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
);
SF
cd
=
cdGenerator
.
generateSecurityFilter
(
SFName
,
"http://127.0.0.1:8080/SecurityTokenService"
,
securityModel
,
groups
,
null
);
FileUtils
.
writeByteArrayToFile
(
new
File
(
"."
+
File
.
separatorChar
+
SFName
+
File
.
separatorChar
+
"SecurityfilterServletProxy.war"
),
cd
.
getWar
());
}
...
...
@@ -302,7 +302,7 @@ public class SFGeneratorImpl implements SFGenerator {
account
.
setLogin
(
"root"
);
account
.
setPassword
(
"password"
);
SF
cd
=
cdGenerator
.
generateSecurityFilter
(
SFName
,
"SF"
,
"http://127.0.0.1:8080/SecurityTokenService"
,
securityModel
,
groups
,
account
);
SF
cd
=
cdGenerator
.
generateSecurityFilter
(
SFName
,
"http://127.0.0.1:8080/SecurityTokenService"
,
securityModel
,
groups
,
account
);
FileUtils
.
writeByteArrayToFile
(
new
File
(
"."
+
File
.
separatorChar
+
SFName
+
File
.
separatorChar
+
"SecurityfilterServletProxy.war"
),
cd
.
getWar
());
}
...
...
@@ -313,33 +313,33 @@ public class SFGeneratorImpl implements SFGenerator {
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
);
SF
cd
=
cdGenerator
.
generateSecurityFilter
(
SFName
,
"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 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
,
"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
,
"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 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());
// }
// {
// 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");
...
...
Security-filter-gen/src/main/java/eu/chorevolution/transformations/sfgenerator/model/SF.java
View file @
0735faf2
...
...
@@ -3,15 +3,14 @@ package eu.chorevolution.transformations.sfgenerator.model;
public
class
SF
{
String
name
;
String
role
;
byte
[]
war
;
public
SF
()
{
}
public
SF
(
String
name
,
String
role
)
{
public
SF
(
String
name
)
{
this
.
name
=
name
;
this
.
role
=
role
;
}
public
String
getName
()
{
...
...
@@ -22,14 +21,6 @@ public class SF {
this
.
name
=
name
;
}
public
String
getRole
()
{
return
role
;
}
public
void
setRole
(
String
role
)
{
this
.
role
=
role
;
}
public
byte
[]
getWar
()
{
return
war
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment