Skip to content

Commit

Permalink
ODE-738 and ODE-758 Final clean up bug fixes and documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
hmusavi committed Apr 13, 2018
1 parent d7429d7 commit 4f658d6
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 22 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
[submodule "jpo-security-svcs"]
path = jpo-security-svcs
url = https://github.com/usdot-jpo-ode/jpo-security-svcs
[submodule "jpo-security"]
path = jpo-security
url = https://github.com/usdot-jpo-ode/jpo-security.git
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

Master: [![Build Status](https://travis-ci.org/usdot-jpo-ode/jpo-ode.svg?branch=master)](https://travis-ci.org/usdot-jpo-ode/jpo-ode) [![Quality Gate](https://sonarcloud.io/api/badges/gate?key=usdot.jpo.ode:jpo-ode)](https://sonarcloud.io/dashboard?id=usdot.jpo.ode%3Ajpo-ode)

Develop: [![Build Status](https://travis-ci.org/usdot-jpo-ode/jpo-ode.svg?branch=develop)](https://travis-ci.org/usdot-jpo-ode/jpo-ode) [![Quality Gate](https://sonarcloud.io/api/badges/gate?key=usdot.jpo.ode:jpo-ode:develop)](https://sonarcloud.io/dashboard?id=usdot.jpo.ode%3Ajpo-ode%3Adevelop)
Expand Down Expand Up @@ -142,6 +143,7 @@ Additionally, read the following guides to familiarize yourself with Docker and
|[jpo-security](https://github.com/usdot-jpo-ode/jpo-security)|public|Security dependencies.|
|[asn1_codec](https://github.com/usdot-jpo-ode/asn1_codec)|public|ASN.1 Encoder/Decoder module|
|jpo-ode-private|private|Proprietary dependencies.|
|[jpo-security-svcs](https://github.com/usdot-jpo-ode/jpo-security-svcs)|public|Provides cryptographic services.|

Building this application requires all repositories. If you need access to the private repositories, please reach out to a member of the development team.

Expand All @@ -165,6 +167,7 @@ git clone --recurse-submodules https://github.com/usdot-jpo-ode/jpo-ode.git
- Privacy Protection Module (PPM) - [jpo-cvdp](https://github.com/usdot-jpo-ode/jpo-cvdp)
- S3 Bucket Depositor - [jpo-s3-deposit](https://github.com/usdot-jpo-ode/jpo-s3-deposit)
- Security - [jpo-security](https://github.com/usdot-jpo-ode/jpo-security)
- Security Services Module- [jpo-security](https://github.com/usdot-jpo-ode/jpo-security-svcs)
- ASN.1 CODEC - [asn1_codec](https://github.com/usdot-jpo-ode/asn1_codec)

#### Step 2 - Clone private repository
Expand Down
Binary file modified docs/JPO_ODE_UserGuide.docx
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import us.dot.its.jpo.ode.model.OdeAsn1Data;
import us.dot.its.jpo.ode.model.OdeTravelerInputData;
import us.dot.its.jpo.ode.traveler.TimController.TimControllerException;
import us.dot.its.jpo.ode.util.CodecUtils;
import us.dot.its.jpo.ode.util.JsonUtils;
import us.dot.its.jpo.ode.util.JsonUtils.JsonUtilsException;
import us.dot.its.jpo.ode.util.XmlUtils;
Expand Down Expand Up @@ -130,28 +131,34 @@ public void processEncodedTim(OdeTravelerInputData travelerInfo, JSONObject cons

JSONObject mfObj = dataObj.getJSONObject("MessageFrame");

String encodedTim = mfObj.getString("bytes");
logger.debug("Encoded message: {}", encodedTim);

logger.debug("Sending message for signature!");
String signedResponse = asn1CommandManager.sendForSignature(encodedTim);
logger.debug("Message signed!");

String signedTim = null;
try {
signedTim = JsonUtils.toJSONObject(signedResponse).getString("result");
} catch (JsonUtilsException e1) {
logger.error("Unable to parse signed message response {}", e1);
String hexEncodedTim = mfObj.getString("bytes");
logger.debug("Encoded message: {}", hexEncodedTim);

if (odeProperties.getSecuritySvcsSignatureUri() != null &&
!odeProperties.getSecuritySvcsSignatureUri().equalsIgnoreCase("UNSECURED")) {
logger.debug("Sending message for signature!");
String base64EncodedTim = CodecUtils.toBase64(
CodecUtils.fromHex(hexEncodedTim));
String signedResponse = asn1CommandManager.sendForSignature(base64EncodedTim );
logger.debug("Message signed!");

try {
hexEncodedTim = CodecUtils.toHex(
CodecUtils.fromBase64(
JsonUtils.toJSONObject(signedResponse).getString("result")));
} catch (JsonUtilsException e1) {
logger.error("Unable to parse signed message response {}", e1);
}
}

logger.debug("Sending message to RSUs...");
asn1CommandManager.sendToRsus(travelerInfo, signedTim);
asn1CommandManager.sendToRsus(travelerInfo, hexEncodedTim);

if (travelerInfo.getSdw() != null) {
// Case 2 only

logger.debug("Publishing message for round 2 encoding!");
String xmlizedMessage = asn1CommandManager.packageSignedTimIntoAsd(travelerInfo, signedTim);
String xmlizedMessage = asn1CommandManager.packageSignedTimIntoAsd(travelerInfo, hexEncodedTim);

stringMsgProducer.send(odeProperties.getKafkaTopicAsn1EncoderInput(), null, xmlizedMessage);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void initShouldCatchUnknownHostException(@Mocked final InetAddress mockIn
}

try {
new OdeProperties();
new OdeProperties().initialize();
} catch (Exception e) {
fail("Unexpected exception in init: " + e);
}
Expand All @@ -82,7 +82,7 @@ public void missingDockerHostIpShouldThrowException(@Mocked final InetAddress mo
}

try {
new OdeProperties();
new OdeProperties().initialize();
} catch (Exception e) {
assertTrue(e instanceof MissingPropertyException);
}
Expand Down
1 change: 1 addition & 0 deletions jpo-security
Submodule jpo-security added at b148bd
2 changes: 1 addition & 1 deletion jpo-security-svcs
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<module>jpo-ode-svcs</module>
<module>jpo-ode-plugins</module>
<module>jpo-ode-common</module>
<module>jpo-security</module>
<module>jpo-security-svcs</module>
</modules>

Expand Down
11 changes: 7 additions & 4 deletions sample.env
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,13 @@ RDE_TIM_TOPIC="topic.OdeTimJson"
# Miscellaneous optional values

# The username for authenticating the USDOT Situation Data Warehouse WebSocket server
ODE_DDS_CAS_USERNAME
ODE_DDS_CAS_USERNAME=
# The password for authenticating the USDOT Situation Data Warehouse WebSocket server
ODE_DDS_CAS_PASSWORD
ODE_DDS_CAS_PASSWORD=
# The IPv4 address of the server running ODE
ODE_EXTERNAL_IPV4
ODE_EXTERNAL_IPV4=
# The IPv6 address of the server running ODE
ODE_EXTERNAL_IPV6
ODE_EXTERNAL_IPV6=

#jpo-security-svcs module properties
SEC_CRYPTO_SERVICE_BASE_URI=

0 comments on commit 4f658d6

Please sign in to comment.