Skip to content

Commit ecbc628

Browse files
authored
Merge pull request #222 from companieshouse/feature/remove-feature-flag-idv
Remove IDV Feature flag functionality and test cases
2 parents 0fba7f7 + 33f4c11 commit ecbc628

File tree

8 files changed

+7
-105
lines changed

8 files changed

+7
-105
lines changed

src/itest/java/uk/gov/companieshouse/pscdataapi/CucumberFeaturesRunnerIT.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ public class CucumberFeaturesRunnerIT {
3838

3939
@DynamicPropertySource
4040
public static void setProperties(DynamicPropertyRegistry registry) {
41-
registry.add("feature.identity_verification", () -> true);
4241
registry.add("spring.data.mongodb.uri", mongoDBContainer::getReplicaSetUrl);
4342
mongoDBContainer.start();
4443
}

src/main/java/uk/gov/companieshouse/pscdataapi/config/FeatureFlags.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,13 @@
77
public class FeatureFlags {
88

99
private final boolean streamHookDisabled;
10-
private final boolean identityVerificationEnabled;
1110

12-
public FeatureFlags(@Value("${feature.seeding_collection_enabled}") final boolean streamHookDisabled,
13-
@Value("${feature.identity_verification}") final boolean identityVerificationEnabled) {
11+
public FeatureFlags(@Value("${feature.seeding_collection_enabled}") final boolean streamHookDisabled) {
1412
this.streamHookDisabled = streamHookDisabled;
15-
this.identityVerificationEnabled = identityVerificationEnabled;
1613
}
1714

1815
public boolean isStreamHookDisabled() {
1916
return streamHookDisabled;
2017
}
2118

22-
public boolean isIdentityVerificationEnabled() {
23-
return identityVerificationEnabled;
24-
}
25-
2619
}

src/main/java/uk/gov/companieshouse/pscdataapi/config/WebSecurityConfig.java

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package uk.gov.companieshouse.pscdataapi.config;
22

33
import java.util.List;
4-
import org.springframework.beans.factory.annotation.Value;
54
import org.springframework.context.annotation.Bean;
65
import org.springframework.context.annotation.Configuration;
76
import org.springframework.context.annotation.Primary;
@@ -23,10 +22,6 @@
2322
@Configuration
2423
public class WebSecurityConfig implements WebMvcConfigurer {
2524

26-
// feature flag marked for future removal
27-
@Value("${feature.identity_verification:false}")
28-
private Boolean identityVerificationEnabled;
29-
3025
public static final String PATTERN_FULL_RECORD =
3126
"/company/{company_number}/persons-with-significant-control/individual/{notification_id}/full_record";
3227
public static final String PATTERN_IDENTITY_VERIFICATION_DETAILS =
@@ -37,12 +32,10 @@ public class WebSecurityConfig implements WebMvcConfigurer {
3732
@Override
3833
public void addInterceptors(final InterceptorRegistry registry) {
3934
registry.addInterceptor(userAuthenticationInterceptor());
40-
if (Boolean.TRUE.equals(identityVerificationEnabled)) {
41-
registry.addInterceptor(internalUserInterceptor())
42-
.addPathPatterns(PATTERN_IDENTITY_VERIFICATION_DETAILS);
43-
registry.addInterceptor(fullRecordAuthenticationInterceptor())
44-
.addPathPatterns(PATTERN_FULL_RECORD);
45-
}
35+
registry.addInterceptor(internalUserInterceptor())
36+
.addPathPatterns(PATTERN_IDENTITY_VERIFICATION_DETAILS);
37+
registry.addInterceptor(fullRecordAuthenticationInterceptor())
38+
.addPathPatterns(PATTERN_FULL_RECORD);
4639
}
4740

4841
@Override

src/main/java/uk/gov/companieshouse/pscdataapi/controller/CompanyPscFullRecordGetController.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import static uk.gov.companieshouse.pscdataapi.PscDataApiApplication.APPLICATION_NAME_SPACE;
44

55
import jakarta.servlet.http.HttpServletRequest;
6-
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
76
import org.springframework.http.ResponseEntity;
87
import org.springframework.web.bind.annotation.GetMapping;
98
import org.springframework.web.bind.annotation.PathVariable;
@@ -15,7 +14,6 @@
1514
import uk.gov.companieshouse.pscdataapi.service.CompanyPscService;
1615

1716
@RestController
18-
@ConditionalOnProperty(prefix = "feature", name = "identity_verification", havingValue = "true")
1917
public class CompanyPscFullRecordGetController {
2018

2119
private static final Logger LOGGER = LoggerFactory.getLogger(APPLICATION_NAME_SPACE);

src/main/resources/application.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,4 @@ spring.web.resources.add-mappings=false
1616
spring.mvc.throw-exception-if-no-handler-found=false
1717
spring.data.jackson.default-property-inclusion=NON_NULL
1818
feature.seeding_collection_enabled=${SEEDING_COLLECTION_ENABLED:false}
19-
feature.identity_verification=${FEATURE_FLAG_IDENTITY_VERIFICATION_081124:false}
2019
server.port=${PORT:8081}

src/test/java/uk/gov/companieshouse/pscdataapi/config/WebSecurityConfigTest.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@
2020
import uk.gov.companieshouse.pscdataapi.service.CompanyPscService;
2121

2222
@ExtendWith(SpringExtension.class)
23-
@WebMvcTest(controllers = {
24-
CompanyPscFullRecordGetController.class
25-
}, properties = {"feature.identity_verification=true"})
23+
@WebMvcTest(controllers = CompanyPscFullRecordGetController.class)
2624
class WebSecurityConfigTest {
2725

2826
private static final String MOCK_COMPANY_NUMBER = "1234567";

src/test/java/uk/gov/companieshouse/pscdataapi/controller/CompanyPscFullRecordGetControllerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import uk.gov.companieshouse.pscdataapi.exceptions.NotFoundException;
2929
import uk.gov.companieshouse.pscdataapi.service.CompanyPscService;
3030

31-
@SpringBootTest(properties = {"feature.identity_verification=true"})
31+
@SpringBootTest
3232
@AutoConfigureMockMvc
3333
class CompanyPscFullRecordGetControllerTest {
3434

src/test/java/uk/gov/companieshouse/pscdataapi/controller/CompanyPscFullRecordGetDisabledControllerTest.java

Lines changed: 0 additions & 78 deletions
This file was deleted.

0 commit comments

Comments
 (0)