Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(deps): upgrade EDC to 0.1.2 #35

Merged
merged 10 commits into from
Jul 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/publish-test-connector-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Create and publish a Docker image

on:
push:
branches:
branches:
- main
paths:
- connector/**
Expand All @@ -11,7 +11,7 @@ on:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
CONNECTOR_TAG: 0.0.1-milestone-8
CONNECTOR_TAG: 0.1.2

jobs:
build-and-push-image:
Expand Down
43 changes: 13 additions & 30 deletions .github/workflows/pull-request-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Pull request testing

on:
push:
branches-ignore:
branches-ignore:
- main
paths:
- '.github/workflows/pull-request-testing.yml'
Expand All @@ -15,33 +15,8 @@ env:
IMAGE_NAME: ${{ github.repository }}

jobs:
dependencies:
fdionisi marked this conversation as resolved.
Show resolved Hide resolved
name: Install and cache dependencies
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v3

- name: Use Node.js 18.x
uses: actions/setup-node@v1
with:
node-version: '18.x'

- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
node_modules
*/*/node_modules
key: yarn-deps-${{ hashFiles('**/yarn.lock') }}

- name: Install dependencies
run: |
yarn

unit:
tests:
name: Unit and integration tests
needs: dependencies
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
Expand All @@ -55,21 +30,24 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Run Docker environment
uses: isbang/[email protected]
run: |
docker compose up -d
docker compose logs -f > logs &

- name: Use Node.js 18.x
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: '18.x'

- name: Cache dependencies
- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
node_modules
*/*/node_modules
key: yarn-deps-${{ hashFiles('**/yarn.lock') }}


- name: Install dependencies
run: |
yarn
Expand All @@ -78,3 +56,8 @@ jobs:
run: yarn test
env:
CI: true

- name: Print docker logs
if: failure()
run: |
cat logs
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.idea/
connector/.gradle
connector/build
coverage/
dist/
node_modules/
node_modules/
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ This project aims to increase the level of abstraction, bringing the _low-level_
developers by providing an HTTP Client which is thoroughly tested and fully type-safe.

> Similarly to the **EDC Connector**, this library is at its early stage.
> It aims to maintain compatibility with the latest version of the _Connector_, currently `v0.0.1-milestone-8`.
> It aims to maintain compatibility with the latest version of the _Connector_, currently `0.1.2`.
> The compatibility is reflected in the library's versioning.

## Usage
Expand Down Expand Up @@ -53,8 +53,8 @@ object, representing a unique connector.

const context = edcConnectorClient.createContext("123456", {
default: "https://edc.think-it.io/api",
management: "https://edc.think-it.io/api/v1/data",
protocol: "https://edc.think-it.io/api/v1/ids",
management: "https://edc.think-it.io/management",
protocol: "https://edc.think-it.io/protocol",
public: "https://edc.think-it.io/public",
control: "https://edc.think-it.io/control",
});
Expand Down Expand Up @@ -83,25 +83,25 @@ const result = await edcConnectorClient.management.createAsset(context, {
All API methods are _type, and error-safe_, which means arguments are fully typed
with [TypeScript](https://www.typescriptlang.org/), and thrown errors are always
`EdcConnectorClientError` instances. This error safety level is achieved using the
[`TypedError`](https://github.com/Think-iT-Labs/typed-error) library.
[`TypedError`](https://github.com/Think-iT-Labs/typed-error) library.

```ts

import { EdcConnectorClientError, EdcConnectorClientErrorType } from "@think-it-labs/edc-connector-client"

try {

// perform async EdcConnectorClient actions

} catch(error) {
if (error instanceof EdcConnectorClientError) {
switch (error.type) {
case EdcConnectorClientErrorType.Duplicate: {
// handle duplicate error
}

// ...

case EdcConnectorClientErrorType.Unknown:
default: {
// red alert: unknown behaviour
Expand Down
4 changes: 2 additions & 2 deletions conf/consumer-connector.config/addresses.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"name": "consumer.edc.think-it.io",
"addresses": {
"default": "http://localhost:19191/api",
"data": "http://localhost:19193/api/v1/data",
"ids": "http://consumer-connector:9194/api/v1/ids",
"management": "http://localhost:19193/management",
"protocol": "http://consumer-connector:9194/protocol",
"public": "http://localhost:19291/public",
"control": "http://localhost:19292/control"
}
Expand Down
17 changes: 13 additions & 4 deletions conf/consumer-connector.config/configuration.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
edc.ids.id=urn:connector:consumer-connector
ids.webhook.address=http://consumer-connector:9194
edc.participant.id=consumer
edc.dsp.callback.address=http://consumer-connector:9194/protocol

web.http.port=9191
web.http.path=/api
Expand All @@ -8,10 +8,10 @@ web.http.control.port=9192
web.http.control.path=/control

web.http.management.port=9193
web.http.management.path=/api/v1/data
web.http.management.path=/management

web.http.protocol.port=9194
web.http.protocol.path=/api/v1/ids
web.http.protocol.path=/protocol

edc.api.control.auth.apikey.value=123456

Expand All @@ -29,3 +29,12 @@ web.http.public.port=9291
web.http.public.path=/public

edc.dataplane.token.validation.endpoint=http://consumer-connector:9192/control/token

edc.negotiation.consumer.send.retry.limit=1
edc.negotiation.consumer.send.retry.base-delay.ms=10
edc.negotiation.provider.send.retry.limit=1
edc.negotiation.provider.send.retry.base-delay.ms=10
edc.negotiation.state-machine.iteration-wait-millis=100
edc.transfer.send.retry.limit=1
edc.transfer.send.retry.base-delay.ms=10
edc.transfer.state-machine.iteration-wait-millis=10
4 changes: 2 additions & 2 deletions conf/provider-connector.config/addresses.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"name": "provider.edc.think-it.io",
"addresses": {
"default": "http://localhost:29191/api",
"data": "http://localhost:29193/api/v1/data",
"ids": "http://provider-connector:9194/api/v1/ids",
"management": "http://localhost:29193/management",
"protocol": "http://provider-connector:9194/protocol",
"public": "http://localhost:29291/public",
"control": "http://localhost:29292/control"
}
Expand Down
17 changes: 13 additions & 4 deletions conf/provider-connector.config/configuration.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
edc.ids.id=urn:connector:provider-connector
ids.webhook.address=http://provider-connector:9194
edc.participant.id=provider
edc.dsp.callback.address=http://provider-connector:9194/protocol

web.http.port=9191
web.http.path=/api
Expand All @@ -8,10 +8,10 @@ web.http.control.port=9192
web.http.control.path=/control

web.http.management.port=9193
web.http.management.path=/api/v1/data
web.http.management.path=/management

web.http.protocol.port=9194
web.http.protocol.path=/api/v1/ids
web.http.protocol.path=/protocol

edc.api.control.auth.apikey.value=123456

Expand All @@ -29,3 +29,12 @@ web.http.public.port=9291
web.http.public.path=/public

edc.dataplane.token.validation.endpoint=http://provider-connector:9192/control/token

edc.negotiation.consumer.send.retry.limit=1
edc.negotiation.consumer.send.retry.base-delay.ms=10
edc.negotiation.provider.send.retry.limit=1
edc.negotiation.provider.send.retry.base-delay.ms=10
edc.negotiation.state-machine.iteration-wait-millis=100
edc.transfer.send.retry.limit=1
edc.transfer.send.retry.base-delay.ms=10
edc.transfer.state-machine.iteration-wait-millis=10
11 changes: 3 additions & 8 deletions connector/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,15 @@ plugins {

repositories {
mavenCentral()
maven {
url = uri("https://oss.sonatype.org/content/repositories/snapshots/")
}
maven {
url = uri("https://maven.iais.fraunhofer.de/artifactory/eis-ids-public/")
}
}

val edcGroupId = "org.eclipse.edc"
val edcVersion = "0.0.1-milestone-8"
val edcVersion = "0.1.2"

dependencies {
implementation("${edcGroupId}:runtime-metamodel:${edcVersion}")
implementation("${edcGroupId}:control-plane-core:${edcVersion}")
implementation("${edcGroupId}:ids:${edcVersion}")
implementation("${edcGroupId}:dsp:${edcVersion}")
implementation("${edcGroupId}:configuration-filesystem:${edcVersion}")
implementation("${edcGroupId}:vault-filesystem:${edcVersion}")
implementation("${edcGroupId}:iam-mock:${edcVersion}")
Expand Down
Binary file modified connector/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion connector/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
6 changes: 6 additions & 0 deletions connector/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,12 @@ set -- \
org.gradle.wrapper.GradleWrapperMain \
"$@"

# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi

# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
Expand Down
14 changes: 8 additions & 6 deletions connector/gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@rem limitations under the License.
@rem

@if "%DEBUG%" == "" @echo off
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
Expand All @@ -25,7 +25,7 @@
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
if "%DIRNAME%"=="" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

Expand All @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Expand Down Expand Up @@ -75,13 +75,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
if %ERRORLEVEL% equ 0 goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%

:mainEnd
if "%OS%"=="Windows_NT" endlocal
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "3.9"

services:
consumer-connector:
image: ghcr.io/think-it-labs/edc-connector-client/test-connector:0.0.1-milestone-8
build: connector
fdionisi marked this conversation as resolved.
Show resolved Hide resolved
platform: ${DOCKER_PLATFORM:-linux/amd64}
ports:
- "19191:9191" # connector default
Expand All @@ -21,7 +21,7 @@ services:
- "host.docker.internal:host-gateway"

provider-connector:
image: ghcr.io/think-it-labs/edc-connector-client/test-connector:0.0.1-milestone-8
build: connector
fdionisi marked this conversation as resolved.
Show resolved Hide resolved
platform: ${DOCKER_PLATFORM:-linux/amd64}
ports:
- "29191:9191" # connector default
Expand Down
1 change: 1 addition & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ export default <Config.InitialOptions> {
},
testRegex: "(/__tests__/.*|(\\.|/)(test))\\.(tsx?)$",
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
testTimeout: 30000,
fdionisi marked this conversation as resolved.
Show resolved Hide resolved
};
8 changes: 5 additions & 3 deletions package.json
ndr-brt marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "@think-it-labs/edc-connector-client",
"version": "0.0.1-milestone-8.beta-5",
"version": "0.1.2",
"description": "EDC Connector HTTP client",
"private": false,
"main": "dist/src/index.js",
"typings": "dist/src/index.d.ts",
"scripts": {
"transpile": "tsc",
"test": "jest"
"test": "jest --forceExit"
},
"engines": {
"node": ">=18"
Expand All @@ -19,11 +19,13 @@
],
"license": "MIT",
"dependencies": {
"@think-it-labs/typed-error": "^0.1.4"
"@think-it-labs/typed-error": "^0.1.4",
"jsonld": "^8.2.0"
},
"devDependencies": {
"@commitlint/config-conventional": "^17.1.0",
"@types/jest": "^28.1.6",
"@types/jsonld": "^1.5.8",
"@types/node": "^18.11.9",
"commitlint": "^17.1.2",
"husky": "^8.0.1",
Expand Down
Loading