-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
433: BALP audit with oauth token support
Boris Stanojevic
committed
Feb 1, 2024
1 parent
7df3541
commit 68b7dfa
Showing
56 changed files
with
1,532 additions
and
110 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
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
64 changes: 64 additions & 0 deletions
64
...starter/src/test/java/org/openehealth/ipf/boot/atna/IpfAtnaBalpAutoConfigurationTest.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,64 @@ | ||
/* | ||
* Copyright 2017 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.openehealth.ipf.boot.atna; | ||
|
||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.ExtendWith; | ||
import org.openehealth.ipf.commons.audit.AuditContext; | ||
import org.openehealth.ipf.commons.audit.BalpAuditContext; | ||
import org.openehealth.ipf.commons.audit.queue.AsynchronousAuditMessageQueue; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
import org.springframework.test.context.ActiveProfiles; | ||
import org.springframework.test.context.junit.jupiter.SpringExtension; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertArrayEquals; | ||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
|
||
/** | ||
* | ||
*/ | ||
@ExtendWith(SpringExtension.class) | ||
@SpringBootTest(classes = { TestApplication.class }) | ||
@ActiveProfiles("balp") | ||
public class IpfAtnaBalpAutoConfigurationTest { | ||
|
||
@Autowired | ||
private AuditContext auditContext; | ||
|
||
@Test | ||
public void testAtnaWithBalpSettings() throws Exception { | ||
assertTrue(auditContext instanceof BalpAuditContext); | ||
|
||
assertEquals("atna-test", auditContext.getAuditSourceId()); | ||
assertEquals("mysite", auditContext.getAuditEnterpriseSiteId()); | ||
assertEquals("localhost", auditContext.getAuditRepositoryHostName()); | ||
assertEquals(1342, auditContext.getAuditRepositoryPort()); | ||
assertEquals("FHIR-REST-TLS", auditContext.getAuditTransmissionProtocol().getTransportName()); | ||
assertTrue(auditContext.getAuditMessageQueue() instanceof AsynchronousAuditMessageQueue); | ||
|
||
assertEquals("fhir", ((BalpAuditContext)auditContext).getAuditRepositoryContextPath()); | ||
assertArrayEquals(new String[]{"cid","client-id","my-client-id-path"}, | ||
((BalpAuditContext) auditContext).getBalpJwtExtractorProperties().getClientIdPath()); | ||
assertArrayEquals(new String[]{}, | ||
((BalpAuditContext) auditContext).getBalpJwtExtractorProperties().getIdPath()); | ||
} | ||
|
||
} |
8 changes: 8 additions & 0 deletions
8
boot/ipf-atna-spring-boot-starter/src/test/resources/application-balp.yml
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,8 @@ | ||
ipf: | ||
atna: | ||
audit-repository-transport: FHIR-REST-TLS | ||
balp: | ||
audit-repository-context-path: fhir | ||
oauth: | ||
clientIdPath: cid,client-id,my-client-id-path | ||
idPath: |
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
27 changes: 27 additions & 0 deletions
27
commons/audit/src/main/java/org/openehealth/ipf/commons/audit/BalpAuditContext.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,27 @@ | ||
/* | ||
* Copyright 2024 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.openehealth.ipf.commons.audit; | ||
|
||
/** | ||
* @author Boris Stanojevic | ||
* @since 4.8 | ||
*/ | ||
public interface BalpAuditContext extends AuditContext { | ||
|
||
String getAuditRepositoryContextPath(); | ||
|
||
BalpJwtExtractorProperties getBalpJwtExtractorProperties(); | ||
} |
Oops, something went wrong.