-
Notifications
You must be signed in to change notification settings - Fork 0
Consent management component #14
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
5bfadd7
move data-collection to its own folder
CLEMENTINATOR 15c71f2
consent-mapping: initial import
CLEMENTINATOR 1f5200c
check.yml: test full CI
CLEMENTINATOR 2ba8959
fixup! move data-collection to its own folder
CLEMENTINATOR af7870a
fixup! consent-mapping: initial import
CLEMENTINATOR 8fceed3
fixup! consent-mapping: initial import
CLEMENTINATOR 4016a29
fixup! move data-collection to its own folder
CLEMENTINATOR 7b60019
fixup! check.yml: test full CI
CLEMENTINATOR 22d7833
fix
CLEMENTINATOR 6b98237
update gitiginre and component file naming
CLEMENTINATOR File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
---|---|---|
@@ -1,43 +1,40 @@ | ||
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 | ||
|
||
- name: Install uv | ||
uses: astral-sh/setup-uv@v5 | ||
|
||
- name: "Set up Python" | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version-file: "pyproject.toml" | ||
|
||
- name: Install edgee | ||
uses: edgee-cloud/[email protected] | ||
|
||
- name: Build component | ||
run: | | ||
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: Test component | ||
run: | | ||
make test | ||
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: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install uv | ||
uses: astral-sh/setup-uv@v5 | ||
|
||
- name: "Set up Python" | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version-file: "${{ matrix.dir }}/pyproject.toml" | ||
|
||
- name: Install Edgee CLI | ||
uses: edgee-cloud/[email protected] | ||
|
||
- name: Run edgee component wit | ||
run: edgee component wit | ||
|
||
- name: Build component | ||
run: | | ||
edgee component build |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# deps | ||
.edgee/ | ||
# build output | ||
dc_component.wasm | ||
component.wasm | ||
# world binding | ||
edgee_world/ | ||
# python | ||
|
File renamed without changes.
This file contains hidden or 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,23 @@ | ||
import edgee_world.consent_management.exports as exports | ||
import edgee_world.consent_management.exports.consent_management as consent_management | ||
|
||
from edgee_world.consent_management.types import * | ||
|
||
class ConsentManagement(exports.ConsentManagement): | ||
def map(self, cookies: List[Tuple[str, str]], settings: List[Tuple[str, str]]) -> Optional[consent_management.Consent]: | ||
cookies_dict = dict(cookies) | ||
settings_dict = dict(settings) | ||
|
||
key = cookies_dict.get("key") | ||
if key is None: | ||
return None | ||
|
||
if key == "granted": | ||
return consent_management.Consent.GRANTED | ||
elif key == "denied": | ||
return consent_management.Consent.DENIED | ||
else: | ||
return consent_management.Consent.PENDING | ||
|
||
|
||
raise NotImplementedError |
This file contains hidden or 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,21 @@ | ||
manifest-version = 1 | ||
|
||
[component] | ||
name = "example-py-consent-management-component" | ||
version = "1.0.0" | ||
category = "consent-management" | ||
subcategory = "consent-mapping" | ||
description = "Example Python component for consent management" | ||
documentation = "https://github.com/edgee-cloud/example-py-component" | ||
repository = "https://github.com/edgee-cloud/example-py-component" | ||
language = "Python" | ||
wit-version = "1.0.0" | ||
|
||
[component.build] | ||
command = "uv sync && rm -rf edgee_world && uv run componentize-py --wit-path .edgee/wit/ bindings edgee_world && uv run componentize-py --wit-path .edgee/wit/ --world consent-management componentize component -o component.wasm" | ||
output_path = "./component.wasm" | ||
|
||
[component.settings.example] | ||
title = "Example Config Field" | ||
type = "string" | ||
|
File renamed without changes.
File renamed without changes.
This file contains hidden or 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,8 @@ | ||
# deps | ||
.edgee/ | ||
# build output | ||
component.wasm | ||
# world binding | ||
edgee_world/ | ||
# python | ||
__pycache__/ |
This file contains hidden or 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,29 @@ | ||
<div align="center"> | ||
<p align="center"> | ||
<a href="https://www.edgee.cloud"> | ||
<picture> | ||
<source media="(prefers-color-scheme: dark)" srcset="https://cdn.edgee.cloud/img/component-dark.svg"> | ||
<img src="https://cdn.edgee.cloud/img/component.svg" height="100" alt="Edgee"> | ||
</picture> | ||
</a> | ||
</p> | ||
</div> | ||
|
||
<h1 align="center">Example python component for Edgee</h1> | ||
|
||
This is an example of a Python Edgee Component. | ||
|
||
## Setup | ||
Requirements: | ||
- [edgee-cli](https://github.com/edgee-cloud/edgee) | ||
- Python3 | ||
- uv | ||
|
||
```shell | ||
$ make setup | ||
``` | ||
## Building | ||
|
||
```shell | ||
$ make build | ||
``` |
File renamed without changes.
File renamed without changes.
This file contains hidden or 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 hidden or 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,12 @@ | ||
[project] | ||
name = "example-py-component" | ||
version = "0.1.0" | ||
description = "Edgee python3 example for implementation of a data collection component" | ||
readme = "README.md" | ||
requires-python = ">=3.12" | ||
dependencies = [] | ||
|
||
[dependency-groups] | ||
dev = [ | ||
"componentize-py>=0.16.0", | ||
] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.