Skip to content
Snippets Groups Projects
Commit 2682f1ee authored by OZGCloud's avatar OZGCloud
Browse files

OZG-5682 fix configuration for antragraum

parent 28bc2e31
Branches
Tags
No related merge requests found
Showing
with 25 additions and 10 deletions
...@@ -12,5 +12,8 @@ import lombok.Setter; ...@@ -12,5 +12,8 @@ import lombok.Setter;
@Getter @Getter
public class NachrichtenManagerProperties { public class NachrichtenManagerProperties {
private String url; /**
* URL of Nachrichten Manager instance
*/
private String address;
} }
...@@ -55,14 +55,17 @@ public class AntragraumProperties { ...@@ -55,14 +55,17 @@ public class AntragraumProperties {
/** /**
* The uri where to load the idp Metadata from * The uri where to load the idp Metadata from
*/ */
@NotEmpty
private Resource metadataUri; private Resource metadataUri;
/** /**
* The location of the private key for decrypting the saml token data * The location of the private key for decrypting the saml token data
*/ */
@NotEmpty
private Resource decryptionPrivateKey; private Resource decryptionPrivateKey;
/** /**
* The location of the certificate for decrypting the saml token data * The location of the certificate for decrypting the saml token data
*/ */
@NotEmpty
private Resource decryptionCertificate; private Resource decryptionCertificate;
} }
...@@ -27,6 +27,8 @@ import static java.util.Objects.*; ...@@ -27,6 +27,8 @@ import static java.util.Objects.*;
import java.util.stream.Stream; import java.util.stream.Stream;
import jakarta.annotation.PostConstruct;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -34,7 +36,6 @@ import org.springframework.stereotype.Service; ...@@ -34,7 +36,6 @@ import org.springframework.stereotype.Service;
import de.ozgcloud.nachrichten.NachrichtenManagerProperties; import de.ozgcloud.nachrichten.NachrichtenManagerProperties;
import de.ozgcloud.nachrichten.postfach.PersistPostfachNachrichtService; import de.ozgcloud.nachrichten.postfach.PersistPostfachNachrichtService;
import de.ozgcloud.nachrichten.postfach.PostfachNachricht; import de.ozgcloud.nachrichten.postfach.PostfachNachricht;
import jakarta.annotation.PostConstruct;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
@Service @Service
...@@ -65,7 +66,7 @@ public class AntragraumService { ...@@ -65,7 +66,7 @@ public class AntragraumService {
@PostConstruct @PostConstruct
void init() { void init() {
if (isNull(nachrichtenManagerProperties.getUrl())) { if (isNull(nachrichtenManagerProperties.getAddress())) {
throw new IllegalStateException("Address of Nachrichten-Manager is not set"); throw new IllegalStateException("Address of Nachrichten-Manager is not set");
} }
} }
......
...@@ -84,7 +84,7 @@ import net.shibboleth.utilities.java.support.xml.XMLParserException; ...@@ -84,7 +84,7 @@ import net.shibboleth.utilities.java.support.xml.XMLParserException;
class BayernIdSamlConfiguration { class BayernIdSamlConfiguration {
private XMLObjectProviderRegistry registry; private XMLObjectProviderRegistry registry;
@Getter @Getter
private ParserPool parserPool; private ParserPool parserPool; // TODO als spring bean bereit stellen
@Autowired @Autowired
private AntragraumProperties antragraumProperties; private AntragraumProperties antragraumProperties;
......
...@@ -45,7 +45,8 @@ import net.shibboleth.utilities.java.support.xml.XMLParserException; ...@@ -45,7 +45,8 @@ import net.shibboleth.utilities.java.support.xml.XMLParserException;
@ConditionalOnProperty(AntragraumProperties.PROPERTY_ANTRAGSRAUM_URL) @ConditionalOnProperty(AntragraumProperties.PROPERTY_ANTRAGSRAUM_URL)
@RequiredArgsConstructor @RequiredArgsConstructor
class Saml2Parser { class Saml2Parser {
private final BayernIdSamlConfiguration configuration; private final BayernIdSamlConfiguration configuration; // TODO eine Configuration sollte nicht als Bean injeziert werden
// TODO als Spring Bean bereit stellen
private ResponseUnmarshaller unmarshaller; private ResponseUnmarshaller unmarshaller;
Response parse(String request) { Response parse(String request) {
......
...@@ -48,8 +48,10 @@ import net.shibboleth.utilities.java.support.resolver.CriteriaSet; ...@@ -48,8 +48,10 @@ import net.shibboleth.utilities.java.support.resolver.CriteriaSet;
class Saml2Verifier { class Saml2Verifier {
public static final String INVALID_SIGNATURE = "Invalid signature for object [%s]: "; public static final String INVALID_SIGNATURE = "Invalid signature for object [%s]: ";
public static final String SIGNATURE_MISSING = "Signature missing"; public static final String SIGNATURE_MISSING = "Signature missing";
private final Saml2Parser parser; private final Saml2Parser parser;
private final BayernIdSamlConfiguration configuration; private final BayernIdSamlConfiguration configuration;
private SignatureTrustEngine trustEngine; private SignatureTrustEngine trustEngine;
private CriteriaSet verificationCriteria; private CriteriaSet verificationCriteria;
......
...@@ -29,7 +29,7 @@ public class InfoManagerService { ...@@ -29,7 +29,7 @@ public class InfoManagerService {
.nachrichtId(postfachNachricht.getId()) .nachrichtId(postfachNachricht.getId())
.vorgangId(postfachNachricht.getVorgangId()) .vorgangId(postfachNachricht.getVorgangId())
.postfachId(postfachNachricht.getPostfachId()) .postfachId(postfachNachricht.getPostfachId())
.nachrichtenManagerUrl(nachrichtenManagerProperties.getUrl()) .nachrichtenManagerUrl(nachrichtenManagerProperties.getAddress())
.build(); .build();
} }
} }
...@@ -3,5 +3,10 @@ ozgcloud: ...@@ -3,5 +3,10 @@ ozgcloud:
url: https://dev.antragsraum.de/ url: https://dev.antragsraum.de/
entityId: https://antragsraum.ozgcloud.de/ entityId: https://antragsraum.ozgcloud.de/
metadataUri: "classpath:/bayernid/metadata/bayernid-idp-infra.xml" metadataUri: "classpath:/bayernid/metadata/bayernid-idp-infra.xml"
decryptionPrivateKey: "classpath:/bayernid/bayernid-test-enc.key" decryptionPrivateKey: "classpath:/bayernid/bayernid-dev-enc.key"
decryptionCertificate: "classpath:/bayernid/bayernid-test-enc.crt" decryptionCertificate: "classpath:/bayernid/bayernid-dev-enc.crt"
\ No newline at end of file
grpc:
client:
info-manager:
address: infomanager.local
\ No newline at end of file
...@@ -88,7 +88,7 @@ class InfoManagerServiceTest { ...@@ -88,7 +88,7 @@ class InfoManagerServiceTest {
@Test @Test
void shouldSetNachrichtenManagerUrl() { void shouldSetNachrichtenManagerUrl() {
when(nachrichtenManagerProperties.getUrl()).thenReturn(NACHRICHTEN_MANAGER_URL); when(nachrichtenManagerProperties.getAddress()).thenReturn(NACHRICHTEN_MANAGER_URL);
var request = buildInfomanagerNachricht(); var request = buildInfomanagerNachricht();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment