Skip to content

Commit

Permalink
fix api context
Browse files Browse the repository at this point in the history
  • Loading branch information
ndr-brt committed Jan 13, 2025
1 parent ff9df21 commit 0d5aa2d
Showing 1 changed file with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,18 @@
*/
@Extension(value = DataPlaneProxyConsumerApiExtension.NAME)
public class DataPlaneProxyConsumerApiExtension implements ServiceExtension {
public static final int DEFAULT_THREAD_POOL = 10;

public static final String NAME = "Data Plane Proxy Consumer API";
private static final String PROXY = "proxy";
private static final int DEFAULT_PROXY_PORT = 8186;
private static final String DEFAULT_PROXY_PATH = "/proxy";
private static final int DEFAULT_THREAD_POOL = 10;

@Setting("Vault alias for the Consumer Proxy API key")
public static final String AUTH_SETTING_CONSUMER_PROXY_APIKEY_ALIAS = "tx.edc.dpf.consumer.proxy.auth.apikey.alias";
@Setting("API key for the Consumer Proxy API")
public static final String AUTH_SETTING_CONSUMER_PROXY_APIKEY = "tx.edc.dpf.consumer.proxy.auth.apikey";
static final String NAME = "Data Plane Proxy Consumer API";
private static final int DEFAULT_PROXY_PORT = 8186;
private static final String CONSUMER_API_ALIAS = "consumer.api";
private static final String DEFAULT_PROXY_PATH = "/proxy";
private static final String PROXY = "proxy";
private static final String CONSUMER_CONFIG_KEY = "web.http.proxy";

@Setting(value = "Data plane proxy API consumer port", type = "int")
private static final String CONSUMER_PORT = "tx.edc.dpf.consumer.proxy.port";
@Deprecated(since = "0.7.1")
Expand Down Expand Up @@ -93,7 +94,6 @@ public class DataPlaneProxyConsumerApiExtension implements ServiceExtension {
@Inject
private PortMappingRegistry portMappingRegistry;


private ExecutorService executorService;

@Override
Expand All @@ -112,13 +112,13 @@ public void initialize(ServiceExtensionContext context) {
executorService = newFixedThreadPool(poolSize);

var authenticationService = createAuthenticationService(context);
apiAuthenticationRegistry.register(CONSUMER_API_ALIAS, authenticationService);
apiAuthenticationRegistry.register(PROXY, authenticationService);

var authenticationFilter = new AuthenticationRequestFilter(apiAuthenticationRegistry, CONSUMER_API_ALIAS);
webService.registerResource(CONSUMER_API_ALIAS, authenticationFilter);
var authenticationFilter = new AuthenticationRequestFilter(apiAuthenticationRegistry, PROXY);
webService.registerResource(PROXY, authenticationFilter);

webService.registerResource(CONSUMER_API_ALIAS, new ClientErrorExceptionMapper());
webService.registerResource(CONSUMER_API_ALIAS, new ConsumerAssetRequestController(edrService, pipelineService, executorService, monitor));
webService.registerResource(PROXY, new ClientErrorExceptionMapper());
webService.registerResource(PROXY, new ConsumerAssetRequestController(edrService, pipelineService, executorService, monitor));
}

@Override
Expand Down

0 comments on commit 0d5aa2d

Please sign in to comment.