Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: revocation-list controller disabled. #80

Merged
merged 5 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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