|
10 | 10 | * |
11 | 11 | * SPDX-License-Identifier: EPL-2.0 |
12 | 12 | *****************************************************************************/ |
13 | | -package org.eclipse.openvsx.featureflag; |
| 13 | +package org.eclipse.openvsx.settings; |
14 | 14 |
|
15 | 15 | import org.aspectj.lang.ProceedingJoinPoint; |
16 | 16 | import org.aspectj.lang.annotation.Around; |
|
23 | 23 | @Component |
24 | 24 | public class ReadOnlyEndpointAspect { |
25 | 25 |
|
26 | | - private final FeatureFlagService featureFlagService; |
| 26 | + private final SettingsService settingsService; |
27 | 27 |
|
28 | | - public ReadOnlyEndpointAspect(FeatureFlagService featureFlagService) { |
29 | | - this.featureFlagService = featureFlagService; |
| 28 | + public ReadOnlyEndpointAspect(SettingsService settingsService) { |
| 29 | + this.settingsService = settingsService; |
30 | 30 | } |
31 | 31 |
|
32 | 32 | @Around("(execution(org.springframework.http.ResponseEntity org.eclipse.openvsx.RegistryAPI.*(..)) ||" + |
33 | | - " execution(org.springframework.http.ResponseEntity org.eclipse.openvsx.admin.AdminAPI.*(..)) ||" + |
34 | | - " execution(org.springframework.http.ResponseEntity org.eclipse.openvsx.admin.FileDecisionAPI.*(..)) ||" + |
35 | | - " execution(org.springframework.http.ResponseEntity org.eclipse.openvsx.admin.RateLimitAPI.*(..)) ||" + |
36 | | - " execution(org.springframework.http.ResponseEntity org.eclipse.openvsx.admin.ScanAPI.*(..)) ||" + |
37 | | - " execution(org.springframework.http.ResponseEntity org.eclipse.openvsx.UserAPI.*(..))) &&" + |
38 | | - "@annotation(MutatingOperation)") |
| 33 | + " execution(org.springframework.http.ResponseEntity org.eclipse.openvsx.UserAPI.*(..)) ||" + |
| 34 | + " execution(org.springframework.http.ResponseEntity org.eclipse.openvsx.admin.*API.*(..))) && @annotation(MutatingOperation)") |
39 | 35 | public Object handleMutatingEndpoint(ProceedingJoinPoint joinPoint) throws Throwable { |
40 | | - if (featureFlagService.isRegistryReadOnly()) { |
| 36 | + if (settingsService.isRegistryReadOnly()) { |
41 | 37 | return ResponseEntity.status(409).body(ResultJson.error("Registry is in read-only mode.")); |
42 | 38 | } else { |
43 | 39 | return joinPoint.proceed(); |
|
0 commit comments