Skip to content

Commit

Permalink
Merge branch 'main' into feature/DDCC-as-default-domain-for-non-legac…
Browse files Browse the repository at this point in the history
…y-api
  • Loading branch information
ascheibal committed Dec 2, 2023
2 parents ee18901 + 625bf36 commit 543ad6f
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ public static class HeaderFields {
@Setter
public static class Revocation {
private int deleteThreshold = 14;
private Boolean enabled;
}

@Getter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import java.time.ZonedDateTime;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
Expand All @@ -69,6 +70,7 @@
@RequiredArgsConstructor
@Validated
@Slf4j
@ConditionalOnProperty(name = "dgc.revocation.enabled", havingValue = "true")
public class CertificateRevocationListController {

private final RevocationListService revocationListService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import net.javacrumbs.shedlock.spring.annotation.SchedulerLock;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
@Slf4j
@ConditionalOnProperty(name = "dgc.revocation.enabled", havingValue = "true")
public class RevocationListCleanUpService {

private final RevocationBatchRepository revocationBatchRepository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.bouncycastle.cert.X509CertificateHolder;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Service;
import org.springframework.validation.BeanPropertyBindingResult;
Expand All @@ -57,6 +58,7 @@
@Service
@Slf4j
@RequiredArgsConstructor
@ConditionalOnProperty(name = "dgc.revocation.enabled", havingValue = "true")
public class RevocationListService {

private static final int MAX_BATCH_LIST_SIZE = 1000;
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ dgc:
pem: X-SSL-Client-Cert
revocation:
delete-threshold: 14
enabled: false
signer-information:
delete-threshold: 14
trustedCertificates:
Expand Down Expand Up @@ -104,6 +105,7 @@ dgc:
apiKey: 0a0a0a0a-0a0a-0a0a-0a0a-0a0a0a0a0a0a
url: https://api.cloudmersive.com
enabled: false

springdoc:
api-docs:
enabled: false
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,13 @@
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.HttpHeaders;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.test.context.junit.jupiter.EnabledIf;
import org.springframework.test.web.servlet.MockMvc;

@SpringBootTest
@AutoConfigureMockMvc
@Slf4j
@EnabledIf(expression = "${dgc.revocation.enabled}", loadContext = true)
public class CertificateRevocationListIntegrationTest {

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit.jupiter.EnabledIf;

@SpringBootTest(properties = "dgc.revocation.delete-threshold=14")
@Slf4j
@EnabledIf(expression = "${dgc.revocation.enabled}", loadContext = true)
class CertificateRevocationListCleanupTest {

@Autowired
Expand Down
2 changes: 2 additions & 0 deletions src/test/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ dgc:
thumbprint: X-SSL-Client-SHA256
distinguished-name: X-SSL-Client-DN
pem: X-SSL-Client-Cert
revocation:
enabled: false
did:
enableDidGeneration: true
didId: a
Expand Down

0 comments on commit 543ad6f

Please sign in to comment.