Skip to content

Commit

Permalink
Merge pull request #311 from sumeetphadnis/next
Browse files Browse the repository at this point in the history
Enable cryptoservice and cryptoserver modules
  • Loading branch information
ar authored Sep 12, 2024
2 parents ef34fbc + cf5918f commit 2f51629
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 13 deletions.
6 changes: 2 additions & 4 deletions modules/cryptoserver/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
description = 'jPOS-EE :: Crypto Server'

dependencies {
testImplementation libraries.junit
testImplementation libraries.restAssured
testImplementation libs.junit
testImplementation testlibs.restAssured
api project(':modules:qrest')
api project(':modules:cryptoservice')
api project(':modules:db-mysql')
api project(':modules:logback')
}

apply from: "${rootProject.projectDir}/jpos-app.gradle"

test {
dependsOn('installApp')
workingDir = "build/install/cryptoserver"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public int prepare(long id, Serializable context) {
String jsonStr = request.content().toString(CharsetUtil.UTF_8);
ctx.log (jsonStr);
@SuppressWarnings("unchecked")
Map<String,String> m = (Map<String,String>) mapper.readValue(jsonStr, Map.class);
Map<String,String> m = mapper.readValue(jsonStr, Map.class);
UUID keyId = UUID.fromString(m.get("kid"));
byte[] encoded = decoder.decode(m.get("cryptogram"));
byte[] b = cs.aesDecrypt(jobId, keyId, encoded);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

package org.jpos.cryptoserver.participant;

import java.io.IOException;
import java.io.Serializable;
import java.util.*;

Expand Down Expand Up @@ -52,7 +51,7 @@ public int prepare(long id, Serializable context) {
String jsonStr = request.content().toString(CharsetUtil.UTF_8);
ctx.log (jsonStr);
@SuppressWarnings("unchecked")
Map<String,String> m = (Map<String,String>) mapper.readValue(jsonStr, Map.class);
Map<String,String> m = mapper.readValue(jsonStr, Map.class);

SecureData sd = cs.aesEncrypt(m.get("text").getBytes());

Expand Down
2 changes: 1 addition & 1 deletion modules/cryptoservice/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
description = 'jPOS-EE :: CryptoService'

dependencies {
api libraries.jpos
api libs.jpos
api project(':modules:sysconfig')
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
package org.jpos.crypto;

import org.jpos.ee.DB;
import org.jpos.ee.SysConfigManager;
import org.jpos.sysconfig.SysConfigManager;

public class SysConfigCryptoServiceKeyStoreProvider implements CryptoServiceKeyStoreProvider {
@Override
Expand All @@ -30,7 +30,7 @@ public void put(String id, String value) throws CryptoServiceKeyStoreException {
if (mgr.get(id, null) != null)
throw new KeyAlreadyExistsException();

mgr.put(id, value, "security.read", "security.write");
mgr.put(id, value);
return true;
});
} catch (Exception e) {
Expand Down
5 changes: 2 additions & 3 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ include ':modules:binlog-quartz'
include ':modules:server-simulator'
include ':modules:client-simulator'
include ':modules:syslog'

include ':modules:cryptoservice'
include ':modules:cryptoserver'
// include ':modules:dbtest'

dependencyResolutionManagement {
Expand Down Expand Up @@ -60,8 +61,6 @@ dependencyResolutionManagement {
// include ':modules:qi-eeuser'
// include ':modules:qi-sysconfig'
// include ':modules:qi-minigl'
// include ':modules:cryptoservice'
// include ':modules:cryptoserver'
// include ':modules:iso-http-client'
// include ':modules:iso-http-server'
// include ':modules:iso-http-servlet'
Expand Down

0 comments on commit 2f51629

Please sign in to comment.