This repository has been archived by the owner on Jun 7, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Copy over ribbon test to ribbon-secured, and launch a keycloak.
Does not actually test anything yet. Nor is it secure. Checkpoint! Checkmate! Matey.
- Loading branch information
1 parent
7b40568
commit 4137b11
Showing
29 changed files
with
1,009 additions
and
749 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,5 @@ verify.log | |
log | ||
jaxrs/.DS_Store | ||
.DS_Store | ||
.db | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...red/events/src/main/java/org/wildfly/swarm/examples/netflix/ribbon/events/CORSFilter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package org.wildfly.swarm.examples.netflix.ribbon.events; | ||
|
||
import javax.ws.rs.container.ContainerRequestContext; | ||
import javax.ws.rs.container.ContainerResponseContext; | ||
import javax.ws.rs.container.ContainerResponseFilter; | ||
import javax.ws.rs.ext.Provider; | ||
import java.io.IOException; | ||
|
||
/** | ||
* @author Lance Ball | ||
*/ | ||
@Provider | ||
public class CORSFilter implements ContainerResponseFilter { | ||
public void filter(ContainerRequestContext paramContainerRequestContext, | ||
ContainerResponseContext paramContainerResponseContext) | ||
throws IOException { | ||
paramContainerResponseContext.getHeaders().add("Access-Control-Allow-Origin", "*"); | ||
paramContainerResponseContext.getHeaders().add("Access-Control-Allow-Headers", "origin, content-type, accept, authorization"); | ||
paramContainerResponseContext.getHeaders().add("Access-Control-Allow-Credentials", "true"); | ||
paramContainerResponseContext.getHeaders().add("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS, HEAD"); | ||
paramContainerResponseContext.getHeaders().add("Access-Control-Max-Age", "1209600"); | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
...-secured/events/src/main/java/org/wildfly/swarm/examples/netflix/ribbon/events/Event.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package org.wildfly.swarm.examples.netflix.ribbon.events; | ||
|
||
import java.util.Map; | ||
|
||
/** | ||
* @author Lance Ball | ||
*/ | ||
public class Event { | ||
private int id; | ||
private String name; | ||
private Map timestamp; | ||
|
||
|
||
public Map getTimestamp() { | ||
return timestamp; | ||
} | ||
|
||
public void setTimestamp(Map timestamp) { | ||
this.timestamp = timestamp; | ||
} | ||
|
||
public int getId() { | ||
return id; | ||
} | ||
|
||
public void setId(int id) { | ||
this.id = id; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 8 additions & 3 deletions
11
...ed/events/src/main/java/org/wildfly/swarm/examples/netflix/ribbon/events/TimeService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +0,0 @@ | ||
{ | ||
"realm": "sample", | ||
"realm-public-key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAhQ01r8e0wK6uiwCab2WXTK8xdbg7Ddg9vWPr1LJCcrB4pFZS3BvSeU4dLnlHzIK2NQhs++nkGMfk/rCb+DJ6xXMfRhr89FTgoKsm4xZCtocpuLdmMljlzezAJuvBBw+8gxBY5JhpDt99bhyCLK/wBS9dAmgB7kW6uDkTx8uVLuiUMi91xE/REaNR9sJMCAXbtre6Ij/YqeUc8jo3DVaxjFmL7l/48OMcRgtpd93lxxbC9VuSO/H/jszKJ8DrfJRyrOFzfcorxJ3HadSqPWDZwxNt1VjnxXJEUA/2l/FqtinE5e+sGEUXIRo/50jKaV5w03YX9pmFrHA+p2HzJc1qdQIDAQAB", | ||
"auth-server-url": "http://localhost:9191/auth", | ||
"ssl-required": "none", | ||
"resource": "sample-client", | ||
"credentials": { | ||
"secret": "8336d476-6097-40c7-bd57-47b4c9f50b76" | ||
} | ||
} | ||
Oops, something went wrong.