Skip to content

Commit

Permalink
Release 1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Predix Robot committed Aug 22, 2017
1 parent e84e113 commit 4f496c8
Show file tree
Hide file tree
Showing 25 changed files with 1,133 additions and 329 deletions.
Binary file added OSS_NOTICE_kit_service_V1.0.pdf
Binary file not shown.
50 changes: 50 additions & 0 deletions config/application-template.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#properties for running locally or for unit tests
logging.level.root=INFO
logging.level.org.springframework=INFO
logging.level.org.springframework.security=INFO
logging.level.com.ge.predix.solsvc.kitservice=DEBUG
#<currentworkingdir>/config/application.properties are local ovverrides to src/main/resources(aka classpath)/application.properties
server.port=9092

spring.profiles.active=local,asset

#if you are behind a corporate proxy/firewall and want to access Predix Cloud
#predix.oauth.proxyHost =put.your.proxyHost.here
#predix.oauth.proxyPort=put.your.proxyPort.here

#OAuth - please see predix-rest-client src/main/java/com/ge/predix/solsvc/restclient/config/OauthRestConfig.java for more info on oauth properties
predix.oauth.issuerId.url=put.your.uaa.issuerId.here
#you may put client:secret as unencoded cleartext by setting predix.oauth.clientIdEncode=true
predix.oauth.clientId=you.should.base64encode(put.your.clientId:put.your.clientSecret separated by a colon)
#for debugging purposes, set to a high value
predix.rest.defaultSocketTimeout=500000

springfox.documentation.swagger.v2.path=/
java.docs.url=https://predixdev.github.io/kit-service
accessTokenEndpointUrl=${predix.oauth.issuerId.url}

#asset - get from VCAP env vars by binding an application to your asset instance e.g. cf bind-service <my-app> <my-asset>
#asset - see asset-bootstrap - src/main/java/com/ge/predix/solsvc/bootstrap/ams/common/AssetRestConfig.java for more info on asset properties
predix.asset.restHost=put.your.Asset.service.instance.host.here
predix.asset.zoneid=put.your.Asset.service.instance.zoneId.here

#timeseries - get from VCAP env vars by binding an application to your timeseries instance e.g. cf bind-service <my-app> <my-timeseries>
#timeseries - see timeseries-bootstrap - src/main/java/com/ge/predix/solsvc/timeseries/bootstrap/config/TimeseriesRestConfig.java for more info on timeseries properties
predix.timeseries.queryUrl=https://put.your.timeseries.service.instance.name.query.url.here/v1/datapoints
predix.timeseries.zoneid=put.your.TS.service.instance.zoneId.here
predix.timeseries.websocket.uri=wss://put.your.timeseries.ingest.uri.here/v1/stream/messages
#websocket for timeseries - get from VCAP env vars by binding an application to your timeseries instance e.g. cf bind-service <my-app> <my-timeseries>
#websocket for timeseries - see websocket-client - src/main/java/com/ge/predix/solsvc/websocket/config/IWebSocketConfig.java for more info on websocket properties
predix.timeseries.websocket.pool.maxIdle=5
predix.timeseries.websocket.pool.maxActive=5
predix.timeseries.websocket.pool.maxWait=8000

#endpoints.beans.enabled=true
#endpoints.info.enabled=true

register.device.deactivation=60

kit.webapp.url=https://put.your.kit-cloud-webapp-link
kit.device.credentials=you.should.device.clientid.base64encode(put.your.clientId:put.your.clientSecret separated by a colon)
kit.device.artifactory.url=https://your.artifactory.username:your.artifactory.ApiKey@artifactory.predix.io/artifactory/PREDIX-EXT/predix-kit-rpm/

41 changes: 25 additions & 16 deletions config/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,43 @@ server.port=9092

spring.profiles.active=local,asset

predix.oauth.proxyHost=sjc1intproxy01.crd.ge.com
predix.oauth.proxyPort=8080

predix.oauth.issuerId.url=https://92c10ab6-9ed3-4daf-a1b7-b71207885eb1.predix-uaa-training.run.aws-usw02-pr.ice.predix.io/oauth/token
predix.oauth.clientId=app_client_id:secret
#if you are behind a corporate proxy/firewall and want to access Predix Cloud
#predix.oauth.proxyHost =put.your.proxyHost.here
#predix.oauth.proxyPort=put.your.proxyPort.here

#OAuth - please see predix-rest-client src/main/java/com/ge/predix/solsvc/restclient/config/OauthRestConfig.java for more info on oauth properties
predix.oauth.issuerId.url=put.your.uaa.issuerId.here
#you may put client:secret as unencoded cleartext by setting predix.oauth.clientIdEncode=true
predix.oauth.clientId=you.should.base64encode(put.your.clientId:put.your.clientSecret separated by a colon)
#for debugging purposes, set to a high value
predix.rest.defaultSocketTimeout=500000

springfox.documentation.swagger.v2.path=/
java.docs.url=https://predixdev.github.io/kit-service
accessTokenEndpointUrl=${predix.oauth.issuerId.url}

predix.asset.restHost=predix-asset.run.aws-usw02-pr.ice.predix.io
predix.asset.zoneid=67e1d772-4ed8-4ae7-bf26-1b4351f64cd0

#timeseries details
predix.timeseries.queryUrl=https://time-series-store-predix.run.aws-usw02-pr.ice.predix.io/v1/datapoints
predix.timeseries.zoneid=743e1d4a-e546-4e77-a22c-f775ecf85288
predix.timeseries.websocket.uri=wss://gateway-predix-data-services.run.aws-usw02-pr.ice.predix.io/v1/stream/messages
#asset - get from VCAP env vars by binding an application to your asset instance e.g. cf bind-service <my-app> <my-asset>
#asset - see asset-bootstrap - src/main/java/com/ge/predix/solsvc/bootstrap/ams/common/AssetRestConfig.java for more info on asset properties
predix.asset.restHost=put.your.Asset.service.instance.host.here
predix.asset.zoneid=put.your.Asset.service.instance.zoneId.here

#timeseries - get from VCAP env vars by binding an application to your timeseries instance e.g. cf bind-service <my-app> <my-timeseries>
#timeseries - see timeseries-bootstrap - src/main/java/com/ge/predix/solsvc/timeseries/bootstrap/config/TimeseriesRestConfig.java for more info on timeseries properties
predix.timeseries.queryUrl=https://put.your.timeseries.service.instance.name.query.url.here/v1/datapoints
predix.timeseries.zoneid=put.your.TS.service.instance.zoneId.here
predix.timeseries.websocket.uri=wss://put.your.timeseries.ingest.uri.here/v1/stream/messages
#websocket for timeseries - get from VCAP env vars by binding an application to your timeseries instance e.g. cf bind-service <my-app> <my-timeseries>
#websocket for timeseries - see websocket-client - src/main/java/com/ge/predix/solsvc/websocket/config/IWebSocketConfig.java for more info on websocket properties
predix.timeseries.websocket.pool.maxIdle=5
predix.timeseries.websocket.pool.maxActive=5
predix.timeseries.websocket.pool.maxWait=8000

endpoints.beans.enabled=true
endpoints.info.enabled=true
#endpoints.beans.enabled=true
#endpoints.info.enabled=true

register.device.deactivation=60

kit.webapp.url=https://kit-cloud-poc.run.aws-usw02-pr.ice.predix.io
kit.device.credentials=ZGV2aWNlX2NsaWVudF9pZDpzZWNyZXQ=
kit.webapp.url=https://put.your.kit-cloud-webapp-link
kit.device.credentials=you.should.device.clientid.base64encode(put.your.clientId:put.your.clientSecret separated by a colon)
kit.device.artifactory.url=https://your.artifactory.username:your.artifactory.ApiKey@artifactory.predix.io/artifactory/PREDIX-EXT/predix-kit-rpm/

12 changes: 12 additions & 0 deletions config/kit-service-tinfoil-swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
}
}
},
"400": {
"description": "Bad Request"
},
"401": {
"description": "Unauthorized"
},
Expand Down Expand Up @@ -83,6 +86,9 @@
"201": {
"description": "Created"
},
"400": {
"description": "Bad Request"
},
"401": {
"description": "Unauthorized"
},
Expand Down Expand Up @@ -122,6 +128,9 @@
"type": "object"
}
},
"400": {
"description": "Bad Request"
},
"401": {
"description": "Unauthorized"
},
Expand Down Expand Up @@ -170,6 +179,9 @@
"201": {
"description": "Created"
},
"400": {
"description": "Bad Request"
},
"401": {
"description": "Unauthorized"
},
Expand Down
1 change: 1 addition & 0 deletions manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ env:
logging_level_root: INFO
logging_level_org_springframework: INFO
logging_level_com_ge_predix_solsvc: DEBUG

5 changes: 5 additions & 0 deletions manifest.yml.template
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,8 @@ env:
KIT_CLOUD_APP_URL : {kitCloudUrl}
JAVA_DOCS_URL : https://predixdev.github.io/kit-service
kit_device_credentials : {deviceEncodedClient}
#logging - see application-cloud.properties
logging_level_root: INFO
logging_level_org_springframework: INFO
logging_level_com_ge_predix_solsvc: DEBUG

17 changes: 15 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.ge.predix.solsvc</groupId>
<artifactId>kit-service</artifactId>
<version>1.0.1</version>
<version>1.0.2</version>

<parent>
<groupId>org.springframework.boot</groupId>
Expand Down Expand Up @@ -116,7 +116,11 @@
<artifactId>groovy</artifactId>
<version>${groovy.version}</version>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-csv</artifactId>
<version>1.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/joda-time/joda-time -->
<dependency>
<groupId>joda-time</groupId>
Expand All @@ -135,6 +139,15 @@
<artifactId>springfox-swagger-ui</artifactId>
<version>${springfox.version}</version>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<version>1.9.3</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-client</artifactId>
</dependency>
</dependencies>

<dependencyManagement>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ public class Application
@SuppressWarnings("unused")
private static ApplicationContext context;

/**
*
*/
static String[] profiles ;

@SuppressWarnings("javadoc")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.collections.CollectionUtils;
import org.springframework.security.authentication.InsufficientAuthenticationException;
import org.springframework.security.jwt.Jwt;
import org.springframework.security.jwt.JwtHelper;
Expand Down Expand Up @@ -127,15 +126,17 @@ public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
}

}

request.setAttribute("userToken", accessToken); //$NON-NLS-1$
request.setAttribute("isAdmin", foundScope); //$NON-NLS-1$

if ( !foundScope )
/* if ( !foundScope )
{
response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
throw new InsufficientAuthenticationException(
"Authorization header does not have the required scope to access the resource"); //$NON-NLS-1$
}
}*/
// setting security Context

chain.doFilter(req, res);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ public class EventError
* timeStamp
*/
String timeStamp;

/**
* code
*/
String code;

/**
* @param status
Expand All @@ -51,6 +56,7 @@ public EventError(int status, Map<String, Object> errorAttributes)
this.status = status;
this.error = (String) errorAttributes.get("error"); //$NON-NLS-1$
this.message = (String) errorAttributes.get("message"); //$NON-NLS-1$
this.code = (String) errorAttributes.get("code"); //$NON-NLS-1$
if(! StringUtils.isEmpty(errorAttributes.get("timestamp"))) {//$NON-NLS-1$
this.timeStamp = errorAttributes.get("timestamp").toString(); //$NON-NLS-1$
}
Expand Down
Loading

0 comments on commit 4f496c8

Please sign in to comment.