File tree Expand file tree Collapse file tree 3 files changed +31
-0
lines changed
main/java/uk/gov/companieshouse/pscdataapi/config
test/java/uk/gov/companieshouse/pscdataapi/controller Expand file tree Collapse file tree 3 files changed +31
-0
lines changed Original file line number Diff line number Diff line change 2727 <!-- Internal -->
2828 <structured-logging .version>1.9.12</structured-logging .version>
2929 <private-api-sdk-java .version>2.0.247</private-api-sdk-java .version>
30+ <api-security-java .version>0.4.1</api-security-java .version>
3031 <api-sdk-manager-java-library .version>1.0.4</api-sdk-manager-java-library .version>
3132 <api-helper-java-library .version>1.4.5</api-helper-java-library .version>
3233
120121 <artifactId >junit-jupiter</artifactId >
121122 <scope >test</scope >
122123 </dependency >
124+
125+ <dependency >
126+ <groupId >uk.gov.companieshouse</groupId >
127+ <artifactId >api-security-java</artifactId >
128+ <version >${api-security-java.version} </version >
129+ </dependency >
123130 </dependencies >
124131
125132 <build >
Original file line number Diff line number Diff line change 1+ package uk .gov .companieshouse .pscdataapi .config ;
2+
3+ import org .springframework .context .annotation .Bean ;
4+ import org .springframework .context .annotation .Configuration ;
5+ import org .springframework .web .servlet .config .annotation .InterceptorRegistry ;
6+ import org .springframework .web .servlet .config .annotation .WebMvcConfigurer ;
7+ import uk .gov .companieshouse .api .interceptor .InternalUserInterceptor ;
8+
9+ @ Configuration
10+ public class WebSecurityConfig implements WebMvcConfigurer {
11+
12+ @ Override
13+ public void addInterceptors (InterceptorRegistry registry ) {
14+ registry .addInterceptor (internalUserInterceptor ());
15+ }
16+
17+ @ Bean
18+ public InternalUserInterceptor internalUserInterceptor () {
19+ return new InternalUserInterceptor ();
20+ }
21+ }
Original file line number Diff line number Diff line change @@ -46,6 +46,9 @@ void callPutRequest() throws Exception {
4646 mockMvc .perform (put (PUT_URL )
4747 .contentType (APPLICATION_JSON )
4848 .header ("x-request-id" , X_REQUEST_ID )
49+ .header ("ERIC-Identity" , "test" )
50+ .header ("ERIC-Identity-Type" , "key" )
51+ .header ("ERIC-Authorised-Key-Roles" , "*" )
4952 .content (TestHelper .createJsonPayload ()))
5053 .andExpect (status ().isCreated ());
5154 }
You can’t perform that action at this time.
0 commit comments