-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from axonivy-market/feature/XIVY-12667_optimiza…
…tion Feature/xivy 12667 optimization
- Loading branch information
Showing
17 changed files
with
468 additions
and
40 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
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
22 changes: 22 additions & 0 deletions
22
threema-connector-test/src_test/threema/connector/test/util/KeyPairGeneratorTest.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,22 @@ | ||
package threema.connector.test.util; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import util.KeyPairGenerator; | ||
import util.KeyPairGenerator.KeyPair; | ||
|
||
public class KeyPairGeneratorTest { | ||
|
||
@Test | ||
void generateKeyPair() { | ||
KeyPair keys = KeyPairGenerator.generate(); | ||
assertThat(keys.publicKey()).isNotEmpty(); | ||
assertThat(keys.privateKey()).isNotEmpty(); | ||
|
||
assertThat(keys.publicKey().length()).isEqualTo(64); | ||
assertThat(keys.privateKey().length()).isEqualTo(64); | ||
} | ||
|
||
} |
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
6 changes: 6 additions & 0 deletions
6
threema-connector/dataclasses/threema/connector/createKeyPairData.ivyClass
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,6 @@ | ||
createKeyPairData #class | ||
threema.connector #namespace | ||
privateKey String #field | ||
privateKey PERSISTENT #fieldModifier | ||
publicKey String #field | ||
publicKey PERSISTENT #fieldModifier |
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 |
---|---|---|
@@ -0,0 +1,67 @@ | ||
{ | ||
"format" : "10.0.0", | ||
"id" : "18B67537F65B8CEE", | ||
"config" : { | ||
"data" : "threema.connector.createKeyPairData" | ||
}, | ||
"elements" : [ { | ||
"id" : "f0", | ||
"type" : "RequestStart", | ||
"name" : "start.ivp", | ||
"config" : { | ||
"callSignature" : "start", | ||
"outLink" : "start.ivp" | ||
}, | ||
"visual" : { | ||
"at" : { "x" : 96, "y" : 64 } | ||
}, | ||
"connect" : { "id" : "f4", "to" : "f3" } | ||
}, { | ||
"id" : "f1", | ||
"type" : "TaskEnd", | ||
"visual" : { | ||
"at" : { "x" : 696, "y" : 64 } | ||
} | ||
}, { | ||
"id" : "f3", | ||
"type" : "Script", | ||
"name" : "generateKeyPair", | ||
"config" : { | ||
"output" : { | ||
"code" : [ | ||
"import util.KeyPairGenerator;", | ||
"import util.KeyPairGenerator.KeyPair;", | ||
"", | ||
"KeyPair keys = KeyPairGenerator.generate();", | ||
"", | ||
"out.publicKey = keys.publicKey();", | ||
"out.privateKey = keys.privateKey();" | ||
] | ||
} | ||
}, | ||
"visual" : { | ||
"at" : { "x" : 320, "y" : 64 } | ||
}, | ||
"connect" : { "id" : "f6", "to" : "f5" } | ||
}, { | ||
"id" : "f5", | ||
"type" : "DialogCall", | ||
"name" : "KeyPair", | ||
"config" : { | ||
"dialogId" : "threema.connector.KeyPair", | ||
"startMethod" : "start(threema.connector.createKeyPairData)", | ||
"call" : { | ||
"params" : [ | ||
{ "name" : "createKeyPairData", "type" : "threema.connector.createKeyPairData" } | ||
], | ||
"map" : { | ||
"param.createKeyPairData" : "in" | ||
} | ||
} | ||
}, | ||
"visual" : { | ||
"at" : { "x" : 508, "y" : 64 } | ||
}, | ||
"connect" : { "id" : "f2", "to" : "f1" } | ||
} ] | ||
} |
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,19 @@ | ||
package util; | ||
|
||
import javax.xml.bind.DatatypeConverter; | ||
|
||
import ch.threema.apitool.CryptTool; | ||
|
||
public class KeyPairGenerator { | ||
|
||
public record KeyPair(String publicKey, String privateKey) {} | ||
|
||
public static KeyPair generate() { | ||
byte[] publicKey = new byte[32]; | ||
byte[] privateKey = new byte[32]; | ||
|
||
CryptTool.generateKeyPair(publicKey, privateKey); | ||
return new KeyPair(DatatypeConverter.printHexBinary(publicKey), DatatypeConverter.printHexBinary(privateKey)); | ||
} | ||
|
||
} |
7 changes: 7 additions & 0 deletions
7
threema-connector/src_hd/threema/connector/KeyPair/KeyPair.rddescriptor
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,7 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<richDialogDescriptor> | ||
<property> | ||
<name>viewTechnology</name> | ||
<value>JSF</value> | ||
</property> | ||
</richDialogDescriptor> |
35 changes: 35 additions & 0 deletions
35
threema-connector/src_hd/threema/connector/KeyPair/KeyPair.xhtml
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,35 @@ | ||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://xmlns.jcp.org/jsf/core" | ||
xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:ui="http://xmlns.jcp.org/jsf/facelets" | ||
xmlns:ic="http://ivyteam.ch/jsf/component" xmlns:p="http://primefaces.org/ui" | ||
xmlns:pe="http://primefaces.org/ui/extensions"> | ||
<h:body> | ||
<ui:composition template="/layouts/frame-10.xhtml"> | ||
<ui:define name="title">KeyPair</ui:define> | ||
<ui:define name="content"> | ||
|
||
<h3>Newly generated Keypair</h3> | ||
|
||
<h:form id="form"> | ||
|
||
<p:panelGrid columns="2" layout="grid" styleClass="ui-panelgrid-blank ui-fluid" | ||
columnClasses="ui-g-12 ui-md-3 ui-lg-2, ui-g-12 ui-md-9 ui-lg-4, ui-g-12 ui-md-3 ui-lg-2, ui-g-12 ui-md-9 ui-lg-4"> | ||
|
||
<p:outputLabel for="createKeyPairDataPrivateKey" value="Private Key" /> | ||
<p:outputLabel id="createKeyPairDataPrivateKey" value="#{data.createKeyPairData.privateKey}"></p:outputLabel> | ||
|
||
<p:outputLabel for="createKeyPairDataPublicKey" value="Public Key" /> | ||
<p:outputLabel id="createKeyPairDataPublicKey" value="#{data.createKeyPairData.publicKey}"></p:outputLabel> | ||
|
||
</p:panelGrid> | ||
<br /> | ||
<div class="command-btns"> | ||
<p:commandLink id="cancel" actionListener="#{ivyWorkflowView.cancel()}" value="Cancel" /> | ||
<p:commandButton id="proceed" actionListener="#{logic.close}" value="Proceed" update="form" icon="pi pi-check" /> | ||
</div> | ||
</h:form> | ||
|
||
</ui:define> | ||
</ui:composition> | ||
</h:body> | ||
|
||
</html> |
4 changes: 4 additions & 0 deletions
4
threema-connector/src_hd/threema/connector/KeyPair/KeyPairData.ivyClass
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,4 @@ | ||
KeyPairData #class | ||
threema.connector.KeyPair #namespace | ||
createKeyPairData threema.connector.createKeyPairData #field | ||
createKeyPairData PERSISTENT #fieldModifier |
52 changes: 52 additions & 0 deletions
52
threema-connector/src_hd/threema/connector/KeyPair/KeyPairProcess.p.json
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,52 @@ | ||
{ | ||
"format" : "10.0.0", | ||
"id" : "18B675A6BCE832D1", | ||
"kind" : "HTML_DIALOG", | ||
"config" : { | ||
"data" : "threema.connector.KeyPair.KeyPairData" | ||
}, | ||
"elements" : [ { | ||
"id" : "f0", | ||
"type" : "HtmlDialogStart", | ||
"name" : "start(createKeyPairData)", | ||
"config" : { | ||
"callSignature" : "start", | ||
"input" : { | ||
"params" : [ | ||
{ "name" : "createKeyPairData", "type" : "threema.connector.createKeyPairData" } | ||
], | ||
"map" : { | ||
"out.createKeyPairData" : "param.createKeyPairData" | ||
} | ||
}, | ||
"guid" : "18B675A6BCFECF51" | ||
}, | ||
"visual" : { | ||
"at" : { "x" : 96, "y" : 64 } | ||
}, | ||
"connect" : { "id" : "f2", "to" : "f1" } | ||
}, { | ||
"id" : "f1", | ||
"type" : "HtmlDialogEnd", | ||
"visual" : { | ||
"at" : { "x" : 224, "y" : 64 } | ||
} | ||
}, { | ||
"id" : "f3", | ||
"type" : "HtmlDialogEventStart", | ||
"name" : "close", | ||
"config" : { | ||
"guid" : "18B675A6BD2AE7CB" | ||
}, | ||
"visual" : { | ||
"at" : { "x" : 96, "y" : 160 } | ||
}, | ||
"connect" : { "id" : "f5", "to" : "f4" } | ||
}, { | ||
"id" : "f4", | ||
"type" : "HtmlDialogExit", | ||
"visual" : { | ||
"at" : { "x" : 224, "y" : 160 } | ||
} | ||
} ] | ||
} |
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,60 @@ | ||
<!DOCTYPE html> | ||
<html xmlns="http://www.w3.org/1999/xhtml" | ||
xmlns:f="http://xmlns.jcp.org/jsf/core" | ||
xmlns:h="http://xmlns.jcp.org/jsf/html" | ||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets" | ||
xmlns:ic="http://ivyteam.ch/jsf/component" | ||
xmlns:p="http://primefaces.org/ui" | ||
xmlns:pe="http://primefaces.org/ui/extensions"> | ||
|
||
<!-- | ||
DESCRIPTION: | ||
This is the default template to use the freya-ivy theme as well as iFrames approach. | ||
PORTAL: | ||
If you are using the Axon Ivy Portal, you can pass several parameters to it to use some features (e.g. process chain). | ||
You'll find the list of parameters here: https://developer.axonivy.com/portal/10.0/doc/portal-developer-guide/components/layout-templates.html#components-layout-templates-iframe-task-template | ||
For further information about iframes and usage in Portal please refer to: https://developer.axonivy.com/portal/10.0/doc/portal-developer-guide/iframe/index.html | ||
BRANDING: | ||
If you want to brand your dialogs, please take a look at our documentation: https://developer.axonivy.com/doc/10.0/designer-guide/user-interface/branding/index.html | ||
STYLING: | ||
If you want to add custom styles, you can simply add your own .css file (e.g. at the location: "webContent/layouts/styles/style.css") | ||
and refence it below in the head part. | ||
--> | ||
|
||
<h:head> | ||
<f:attribute name="primefaces.THEME" value="#{ivyFreyaTheme.theme}" /> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title><ui:insert name="title">Ivy Html Dialog</ui:insert></title> | ||
<link rel="shortcut icon" href="#{resource['ivy-branding:favicon']}" /> | ||
<h:outputScript name="js/layout.js" library="#{ivyFreyaTheme.library}" /> | ||
<h:outputStylesheet name="#{ivyFreyaTheme.layout}" library="#{ivyFreyaTheme.library}" /> | ||
<h:outputStylesheet name="primeflex-2.min.css" library="primeflex" /> | ||
<h:outputStylesheet name="custom.css" library="ivy-branding" /> | ||
<!-- Optional Style or Script files: | ||
<h:outputStylesheet name="layouts/styles/style.css" /> | ||
--> | ||
</h:head> | ||
<h:body class="body-hd"> | ||
<ui:include src="/layouts/includes/progress-loader.xhtml" /> | ||
<div id="content" class="container frame"> | ||
<ui:insert name="content"> | ||
default content | ||
</ui:insert> | ||
</div> | ||
|
||
<ui:insert name="exception"> | ||
<ui:include src="/layouts/includes/exception.xhtml" /> | ||
</ui:insert> | ||
|
||
<!-- optional Portal parameters: | ||
<script> | ||
window. | ||
</script> | ||
--> | ||
|
||
</h:body> | ||
</html> |
Oops, something went wrong.