-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Lars Geyer-Blaumeiser <[email protected]>
- Loading branch information
1 parent
358f320
commit be601aa
Showing
14 changed files
with
148 additions
and
32 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
...pse/tractusx/bdrs/api/directory/authentication/ApiAuthenticationProviderRegistryImpl.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,36 @@ | ||
/* | ||
* Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) | ||
* Copyright (c) 2025 Cofinity-X GmbH | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Apache License, Version 2.0 which is available at | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Contributors: | ||
* Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation | ||
* Cofinity-X GmbH | ||
* | ||
*/ | ||
package org.eclipse.tractusx.bdrs.api.directory.authentication; | ||
|
||
import org.eclipse.edc.api.auth.spi.ApiAuthenticationProvider; | ||
import org.eclipse.edc.api.auth.spi.registry.ApiAuthenticationProviderRegistry; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
public class ApiAuthenticationProviderRegistryImpl implements ApiAuthenticationProviderRegistry { | ||
private final Map<String, ApiAuthenticationProvider> providers = new HashMap<>(); | ||
|
||
@Override | ||
public void register(String type, ApiAuthenticationProvider provider) { | ||
providers.put(type, provider); | ||
} | ||
|
||
@Override | ||
public ApiAuthenticationProvider resolve(String type) { | ||
return providers.get(type); | ||
} | ||
} |
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
35 changes: 35 additions & 0 deletions
35
...main/java/org/eclipse/tractusx/bdrs/api/directory/authentication/HttpClientExtension.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,35 @@ | ||
/* | ||
* Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) | ||
* Copyright (c) 2025 Cofinity-X GmbH | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Apache License, Version 2.0 which is available at | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Contributors: | ||
* Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation | ||
* Cofinity-X GmbH | ||
* | ||
*/ | ||
package org.eclipse.tractusx.bdrs.api.directory.authentication; | ||
|
||
import dev.failsafe.RetryPolicy; | ||
import okhttp3.OkHttpClient; | ||
import org.eclipse.edc.http.client.EdcHttpClientImpl; | ||
import org.eclipse.edc.http.spi.EdcHttpClient; | ||
import org.eclipse.edc.runtime.metamodel.annotation.Extension; | ||
import org.eclipse.edc.runtime.metamodel.annotation.Provider; | ||
import org.eclipse.edc.spi.system.ServiceExtension; | ||
import org.eclipse.edc.spi.system.ServiceExtensionContext; | ||
|
||
@Extension("HTTP Client Extension") | ||
public class HttpClientExtension implements ServiceExtension { | ||
public static final String MONITOR_PREFIX = "Presentation Transformation"; | ||
|
||
@Provider | ||
public EdcHttpClient httpClient(ServiceExtensionContext context) { | ||
return new EdcHttpClientImpl(new OkHttpClient(), RetryPolicy.ofDefaults(), context.getMonitor().withPrefix(MONITOR_PREFIX)); | ||
} | ||
} |
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
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
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.