Skip to content

Commit 4ce4ee5

Browse files
committed
feat: Eclipse EDC 0.7.2 migration (WIP)
1 parent 7bd3648 commit 4ce4ee5

23 files changed

+141
-373
lines changed

.env.local-dev

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ EDC_UI_ACTIVE_PROFILE=sovity-open-source
55
EDC_UI_USE_FAKE_BACKEND=true
66
EDC_UI_MANAGEMENT_API_URL=http://edc.fake-backend
77
EDC_UI_MANAGEMENT_API_KEY=no-api-key-required-in-local-dev
8-
EDC_UI_CATALOG_URLS=http://existing-other-connector/api/dsp,http://does-not-exist-but-is-super-long-so-we-can-test/api/dsp, http://how-wrapping-works-in-subtext-of-catalog-url-select/api/dsp
8+
EDC_UI_CATALOG_URLS="https://existing-other-connector/api/dsp?participantId=MDSL1234XX.C1234XX, https://does-not-exist-but-is-super-long-so-we-can-test/api/dsp?participantId=MDSL1234XX.C1235XX, https://how-wrapping-works-in-subtext-of-catalog-url-select/api/dsp?participantId=MDSL1234XX.C1237XX"
99
EDC_UI_LOGOUT_URL=https://example.com/logout
1010
EDC_UI_CONNECTOR_ENDPOINT=http://localhost:3000/api/dsp
1111
EDC_UI_MANAGEMENT_API_URL_SHOWN_IN_DASHBOARD=http://localhost:3000/api/control/management

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"@ngx-translate/core": "^14.0.0",
3131
"@ngx-translate/http-loader": "^7.0.0",
3232
"@ngxs/store": "^3.8.1",
33-
"@sovity.de/edc-client": "10.4.0",
33+
"@sovity.de/edc-client": "0.0.1-20241025-2408-alpha1",
3434
"clean-deep": "^3.4.0",
3535
"date-fns": "^2.30.0",
3636
"date-fns-tz": "^2.0.1",

src/app/core/services/api/edc-api.service.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,13 @@ export class EdcApiService {
140140

141141
getCatalogPageDataOffers(
142142
connectorEndpoint: string,
143+
participantId: string,
143144
): Observable<UiDataOffer[]> {
144145
return toObservable(() =>
145-
this.edcClient.uiApi.getCatalogPageDataOffers({connectorEndpoint}),
146+
this.edcClient.uiApi.getCatalogPageDataOffers({
147+
connectorEndpoint,
148+
participantId,
149+
}),
146150
);
147151
}
148152

src/app/core/services/api/fake-backend/connector-fake-impl/catalog-fake-service.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {TestPolicies} from './data/test-policies';
44

55
let dataOffers: UiDataOffer[] = [
66
{
7-
endpoint: 'http://existing-other-connector/api/dsp',
7+
endpoint: 'https://existing-other-connector/api/dsp',
88
participantId: 'MDSL1234XX.C1234XX',
99
asset: TestAssets.full,
1010
contractOffers: [
@@ -21,7 +21,7 @@ let dataOffers: UiDataOffer[] = [
2121
],
2222
},
2323
{
24-
endpoint: 'http://existing-other-connector/api/dsp',
24+
endpoint: 'https://existing-other-connector/api/dsp',
2525
participantId: 'MDSL1234XX.C1234XX',
2626
asset: TestAssets.onRequestAsset,
2727
contractOffers: [
@@ -32,7 +32,7 @@ let dataOffers: UiDataOffer[] = [
3232
],
3333
},
3434
{
35-
endpoint: 'http://existing-other-connector/api/dsp',
35+
endpoint: 'https://existing-other-connector/api/dsp',
3636
asset: TestAssets.boring,
3737
participantId: 'MDSL1234XX.C1234XX',
3838
contractOffers: [
@@ -43,7 +43,7 @@ let dataOffers: UiDataOffer[] = [
4343
],
4444
},
4545
{
46-
endpoint: 'http://existing-other-connector/api/dsp',
46+
endpoint: 'https://existing-other-connector/api/dsp',
4747
asset: TestAssets.short,
4848
participantId: 'MDSL1234XX.C1234XX',
4949
contractOffers: [

src/app/core/services/api/fake-backend/connector-fake-impl/contract-negotiation-fake-service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export const initiateContractNegotiation = (
6363
direction: 'CONSUMING',
6464
counterPartyAddress: request.counterPartyAddress,
6565
transferProcesses: [],
66-
counterPartyId: request.counterPartyParticipantId,
66+
counterPartyId: request.counterPartyId,
6767
asset: getAssetById(request.assetId)!,
6868
contractSigningDate: new Date(),
6969
contractPolicy: getPolicyDefinitionByJsonLd(request.policyJsonLd)!,

src/app/core/services/api/fake-backend/connector-fake-impl/dashboard-fake-service.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,12 @@ export const dashboardPage = (): DashboardPage => ({
2626
connectorCuratorName: 'Example GmbH',
2727
connectorCuratorUrl: 'https://example.com',
2828
connectorEndpoint: 'https://edc.fake-backend/api/dsp',
29-
connectorMiwConfig: {
30-
url: 'https://miw.fake-backend',
31-
tokenUrl: 'https://miw.fake-backend/token',
32-
authorityId: 'fake-miw',
29+
connectorCxDidConfig: {
30+
myDid: 'your-did-long-number:1234567890:idk',
31+
bdrsUrl: 'https://bdrs.fake-backend',
32+
dimUrl: 'https://dim.fake-backend',
33+
trustedVcIssuer: 'https://trusted-vc-issuer.fake-backend',
34+
walletTokenUrl: 'https://wallet-token.fake-backend',
3335
},
3436
connectorDapsConfig: {
3537
tokenUrl: 'https://daps.fake-backend/token',
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import {Injectable} from '@angular/core';
2+
3+
@Injectable({providedIn: 'root'})
4+
export class ConnectorEndpointUrlMapper {
5+
/**
6+
* Builds strings like "https://my-connector.com/api/dsp, participantId=CXL-1234567890".
7+
*
8+
* Connectors now require both the connector endpoint and the participant ID for catalog requests, but we
9+
* still want to be able to offer the "copy + paste" User Experience
10+
*/
11+
separator = '?participantId=';
12+
13+
mergeConnectorEndpointAndParticipantId(
14+
connectorEndpoint: string,
15+
participantId: string,
16+
): string {
17+
return `${connectorEndpoint}${this.separator}${participantId}`;
18+
}
19+
20+
extractConnectorEndpointAndParticipantId(combined: string): {
21+
connectorEndpoint: string;
22+
participantId: string;
23+
} {
24+
const parts = combined.split(this.separator);
25+
if (parts.length !== 2) {
26+
return {connectorEndpoint: combined, participantId: ''};
27+
}
28+
29+
return {connectorEndpoint: parts[0], participantId: parts[1]};
30+
}
31+
}

src/app/core/services/connector-info-property-grid-group-builder.ts

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -214,25 +214,39 @@ export class ConnectorInfoPropertyGridGroupBuilder {
214214
);
215215
}
216216

217-
if (data.connectorMiwConfig != null) {
217+
if (data.connectorCxDidConfig != null) {
218218
fields.push(
219219
{
220220
icon: 'category',
221-
label: 'MIW Authority ID',
221+
label: 'Your DID',
222+
...this.propertyGridUtils.guessValue(data.connectorCxDidConfig.myDid),
223+
},
224+
{
225+
icon: 'vpn_key',
226+
label: 'Wallet Token URL',
227+
...this.propertyGridUtils.guessValue(
228+
data.connectorCxDidConfig.walletTokenUrl,
229+
),
230+
},
231+
{
232+
icon: 'category',
233+
label: 'Trusted VC Issuer',
222234
...this.propertyGridUtils.guessValue(
223-
data.connectorMiwConfig.authorityId,
235+
data.connectorCxDidConfig.trustedVcIssuer,
224236
),
225237
},
226238
{
227239
icon: 'link',
228-
label: 'MIW URL',
229-
...this.propertyGridUtils.guessValue(data.connectorMiwConfig.url),
240+
label: 'BDRS URL',
241+
...this.propertyGridUtils.guessValue(
242+
data.connectorCxDidConfig.bdrsUrl,
243+
),
230244
},
231245
{
232-
icon: 'vpn_key',
233-
label: 'MIW Token URL',
246+
icon: 'link',
247+
label: 'DIM URL',
234248
...this.propertyGridUtils.guessValue(
235-
data.connectorMiwConfig.tokenUrl,
249+
data.connectorCxDidConfig.dimUrl,
236250
),
237251
},
238252
);

src/app/core/services/contract-negotiation.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export class ContractNegotiationService {
5858
negotiate(dataOffer: DataOffer, contractOffer: UiContractOffer) {
5959
const contractOfferId = contractOffer.contractOfferId;
6060
const initiateRequest: ContractNegotiationRequest = {
61-
counterPartyParticipantId: dataOffer.participantId,
61+
counterPartyId: dataOffer.participantId,
6262
counterPartyAddress: dataOffer.endpoint!,
6363
assetId: dataOffer.asset.assetId,
6464
contractOfferId,

0 commit comments

Comments
 (0)