diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml
index 4cf6ece..85237fc 100644
--- a/.github/workflows/check.yml
+++ b/.github/workflows/check.yml
@@ -1,38 +1,37 @@
name: Check
on:
- push:
- branches:
- - main
- pull_request:
+ push:
+ branches:
+ - main
+ pull_request:
env:
EDGEE_API_TOKEN: ${{ secrets.EDGEE_API_TOKEN }}
jobs:
- test:
- name: test
- runs-on: ubuntu-latest
- steps:
- - name: Checkout
- uses: actions/checkout@v4
+ full-ci:
+ name: Full CI (${{ matrix.dir }})
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ dir: [consent-management, data-collection]
+ defaults:
+ run:
+ working-directory: ${{ matrix.dir }}
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
- - name: "Set up Dotnet SDK"
- run: |
- wget https://download.visualstudio.microsoft.com/download/pr/c526dc3b-5240-4449-ba07-ed9a3610fe09/442f1cf6e4e832eea0b045f9e108c8b7/dotnet-sdk-10.0.100-preview.2.25164.34-linux-x64.tar.gz
- mkdir -p $HOME/dotnet && tar zxf dotnet-sdk-10.0.100-preview.2.25164.34-linux-x64.tar.gz -C $HOME/dotnet
+ - name: "Set up Dotnet SDK"
+ run: |
+ wget https://download.visualstudio.microsoft.com/download/pr/c526dc3b-5240-4449-ba07-ed9a3610fe09/442f1cf6e4e832eea0b045f9e108c8b7/dotnet-sdk-10.0.100-preview.2.25164.34-linux-x64.tar.gz
+ mkdir -p $HOME/dotnet && tar zxf dotnet-sdk-10.0.100-preview.2.25164.34-linux-x64.tar.gz -C $HOME/dotnet
- - name: Install edgee
- uses: edgee-cloud/install-edgee-cli@v0.2.0
+ - name: Install edgee
+ uses: edgee-cloud/install-edgee-cli@v0.2.0
- - name: Build component
- run: |
- export DOTNET_ROOT=$HOME/dotnet
- export PATH=$HOME/dotnet:$PATH
- edgee component build
-
- - name: Verify .wasm file exists
- run: |
- if [ ! -f "./dc_component.wasm" ]; then
- echo "❌ Error: dc_component.wasm not found" >&2
- exit 1
- fi
+ - name: Build component
+ run: |
+ export DOTNET_ROOT=$HOME/dotnet
+ export PATH=$HOME/dotnet:$PATH
+ edgee component build
diff --git a/.gitignore b/consent-management/.gitignore
similarity index 50%
rename from .gitignore
rename to consent-management/.gitignore
index 08f5e2a..9068194 100644
--- a/.gitignore
+++ b/consent-management/.gitignore
@@ -1,4 +1,4 @@
.edgee/
bin/
obj/
-dc-component.wasm
+component.wasm
diff --git a/consent-management/Component.cs b/consent-management/Component.cs
new file mode 100644
index 0000000..f5710ca
--- /dev/null
+++ b/consent-management/Component.cs
@@ -0,0 +1,46 @@
+namespace ConsentManagementWorld.wit.exports.edgee.components.v1_0_0;
+
+public struct Settings {
+ public string Example { get; }
+
+ public Settings(List<(string, string)> settings) {
+ Example = string.Empty;
+ foreach (var setting in settings) {
+ if (setting.Item1 == "example") {
+ Example = setting.Item2;
+ }
+ }
+ }
+}
+
+public struct Cookies {
+ public string Example { get; }
+
+ public Cookies(List<(string, string)> cookies) {
+ Example = string.Empty;
+ foreach (var cookie in cookies) {
+ if (cookie.Item1 == "example") {
+ Example = cookie.Item2;
+ }
+ }
+ }
+}
+
+public class ConsentManagementImpl: IConsentManagement {
+ public static IConsentManagement.Consent? Map(List<(string, string)> cookies, List<(string, string)> settings) {
+ Settings s = new Settings(settings);
+ Cookies c = new Cookies(cookies);
+
+ if (c.Example == string.Empty) {
+ return null;
+ } else if (c.Example == "granted") {
+ return IConsentManagement.Consent.GRANTED;
+ } else if (c.Example == "denied") {
+ return IConsentManagement.Consent.DENIED;
+ } else {
+ return IConsentManagement.Consent.PENDING;
+ }
+
+ }
+}
+
diff --git a/Makefile b/consent-management/Makefile
similarity index 100%
rename from Makefile
rename to consent-management/Makefile
diff --git a/README.md b/consent-management/README.md
similarity index 100%
rename from README.md
rename to consent-management/README.md
diff --git a/consent-management/edgee-component.toml b/consent-management/edgee-component.toml
new file mode 100644
index 0000000..6ce57b0
--- /dev/null
+++ b/consent-management/edgee-component.toml
@@ -0,0 +1,20 @@
+manifest-version = 1
+
+[component]
+name = "example-cs-consent-management-component"
+version = "1.0.0"
+category = "consent-management"
+subcategory = "consent-mapping"
+description = "Example CSharp component for consent management"
+documentation = "https://github.com/edgee-cloud/example-cs-component"
+repository = "https://github.com/edgee-cloud/example-cs-component"
+language = "CSharp"
+wit-version = "1.0.0"
+
+[component.build]
+command = "dotnet build && mv ./bin/Debug/net10.0/wasi-wasm/publish/example-cs-component.wasm ./component.wasm"
+output_path = "./component.wasm"
+
+[component.settings.example]
+title = "Example Config Field"
+type = "string"
diff --git a/consent-management/example-cs-component.csproj b/consent-management/example-cs-component.csproj
new file mode 100644
index 0000000..1446b3b
--- /dev/null
+++ b/consent-management/example-cs-component.csproj
@@ -0,0 +1,26 @@
+
+
+
+