From f2be3d4b3867b27c4365c05be6a7c339a6f61520 Mon Sep 17 00:00:00 2001 From: Mourits de Beer <31511766+ff137@users.noreply.github.com> Date: Wed, 28 Feb 2024 20:39:53 +0200 Subject: [PATCH 1/6] :sparkles: add origin and timestamp to event metadata (#46) Signed-off-by: ff137 --- .../v1_0/redis_queue/events/__init__.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/redis_events/redis_events/v1_0/redis_queue/events/__init__.py b/redis_events/redis_events/v1_0/redis_queue/events/__init__.py index 10cf2892a..86960d312 100755 --- a/redis_events/redis_events/v1_0/redis_queue/events/__init__.py +++ b/redis_events/redis_events/v1_0/redis_queue/events/__init__.py @@ -4,6 +4,7 @@ import json import logging import re +import time from string import Template from typing import Any, Optional, cast @@ -113,13 +114,17 @@ async def handle_event(profile: Profile, event: EventWithMetadata): template = config_events.event_topic_maps[event.metadata.pattern.pattern] redis_topic = Template(template).substitute(**payload) LOGGER.info(f"Sending message {payload} with topic {redis_topic}") + + origin = profile.settings.get("default_label") + + metadata = {"time_ns": time.time_ns()} + metadata_wallet_id = {"x-wallet-id": wallet_id} if wallet_id else {} + metadata_origin = {"origin": origin} if origin else {} + metadata.update(metadata_wallet_id) + metadata.update(metadata_origin) + outbound = str.encode( - json.dumps( - { - "payload": payload, - "metadata": {"x-wallet-id": wallet_id} if wallet_id else {}, - } - ), + json.dumps({"payload": payload, "metadata": metadata}), ) await redis.rpush( redis_topic, From 99053eee06a7c7a2ec56ed7b37e505a147d161c3 Mon Sep 17 00:00:00 2001 From: Mourits de Beer <31511766+ff137@users.noreply.github.com> Date: Tue, 5 Mar 2024 11:49:40 +0200 Subject: [PATCH 2/6] :art: reduce default log levels for handling webhooks (#60) Signed-off-by: ff137 --- redis_events/redis_events/v1_0/redis_queue/events/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/redis_events/redis_events/v1_0/redis_queue/events/__init__.py b/redis_events/redis_events/v1_0/redis_queue/events/__init__.py index 86960d312..4df935760 100755 --- a/redis_events/redis_events/v1_0/redis_queue/events/__init__.py +++ b/redis_events/redis_events/v1_0/redis_queue/events/__init__.py @@ -89,7 +89,7 @@ async def handle_event(profile: Profile, event: EventWithMetadata): if not redis: redis = await redis_setup(profile, event) - LOGGER.info("Handling event: %s", event) + LOGGER.debug("Handling event: %s", event) wallet_id = cast(Optional[str], profile.settings.get("wallet.id")) try: event_payload = process_event_payload(event.payload) @@ -113,7 +113,7 @@ async def handle_event(profile: Profile, event: EventWithMetadata): config_events = get_config(profile.settings).event or EventConfig.default() template = config_events.event_topic_maps[event.metadata.pattern.pattern] redis_topic = Template(template).substitute(**payload) - LOGGER.info(f"Sending message {payload} with topic {redis_topic}") + LOGGER.debug(f"Sending message {payload} with topic {redis_topic}") origin = profile.settings.get("default_label") From a9376962fc7ce9bed40f63961610743af16811c7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Mar 2024 10:25:52 +0000 Subject: [PATCH 3/6] chore(deps-dev): Bump pytest-ruff from 0.1.1 to 0.3 in /redis_events (#58) --- redis_events/poetry.lock | 14 +++++++++----- redis_events/pyproject.toml | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/redis_events/poetry.lock b/redis_events/poetry.lock index d098e107c..98bedef9f 100644 --- a/redis_events/poetry.lock +++ b/redis_events/poetry.lock @@ -414,6 +414,7 @@ name = "cffi" version = "1.16.0" description = "Foreign Function Interface for Python calling C code." optional = true +optional = true python-versions = ">=3.8" files = [ {file = "cffi-1.16.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6b3d6606d369fc1da4fd8c357d026317fbb9c9b75d36dc16e90e84c26854b088"}, @@ -692,6 +693,7 @@ name = "cryptography" version = "42.0.4" description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers." optional = true +optional = true python-versions = ">=3.7" files = [ {file = "cryptography-42.0.4-cp37-abi3-macosx_10_12_universal2.whl", hash = "sha256:ffc73996c4fca3d2b6c1c8c12bfd3ad00def8621da24f547626bf06441400449"}, @@ -1850,6 +1852,7 @@ name = "pycparser" version = "2.21" description = "C parser in Python" optional = true +optional = true python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" files = [ {file = "pycparser-2.21-py2.py3-none-any.whl", hash = "sha256:8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9"}, @@ -2064,16 +2067,17 @@ dev = ["pre-commit", "pytest-asyncio", "tox"] [[package]] name = "pytest-ruff" -version = "0.1.1" +version = "0.3" description = "pytest plugin to check ruff requirements." optional = false -python-versions = ">=3.7,<4.0" +python-versions = ">=3.8,<4.0" files = [ - {file = "pytest_ruff-0.1.1-py3-none-any.whl", hash = "sha256:db33c8d32d730d61d372c1ac4615b1036c47a14c781cbc0ae71811c4cadadc47"}, - {file = "pytest_ruff-0.1.1.tar.gz", hash = "sha256:f599768ff3834d6b1d6d26b25a030a5b1dcc9cf187239bd9621a7f25f7d8fe46"}, + {file = "pytest_ruff-0.3-py3-none-any.whl", hash = "sha256:625d142fa65855cd2d6edae395287829eea91a951d2b77cbe824463680b35760"}, + {file = "pytest_ruff-0.3.tar.gz", hash = "sha256:798fafcee34dff6055c9082b394a5f314d6db2a562fb560da29cfe4e1996eb77"}, ] [package.dependencies] +pytest = ">=5" ruff = ">=0.0.242" [[package]] @@ -2842,4 +2846,4 @@ aca-py = ["aries-cloudagent"] [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "e91c69dfb1ea14cc17bcfcb2b5ab11efebb2430b5dbd3a545106c288cbfc73ec" +content-hash = "934355fb3f21b8aa58adf80694896454541d393c8c1dc5c798a3c550d3735626" diff --git a/redis_events/pyproject.toml b/redis_events/pyproject.toml index 6c5621a4c..43598b843 100644 --- a/redis_events/pyproject.toml +++ b/redis_events/pyproject.toml @@ -27,7 +27,7 @@ asynctest = "0.13.0" pytest = "~7.4.0" pytest-asyncio = "0.14.0" pytest-cov = "2.10.1" -pytest-ruff = "^0.1.1" +pytest-ruff = "^0.3" mock= "~4.0" pre-commit = "^2.12.1" pytest-mock = "^3.6.1" From 185ea29a8a363bf205fbd19e1c407c507e29a9e3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Mar 2024 10:30:43 +0000 Subject: [PATCH 4/6] chore(deps-dev): Bump ruff from 0.1.11 to 0.3.0 in /redis_events (#50) --- redis_events/poetry.lock | 38 ++++++++++++++++++------------------- redis_events/pyproject.toml | 2 +- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/redis_events/poetry.lock b/redis_events/poetry.lock index 98bedef9f..ddb14da63 100644 --- a/redis_events/poetry.lock +++ b/redis_events/poetry.lock @@ -2311,28 +2311,28 @@ dev = ["pytest"] [[package]] name = "ruff" -version = "0.1.11" +version = "0.3.0" description = "An extremely fast Python linter and code formatter, written in Rust." optional = false python-versions = ">=3.7" files = [ - {file = "ruff-0.1.11-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:a7f772696b4cdc0a3b2e527fc3c7ccc41cdcb98f5c80fdd4f2b8c50eb1458196"}, - {file = "ruff-0.1.11-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:934832f6ed9b34a7d5feea58972635c2039c7a3b434fe5ba2ce015064cb6e955"}, - {file = "ruff-0.1.11-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ea0d3e950e394c4b332bcdd112aa566010a9f9c95814844a7468325290aabfd9"}, - {file = "ruff-0.1.11-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:9bd4025b9c5b429a48280785a2b71d479798a69f5c2919e7d274c5f4b32c3607"}, - {file = "ruff-0.1.11-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e1ad00662305dcb1e987f5ec214d31f7d6a062cae3e74c1cbccef15afd96611d"}, - {file = "ruff-0.1.11-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:4b077ce83f47dd6bea1991af08b140e8b8339f0ba8cb9b7a484c30ebab18a23f"}, - {file = "ruff-0.1.11-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c4a88efecec23c37b11076fe676e15c6cdb1271a38f2b415e381e87fe4517f18"}, - {file = "ruff-0.1.11-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5b25093dad3b055667730a9b491129c42d45e11cdb7043b702e97125bcec48a1"}, - {file = "ruff-0.1.11-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:231d8fb11b2cc7c0366a326a66dafc6ad449d7fcdbc268497ee47e1334f66f77"}, - {file = "ruff-0.1.11-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:09c415716884950080921dd6237767e52e227e397e2008e2bed410117679975b"}, - {file = "ruff-0.1.11-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:0f58948c6d212a6b8d41cd59e349751018797ce1727f961c2fa755ad6208ba45"}, - {file = "ruff-0.1.11-py3-none-musllinux_1_2_i686.whl", hash = "sha256:190a566c8f766c37074d99640cd9ca3da11d8deae2deae7c9505e68a4a30f740"}, - {file = "ruff-0.1.11-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:6464289bd67b2344d2a5d9158d5eb81025258f169e69a46b741b396ffb0cda95"}, - {file = "ruff-0.1.11-py3-none-win32.whl", hash = "sha256:9b8f397902f92bc2e70fb6bebfa2139008dc72ae5177e66c383fa5426cb0bf2c"}, - {file = "ruff-0.1.11-py3-none-win_amd64.whl", hash = "sha256:eb85ee287b11f901037a6683b2374bb0ec82928c5cbc984f575d0437979c521a"}, - {file = "ruff-0.1.11-py3-none-win_arm64.whl", hash = "sha256:97ce4d752f964ba559c7023a86e5f8e97f026d511e48013987623915431c7ea9"}, - {file = "ruff-0.1.11.tar.gz", hash = "sha256:f9d4d88cb6eeb4dfe20f9f0519bd2eaba8119bde87c3d5065c541dbae2b5a2cb"}, + {file = "ruff-0.3.0-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:7deb528029bacf845bdbb3dbb2927d8ef9b4356a5e731b10eef171e3f0a85944"}, + {file = "ruff-0.3.0-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:e1e0d4381ca88fb2b73ea0766008e703f33f460295de658f5467f6f229658c19"}, + {file = "ruff-0.3.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2f7dbba46e2827dfcb0f0cc55fba8e96ba7c8700e0a866eb8cef7d1d66c25dcb"}, + {file = "ruff-0.3.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:23dbb808e2f1d68eeadd5f655485e235c102ac6f12ad31505804edced2a5ae77"}, + {file = "ruff-0.3.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3ef655c51f41d5fa879f98e40c90072b567c666a7114fa2d9fe004dffba00932"}, + {file = "ruff-0.3.0-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:d0d3d7ef3d4f06433d592e5f7d813314a34601e6c5be8481cccb7fa760aa243e"}, + {file = "ruff-0.3.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b08b356d06a792e49a12074b62222f9d4ea2a11dca9da9f68163b28c71bf1dd4"}, + {file = "ruff-0.3.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9343690f95710f8cf251bee1013bf43030072b9f8d012fbed6ad702ef70d360a"}, + {file = "ruff-0.3.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a1f3ed501a42f60f4dedb7805fa8d4534e78b4e196f536bac926f805f0743d49"}, + {file = "ruff-0.3.0-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:cc30a9053ff2f1ffb505a585797c23434d5f6c838bacfe206c0e6cf38c921a1e"}, + {file = "ruff-0.3.0-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:5da894a29ec018a8293d3d17c797e73b374773943e8369cfc50495573d396933"}, + {file = "ruff-0.3.0-py3-none-musllinux_1_2_i686.whl", hash = "sha256:755c22536d7f1889be25f2baf6fedd019d0c51d079e8417d4441159f3bcd30c2"}, + {file = "ruff-0.3.0-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:dd73fe7f4c28d317855da6a7bc4aa29a1500320818dd8f27df95f70a01b8171f"}, + {file = "ruff-0.3.0-py3-none-win32.whl", hash = "sha256:19eacceb4c9406f6c41af806418a26fdb23120dfe53583df76d1401c92b7c14b"}, + {file = "ruff-0.3.0-py3-none-win_amd64.whl", hash = "sha256:128265876c1d703e5f5e5a4543bd8be47c73a9ba223fd3989d4aa87dd06f312f"}, + {file = "ruff-0.3.0-py3-none-win_arm64.whl", hash = "sha256:e3a4a6d46aef0a84b74fcd201a4401ea9a6cd85614f6a9435f2d33dd8cefbf83"}, + {file = "ruff-0.3.0.tar.gz", hash = "sha256:0886184ba2618d815067cf43e005388967b67ab9c80df52b32ec1152ab49f53a"}, ] [[package]] @@ -2846,4 +2846,4 @@ aca-py = ["aries-cloudagent"] [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "934355fb3f21b8aa58adf80694896454541d393c8c1dc5c798a3c550d3735626" +content-hash = "52605a6eec05863da8d1b8a0905b6c0dbcc1dfa95ae1c5b9964619efe012dae8" diff --git a/redis_events/pyproject.toml b/redis_events/pyproject.toml index 43598b843..8e228750f 100644 --- a/redis_events/pyproject.toml +++ b/redis_events/pyproject.toml @@ -21,7 +21,7 @@ uvicorn = "0.16.0" aca-py = ["aries-cloudagent"] [tool.poetry.dev-dependencies] -ruff = "^0.1.2" +ruff = "^0.3.0" black = "23.7.0" asynctest = "0.13.0" pytest = "~7.4.0" From cfd1185b9e10098d24205d57b634210a68083416 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Mar 2024 10:39:05 +0000 Subject: [PATCH 5/6] chore(deps): Bump redis from 4.6.0 to 5.0.2 in /redis_events (#24) --- redis_events/poetry.lock | 10 +++++----- redis_events/pyproject.toml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/redis_events/poetry.lock b/redis_events/poetry.lock index ddb14da63..05a3e9db5 100644 --- a/redis_events/poetry.lock +++ b/redis_events/poetry.lock @@ -2239,17 +2239,17 @@ test = ["mock", "pytest", "pytest-cov"] [[package]] name = "redis" -version = "4.6.0" +version = "5.0.2" description = "Python client for Redis database and key-value store" optional = false python-versions = ">=3.7" files = [ - {file = "redis-4.6.0-py3-none-any.whl", hash = "sha256:e2b03db868160ee4591de3cb90d40ebb50a90dd302138775937f6a42b7ed183c"}, - {file = "redis-4.6.0.tar.gz", hash = "sha256:585dc516b9eb042a619ef0a39c3d7d55fe81bdb4df09a52c9cdde0d07bf1aa7d"}, + {file = "redis-5.0.2-py3-none-any.whl", hash = "sha256:4caa8e1fcb6f3c0ef28dba99535101d80934b7d4cd541bbb47f4a3826ee472d1"}, + {file = "redis-5.0.2.tar.gz", hash = "sha256:3f82cc80d350e93042c8e6e7a5d0596e4dd68715babffba79492733e1f367037"}, ] [package.dependencies] -async-timeout = {version = ">=4.0.2", markers = "python_full_version <= \"3.11.2\""} +async-timeout = ">=4.0.3" [package.extras] hiredis = ["hiredis (>=1.0.0)"] @@ -2846,4 +2846,4 @@ aca-py = ["aries-cloudagent"] [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "52605a6eec05863da8d1b8a0905b6c0dbcc1dfa95ae1c5b9964619efe012dae8" +content-hash = "e1c92e69548d6f2528955e5572d144a4ddd0db01466cfc34bf4a3fd375a49fa1" diff --git a/redis_events/pyproject.toml b/redis_events/pyproject.toml index 8e228750f..1bd999db9 100644 --- a/redis_events/pyproject.toml +++ b/redis_events/pyproject.toml @@ -14,7 +14,7 @@ aiohttp = "^3.7.4" fastapi = "^0.109.2" nest-asyncio = "^1.5.5" pydantic = "^1.8.2" -redis = "^4.1.4" +redis = "^5.0.2" uvicorn = "0.16.0" [tool.poetry.extras] From 4f0a3247e88a893d0c2e36e55d3aaec75e460372 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Mar 2024 11:36:09 +0000 Subject: [PATCH 6/6] chore(deps): Bump marshmallow from 3.20.1 to 3.20.2 in /oid4vci Bumps [marshmallow](https://github.com/marshmallow-code/marshmallow) from 3.20.1 to 3.20.2. - [Changelog](https://github.com/marshmallow-code/marshmallow/blob/dev/CHANGELOG.rst) - [Commits](https://github.com/marshmallow-code/marshmallow/compare/3.20.1...3.20.2) --- updated-dependencies: - dependency-name: marshmallow dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- oid4vci/poetry.lock | 14 +++++++------- oid4vci/pyproject.toml | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/oid4vci/poetry.lock b/oid4vci/poetry.lock index 06b0bbced..7b88d5f01 100644 --- a/oid4vci/poetry.lock +++ b/oid4vci/poetry.lock @@ -1370,22 +1370,22 @@ files = [ [[package]] name = "marshmallow" -version = "3.20.1" +version = "3.20.2" description = "A lightweight library for converting complex datatypes to and from native Python datatypes." optional = false python-versions = ">=3.8" files = [ - {file = "marshmallow-3.20.1-py3-none-any.whl", hash = "sha256:684939db93e80ad3561392f47be0230743131560a41c5110684c16e21ade0a5c"}, - {file = "marshmallow-3.20.1.tar.gz", hash = "sha256:5d2371bbe42000f2b3fb5eaa065224df7d8f8597bc19a1bbfa5bfe7fba8da889"}, + {file = "marshmallow-3.20.2-py3-none-any.whl", hash = "sha256:c21d4b98fee747c130e6bc8f45c4b3199ea66bc00c12ee1f639f0aeca034d5e9"}, + {file = "marshmallow-3.20.2.tar.gz", hash = "sha256:4c1daff273513dc5eb24b219a8035559dc573c8f322558ef85f5438ddd1236dd"}, ] [package.dependencies] packaging = ">=17.0" [package.extras] -dev = ["flake8 (==6.0.0)", "flake8-bugbear (==23.7.10)", "mypy (==1.4.1)", "pre-commit (>=2.4,<4.0)", "pytest", "pytz", "simplejson", "tox"] -docs = ["alabaster (==0.7.13)", "autodocsumm (==0.2.11)", "sphinx (==7.0.1)", "sphinx-issues (==3.0.1)", "sphinx-version-warning (==1.1.2)"] -lint = ["flake8 (==6.0.0)", "flake8-bugbear (==23.7.10)", "mypy (==1.4.1)", "pre-commit (>=2.4,<4.0)"] +dev = ["pre-commit (>=2.4,<4.0)", "pytest", "pytz", "simplejson", "tox"] +docs = ["alabaster (==0.7.15)", "autodocsumm (==0.2.12)", "sphinx (==7.2.6)", "sphinx-issues (==3.0.1)", "sphinx-version-warning (==1.1.2)"] +lint = ["pre-commit (>=2.4,<4.0)"] tests = ["pytest", "pytz", "simplejson"] [[package]] @@ -2573,4 +2573,4 @@ aca-py = ["aries-cloudagent"] [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "b78d3383f711f25016d000723138b9d2f5a6eed3b19c7f4fafd373e3d89c978c" +content-hash = "9a93835cf0c8b3991900df2df31165c7d77c8706e9242c7110534438f93109f3" diff --git a/oid4vci/pyproject.toml b/oid4vci/pyproject.toml index b8af3a9f8..526709836 100644 --- a/oid4vci/pyproject.toml +++ b/oid4vci/pyproject.toml @@ -14,7 +14,7 @@ aries-cloudagent = { version = ">=0.10.3, < 1.0.0", optional = true } aiohttp = "^3.8.5" aries-askar = "~0.3.0" aiohttp-cors = "^0.7.0" -marshmallow = "^3.20.1" +marshmallow = "^3.20.2" [tool.poetry.extras] aca-py = ["aries-cloudagent"]