Skip to content

Commit

Permalink
Merge pull request #2 from vinscom/develop
Browse files Browse the repository at this point in the history
Release 1.0
  • Loading branch information
vinscom authored Nov 9, 2017
2 parents 216643b + ba5a8d8 commit e5816d1
Show file tree
Hide file tree
Showing 49 changed files with 1,627 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
/target/
4 changes: 4 additions & 0 deletions config-layers/common/Initial.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
$class=in.erail.glue.component.Initial

initial=\
/in/erail/server/Server
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#/in/erail/route/LoadUserFromAccessTokenRouteBuillder
$class=in.erail.route.LoadUserFromAccessTokenRouteBuillder

vertx^=/io/vertx/core/VertxInstance.vertx
log=true
enable=true
oAuth2Auth^=/io/vertx/ext/auth/oauth2/OAuth2AuthInstance.oAuth2Auth
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#/in/erail/route/LoadUserFromSessionRouteBuillder
$class=in.erail.route.LoadUserFromSessionRouteBuillder

vertx^=/io/vertx/core/VertxInstance.vertx
log=true
enable^=/in/erail/route/SessionRouteBuillder.enable
oAuth2Auth^=/io/vertx/ext/auth/oauth2/OAuth2AuthInstance.oAuth2Auth
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#/in/erail/route/OIDCCallbackRouteBuilder
$class=in.erail.route.OIDCCallbackRouteBuilder

queryParamAuthCode=code
oAuth2Auth^=/io/vertx/ext/auth/oauth2/OAuth2AuthInstance.oAuth2Auth
vertx^=/io/vertx/core/VertxInstance.vertx
log=true
callbackURI=/callback
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#/in/erail/route/OpenAPI3RouteBuilder
$class=in.erail.route.OpenAPI3RouteBuilder

log=true
openAPI3JSON=openapi3.json
vertx^=/io/vertx/core/VertxInstance.vertx
deliveryOptions=/io/vertx/core/eventbus/DeliveryOptions
securityEnable=true

#Set Services
#services=
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#/in/erail/route/SessionRouteBuillder
$class=in.erail.route.SessionRouteBuillder

vertx^=/io/vertx/core/VertxInstance.vertx
log=true
enable=true
sessionStore^=/io/vertx/ext/web/sstore/SessionStoreInstance.sessionStore
12 changes: 12 additions & 0 deletions config-layers/common/in/erail/route/openapi3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"openapi": "3.0.0",
"info": {
"title": "API 3",
"description": "API Framwork",
"version": "1.0.0"
},
"paths": {},
"components": {
"schemas": {}
}
}
14 changes: 14 additions & 0 deletions config-layers/common/in/erail/server/Server.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#/in/erail/server/Server
$class=in.erail.server.Server

port=8888
host=localhost
vertx^=/io/vertx/core/VertxInstance.vertx
log=true
routerBuilder=\
/=/in/erail/route/SessionRouteBuillder,\
/=/in/erail/route/LoadUserFromSessionRouteBuillder,\
/=/in/erail/route/OIDCCallbackRouteBuilder,\
/v1/=/in/erail/route/LoadUserFromAccessTokenRouteBuillder,\
/v1/=/in/erail/route/OpenAPI3RouteBuilder
sockJSHandler^=/io/vertx/ext/web/handler/sockjs/SockJSHandlerInstance.sockJSHandler
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#/io/vertx/core/DeploymentOptions
$class=io.vertx.core.DeploymentOptions

config=DeploymentOptionsConfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
5 changes: 5 additions & 0 deletions config-layers/common/io/vertx/core/VertxInstance.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#/io/vertx/core/VertxInstance
$class=io.vertx.core.VertxInstance

clusterEnable^=/io/vertx/core/VertxOptions.clustered
vertxOptions=/io/vertx/core/VertxOptions
5 changes: 5 additions & 0 deletions config-layers/common/io/vertx/core/VertxOptions.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#/io/vertx/core/VertxOptions
$class=io.vertx.core.VertxOptions

clustered=true
clusterManager=/io/vertx/spi/cluster/hazelcast/HazelcastClusterManager
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#/io/vertx/core/eventbus/DeliveryOptions
$class=io.vertx.core.eventbus.DeliveryOptions

sendTimeout=5000
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#/io/vertx/ext/auth/oauth2/OAuth2AuthInstance

$class=io.vertx.reactivex.ext.auth.oauth2.KeycloakOAuth2Instance

vertx^=/io/vertx/core/VertxInstance.vertx
oAuth2FlowType=AUTH_CODE
config=keyCloakConfig.json
log=true

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#/io/vertx/ext/web/handler/sockjs/BridgeEventHandler
$class=io.vertx.reactivex.ext.web.handler.sockjs.DefaultBridgeEventHandler
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#/io/vertx/ext/web/handler/sockjs/BridgeOptions
$class=io.vertx.ext.web.handler.sockjs.BridgeOptionsExt

inboundAddress=
outboundAddress=
inboundAddressRegex=
outboundAddressRegex=
inboundRequiredAuthority=
outboundRequiredAuthority=
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#/io/vertx/ext/web/handler/sockjs/SockJSHandlerInstance
$class=io.vertx.reactivex.ext.web.handler.sockjs.SockJSHandlerInstance

vertx^=/io/vertx/core/VertxInstance.vertx
enable=true
bridgeOptions=/io/vertx/ext/web/handler/sockjs/BridgeOptions
bridgeEventHandler=/io/vertx/ext/web/handler/sockjs/BridgeEventHandler
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#/io/vertx/ext/web/sstore/SessionStoreInstance
$class=io.vertx.reactivex.ext.web.sstore.SessionStoreInstance

vertx^=/io/vertx/core/VertxInstance.vertx
clusterEnable^=/io/vertx/core/VertxOptions.clustered
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#/io/vertx/spi/cluster/hazelcast/HazelcastClusterManager
$class=io.vertx.spi.cluster.hazelcast.HazelcastClusterManager
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#/in/erail/route/OpenAPI3RouteBuilder
securityEnable=false
services=\
/in/erail/service/BroadcastService
74 changes: 74 additions & 0 deletions config-layers/test/in/erail/route/openapi3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"openapi": "3.0.0",
"info": {
"title": "Test",
"description": "API for broadcasting test",
"version": "1.0.0"
},
"paths": {
"/broadcast/{topicName}": {
"post": {
"summary": "Send message to all subscriber of topicName",
"description": "Send message to all subscriber of topicName",
"operationId": "API_V1_BROADCAST_SERVICE",
"parameters": [
{
"name": "topicName",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Success Response",
"content": {
"application/json": {
"schema": {
"type": "string"
}
}
}
}
},
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/broadcastMessage"
}
}
},
"required": true
}
},
"parameters": [
{
"name": "topicName",
"in": "path",
"description": "Name of topic on which to broadcast message",
"required": true,
"schema": {
"type": "string"
}
}
]
}
},
"components": {
"schemas": {
"broadcastMessage": {
"title": "Root Type for broadcastMessage",
"description": "The root of the broadcastMessage type's schema.",
"type": "object",
"properties": {
"data": {
"type": "string"
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#/in/erail/service/BroadcastService
$class=in.erail.service.BroadcastService

operationId=API_V1_BROADCAST_SERVICE
serviceUniqueId=API_V1_BROADCAST_SERVICE
vertx^=/io/vertx/core/VertxInstance.vertx
enable=true
log=true
2 changes: 2 additions & 0 deletions config-layers/test/io/vertx/core/VertxOptions.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#/io/vertx/core/VertxOptions
clustered=false
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#/io/vertx/core/eventbus/DeliveryOptions
$class=io.vertx.core.eventbus.DeliveryOptions

sendTimeout=500000
11 changes: 11 additions & 0 deletions config-layers/test/io/vertx/ext/auth/oauth2/keyCloakConfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"realm": "APIGateway",
"auth-server-url": "http://openidserver:8080/auth",
"realm-public-key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoGjNGY2CL4avkcPIcjGQQ7iHuuRCTgU3H6SxA5c23q5FBJasG+sGndqBgRg1SJ2rrJotCsEUgi82gqh2aMtjuRH4D1gGLK5/foI6tbJf1qYDxHfSZZTKHAuiiOwkxoyMbFMvNl/3ZPu0MgfT8uXcU3y06mAdpkPFsQ2ye9nz/iO/bMJnttHsPvwwKBSRR8Oj3O4cwLqwvbOA0IMft4g9So4Edu7Gg9Pk5IyREJW8cMa8r6USS2HlhkLeLyJCfBHAb9EcKfo9fPQ1nYlRf3utxfeR+5SnWFxy7/thoblY1maE1vhwXbnpHdE3RsPoEc6PnNQnq16ovpxQaR7MeJ5mjwIDAQAB",
"ssl-required": "external",
"resource": "test_erail_in",
"credentials": {
"secret": "1a8d220b-744d-47e7-b3ab-417b79595c15"
},
"policy-enforcer": {}
}
124 changes: 124 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>in.erail</groupId>
<artifactId>api-framwork</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>in.erail</groupId>
<artifactId>glue</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-core</artifactId>
<version>3.5.0</version>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-rx-java2</artifactId>
<version>3.5.0</version>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-unit</artifactId>
<version>3.5.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-web-api-contract</artifactId>
<version>3.5.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-web</artifactId>
<version>3.5.0</version>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-hazelcast</artifactId>
<version>3.5.0</version>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-auth-jwt</artifactId>
<version>3.5.0</version>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-auth-oauth2</artifactId>
<version>3.5.0</version>
</dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<argLine>-Dvertx.logger-delegate-factory-class-name=io.vertx.core.logging.Log4j2LogDelegateFactory -Dglue.layers=${project.basedir}/config-layers/common,${project.basedir}/config-layers/test</argLine>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20.1</version>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.9</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
<execution>
<id>post-unit-test</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<!-- Sets the path to the file which contains the execution data. -->

<dataFile>target/jacoco.exec</dataFile>
<!-- Sets the output directory for the code coverage report. -->
<outputDirectory>target/jacoco-ut</outputDirectory>
</configuration>
</execution>
</executions>
<configuration>
<systemPropertyVariables>
<jacoco-agent.destfile>target/jacoco.exec</jacoco-agent.destfile>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
<name>api-framwork</name>
</project>
Loading

0 comments on commit e5816d1

Please sign in to comment.