Skip to content

Commit

Permalink
Merge pull request #450 from bci-oss/bugfix/edc-extension-param-defin…
Browse files Browse the repository at this point in the history
…ition

bugfix mixlower and uppercase for param definitions
  • Loading branch information
tunacicek authored Jul 23, 2024
2 parents cbe8e74 + ae1b817 commit eb0f9db
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
6 changes: 6 additions & 0 deletions libraries/edc-extension/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 0.1.1
### Added

## fixed
- Fix config-parameter definition to not mix uppercase and lowercase like (baseUrl -> base.url)

## 0.1.0
### Added
- Update edc-extension to edc version 0.7.0
Expand Down
14 changes: 8 additions & 6 deletions libraries/edc-extension/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ The following table outlines the configuration settings for the `DTR Data Plane
## Compatibility

| dtr-edc Extension library version | Digital Twin Registry image version | EDC version |
|-------------------------------|-------------------------------------|-------------|
| `0.1.0` | `> 0.4.2` | `0.7.X` |
|-----------------------------------|-------------------------------------|-------------|
| `0.1.0` | `> 0.4.2` | `0.7.3` |
| `0.1.1` | `> 0.4.2` | `0.7.3` |


## Using the DTR-EDC Access Control Extension

Expand Down Expand Up @@ -82,15 +84,15 @@ tractusx-connector:
...
env:
EDC_GRANULAR_ACCESS_VERIFICATION_ERROR_ENDPOINT_PORT: 9054
EDC_GRANULAR_ACCESS_VERIFICATION_EDC_DATA_PLANE_BASEURL: http://local-edc-data-plane:9051/public/v2/
EDC_GRANULAR_ACCESS_VERIFICATION_EDC_DATA_PLANE_BASE_URL: http://local-edc-data-plane:9051
EDC_GRANULAR_ACCESS_VERIFICATION_DTR_NAMES: default
EDC_GRANULAR_ACCESS_VERIFICATION_DTR_CONFIG_DEFAULT_DTR_DECISION_CACHE_DURATION_MINUTES: 1
EDC_GRANULAR_ACCESS_VERIFICATION_DTR_CONFIG_DEFAULT_DTR_ACCESS_VERIFICATION_ENDPOINT_URL: http://baseurl-dtr/v2/api/v3/submodel-descriptor/authorized
EDC_GRANULAR_ACCESS_VERIFICATION_DTR_CONFIG_DEFAULT_ASPECT_MODEL_URL_PATTERN: http:\/\/baseurl-submodelserver\/pcf\/.*
EDC_GRANULAR_ACCESS_VERIFICATION_DTR_CONFIG_DEFAULT_OAUTH2_TOKEN_ENDPOINT_URL: http://baseurl-keycloak/iam/access-management/v1/tenants/00000000-0000-0000-0000-000000000000/openid-connect/token
EDC_GRANULAR_ACCESS_VERIFICATION_DTR_CONFIG_DEFAULT_OAUTH2_TOKEN_SCOPE: aud:local-edc-dtr
EDC_GRANULAR_ACCESS_VERIFICATION_DTR_CONFIG_DEFAULT_OAUTH2_TOKEN_CLIENTID: dtr_client
EDC_GRANULAR_ACCESS_VERIFICATION_DTR_CONFIG_DEFAULT_OAUTH2_TOKEN_CLIENTSECRET_PATH: dtrsecret
EDC_GRANULAR_ACCESS_VERIFICATION_DTR_CONFIG_DEFAULT_OAUTH2_TOKEN_SCOPE: openid
EDC_GRANULAR_ACCESS_VERIFICATION_DTR_CONFIG_DEFAULT_OAUTH2_TOKEN_CLIENT_ID: dtr_client
EDC_GRANULAR_ACCESS_VERIFICATION_DTR_CONFIG_DEFAULT_OAUTH2_TOKEN_CLIENT_SECRET_PATH: dtrsecret
...
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
public class DtrDataPlaneAccessControlConfigExtension implements ServiceExtension {

@Setting( value = "Contains the base URL of the EDC data plane endpoint where the data plane requests are sent by the end users." )
public static final String EDC_DATA_PLANE_BASE_URL = "edc.granular.access.verification.edc.data.plane.baseUrl";
public static final String EDC_DATA_PLANE_BASE_URL = "edc.granular.access.verification.edc.data.plane.base.url";
@Setting( value = "Comma separated list of DTR configuration names used as keys for DTR clients." )
public static final String EDC_DTR_CONFIG_NAMES = "edc.granular.access.verification.dtr.names";
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,12 @@ public boolean shouldAllowAccess(
}

private boolean callDtr( final RequestKey requestKey ) {
monitor.debug( "Check submodel-server access. DTR calling with requested URL: " + requestKey.requestedUrl() + " and BPN: " +requestKey.bpn() );
final Request dtrRequest = getDtrRequest( requestKey );
try ( Response response = httpClient.execute( dtrRequest ) ) {
return response.isSuccessful();
} catch ( final IOException exception ) {
monitor.debug( "Failed to execute DTR access with requested URL: " + requestKey.requestedUrl() + " and BPN: " +requestKey.bpn() );
monitor.severe( "Failed to execute DTR access verification request.", exception );
throw new AccessControlServiceException( exception );
}
Expand Down

0 comments on commit eb0f9db

Please sign in to comment.