Skip to content
Snippets Groups Projects
Commit 882ed2ea authored by OZG-Cloud Team's avatar OZG-Cloud Team
Browse files

OZG-3136 add configuration parameter

parent 2abccee9
No related branches found
No related tags found
No related merge requests found
......@@ -34,3 +34,4 @@ build/
.vscode/
application-sec.yml
xta-adapter/KOP_SH_KIEL_DEV.p12
{"properties": [{
{"properties": [
{
"name": "ozgcloud.xta.actions.status-list",
"type": "java.lang.String",
"description": "A description for 'ozgcloud.xta.actions.status-list'"
}]}
\ No newline at end of file
},
{
"name": "ozgcloud.xta.identifier",
"type": "java.lang.String",
"description": "XTA Identifier for SOAP Request Header (f.e. 'gae:firstname.lastname@mgm-tp.com')"
},
{
"name": "ozgcloud.xta.keystore.file",
"type": "java.lang.String",
"description": "Location of the keyfile for xta accesss"
},
{
"name": "ozgcloud.xta.keystore.password",
"type": "java.lang.String",
"description": "Password of the keyfile for xta accesss"
}
]}
\ No newline at end of file
......@@ -10,12 +10,16 @@ ozgcloud:
Den Dienst dann mit dem Spring-Profile 'sec' starten.
# Ceritifcade chain
# Certificate chain
lokal das Root CA in keystore laden:
sudo keytool -trustcacerts -keystore /lib/jvm/java-1.17.0-openjdk-amd64/lib/security/cacerts -storepass changeit -importcert -alias dataportRoot -file DataportRootCA02.crt
Alternativ p12 Datei lokal erzeugen:
keytool -importkeystore -srckeystore KOP_SH_KIEL_DEV.pfx -srcstoretype pkcs12 -destkeystore KOP_SH_KIEL_DEV2.p12 -deststoretype PKCS12
# Port forwarding
Um eine Verbindung zum Nachrichtenbroker aufbauen zu können, muss diese über den Hetzner-Server geroutet werden:
......
package de.ozgcloud.eingang.xta;
import jakarta.xml.bind.JAXBContext;
import jakarta.xml.bind.JAXBElement;
import jakarta.xml.bind.JAXBException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.ws.client.WebServiceClientException;
import org.springframework.ws.client.support.interceptor.ClientInterceptor;
......@@ -14,10 +11,18 @@ import de.itvsh.kop.eingangsadapter.common.errorhandling.TechnicalException;
import eu.osci.ws._2014._10.transport.OriginatorsType;
import eu.osci.ws._2014._10.transport.PartyIdentifierType;
import eu.osci.ws._2014._10.transport.PartyType;
import jakarta.validation.Valid;
import jakarta.xml.bind.JAXBContext;
import jakarta.xml.bind.JAXBElement;
import jakarta.xml.bind.JAXBException;
@Component
class WsHeaderAddingInterceptor implements ClientInterceptor {
@Autowired
@Valid
private XtaProperties properties;
@Override
public boolean handleRequest(MessageContext messageContext) throws WebServiceClientException {
var soapMessage = (SoapMessage) messageContext.getRequest();
......@@ -39,7 +44,7 @@ class WsHeaderAddingInterceptor implements ClientInterceptor {
PartyType partyType = new PartyType();
PartyIdentifierType identifier = new PartyIdentifierType();
identifier.setValue("gae:noreply@ozg-sh.de");
identifier.setValue(properties.getIdentifier());
partyType.setIdentifier(identifier);
var origin = new OriginatorsType();
......
......@@ -3,15 +3,14 @@ package de.ozgcloud.eingang.xta;
import java.math.BigInteger;
import java.net.URI;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.Resource;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
......@@ -30,6 +29,8 @@ class XtaProperties {
private KeyStore keyStore;
private Actions actions;
private String identifier;
}
@Validated
......
......@@ -2,8 +2,6 @@ package de.ozgcloud.eingang.xta;
import static org.assertj.core.api.Assertions.*;
import jakarta.validation.Valid;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
......@@ -12,6 +10,7 @@ import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import de.itvsh.kop.eingangsadapter.Application;
import jakarta.validation.Valid;
@Disabled("real live test - do only activate for manual testing")
@ActiveProfiles({ "itcase", "local" })
......
......@@ -3,3 +3,4 @@ ozgcloud:
keystore:
file: classpath:xtaTestStore.p12
password: <geheim>
identifier: gae:noreply@ozg-sh.de
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment