-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #151 from cabinetoffice/release/7.0
Release/7.0
- Loading branch information
Showing
107 changed files
with
2,094 additions
and
1,408 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
21 changes: 21 additions & 0 deletions
21
.../cabinetoffice/gap/adminbackend/config/CompletionStatisticsSchedulerConfigProperties.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,21 @@ | ||
package gov.cabinetoffice.gap.adminbackend.config; | ||
|
||
import lombok.*; | ||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
import javax.validation.constraints.NotNull; | ||
|
||
@Getter | ||
@Setter | ||
@Builder | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@Configuration | ||
@ConfigurationProperties(prefix = "completion-statistics-scheduler") | ||
public class CompletionStatisticsSchedulerConfigProperties { | ||
|
||
@NotNull | ||
private String queue; | ||
|
||
} |
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
22 changes: 22 additions & 0 deletions
22
src/main/java/gov/cabinetoffice/gap/adminbackend/config/LambdaSecretConfigProperties.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,22 @@ | ||
package gov.cabinetoffice.gap.adminbackend.config; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Data | ||
@Builder | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@Configuration("lambdaProperties") | ||
@ConfigurationProperties(prefix = "lambda") | ||
public class LambdaSecretConfigProperties { | ||
|
||
private String secret; | ||
|
||
private String privateKey; | ||
|
||
} |
52 changes: 52 additions & 0 deletions
52
src/main/java/gov/cabinetoffice/gap/adminbackend/config/LambdasInterceptor.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,52 @@ | ||
package gov.cabinetoffice.gap.adminbackend.config; | ||
|
||
import gov.cabinetoffice.gap.adminbackend.security.interceptors.AuthorizationHeaderInterceptor; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.core.Ordered; | ||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry; | ||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; | ||
|
||
@RequiredArgsConstructor | ||
@Configuration | ||
public class LambdasInterceptor implements WebMvcConfigurer { | ||
|
||
private static final String UUID_REGEX_STRING = "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}"; | ||
|
||
private final SpotlightPublisherConfigProperties spotlightPublisherConfigProperties; | ||
|
||
private final LambdaSecretConfigProperties lambdaSecretConfigProperties; | ||
|
||
@Bean(name = "spotlightPublisherLambdaInterceptor") | ||
public AuthorizationHeaderInterceptor spotlightPublisherLambdaInterceptor() { | ||
return new AuthorizationHeaderInterceptor(spotlightPublisherConfigProperties.getSecret(), | ||
spotlightPublisherConfigProperties.getPrivateKey()); | ||
} | ||
|
||
@Bean(name = "submissionExportAndScheduledPublishingLambdasInterceptor") | ||
AuthorizationHeaderInterceptor submissionExportAndScheduledPublishingLambdasInterceptor() { | ||
return new AuthorizationHeaderInterceptor(lambdaSecretConfigProperties.getSecret(), | ||
lambdaSecretConfigProperties.getPrivateKey()); | ||
} | ||
|
||
@Override | ||
public void addInterceptors(InterceptorRegistry registry) { | ||
registry.addInterceptor(spotlightPublisherLambdaInterceptor()) | ||
.addPathPatterns("/spotlight-submissions/**", "/spotlight-batch/**").order(Ordered.HIGHEST_PRECEDENCE); | ||
|
||
registry.addInterceptor(submissionExportAndScheduledPublishingLambdasInterceptor()) | ||
.addPathPatterns( | ||
"/emails/sendLambdaConfirmationEmail", "/submissions/{submissionId:" + UUID_REGEX_STRING | ||
+ "}/export-batch/{batchExportId:" + UUID_REGEX_STRING + "}/submission", | ||
"/submissions/*/export-batch/*/status", | ||
"/submissions/{submissionId:" + UUID_REGEX_STRING + "}/export-batch/{batchExportId:" | ||
+ UUID_REGEX_STRING + "}/s3-object-key", | ||
"/export-batch/{exportId:" + UUID_REGEX_STRING + "}/outstandingCount", | ||
"/grant-advert/lambda/{grantAdvertId:" + UUID_REGEX_STRING + "}/publish", | ||
"/grant-advert/lambda/{grantAdvertId:" + UUID_REGEX_STRING + "}/unpublish", | ||
"/application-forms/lambda/**") | ||
.order(Ordered.HIGHEST_PRECEDENCE); | ||
} | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,4 +17,6 @@ public class SpotlightPublisherConfigProperties { | |
|
||
private String secret; | ||
|
||
private String privateKey; | ||
|
||
} |
27 changes: 0 additions & 27 deletions
27
src/main/java/gov/cabinetoffice/gap/adminbackend/config/SpotlightPublisherInterceptor.java
This file was deleted.
Oops, something went wrong.
9 changes: 9 additions & 0 deletions
9
src/main/java/gov/cabinetoffice/gap/adminbackend/constants/SpotlightExports.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,9 @@ | ||
package gov.cabinetoffice.gap.adminbackend.constants; | ||
|
||
public class SpotlightExports { | ||
|
||
public static final String REQUIRED_CHECKS_FILENAME = "required_checks.zip"; | ||
|
||
public static final String SPOTLIGHT_CHECKS_FILENAME = "spotlight_checks.zip"; | ||
|
||
} |
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
Oops, something went wrong.