-
Notifications
You must be signed in to change notification settings - Fork 65
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
- Loading branch information
Boris Stanojevic
committed
Feb 1, 2024
1 parent
7df3541
commit 11e5981
Showing
56 changed files
with
1,489 additions
and
107 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
61 changes: 61 additions & 0 deletions
61
...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,61 @@ | ||
/* | ||
* 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.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("TLS", auditContext.getAuditTransmissionProtocol().getTransportName()); | ||
assertTrue(auditContext.getAuditMessageQueue() instanceof AsynchronousAuditMessageQueue); | ||
|
||
assertEquals("fhir", ((BalpAuditContext)auditContext).getAuditRepositoryContextPath()); | ||
Assertions.assertArrayEquals(new String[]{"cid","client-id","my-client-id-path"}, | ||
((BalpAuditContext) auditContext).getBalpJwtExtractorProperties().getClientIdPath()); | ||
} | ||
|
||
} |
6 changes: 6 additions & 0 deletions
6
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,6 @@ | ||
ipf: | ||
atna: | ||
balp: | ||
audit-repository-context-path: fhir | ||
jwt: | ||
clientIdPath: cid,client-id,my-client-id-path |
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.