From 7a00c888935a032328315d816ee0ab8ee2dfafc9 Mon Sep 17 00:00:00 2001 From: Okhunjon Kuvatov Date: Tue, 14 Apr 2026 19:52:53 +0500 Subject: [PATCH 1/2] Feat: Add a new get_metadata_by_public_addresses method to the User --- .pre-commit-config.yaml | 4 ++-- magic_admin/resources/user.py | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1102faf..fff8b6d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,12 +13,12 @@ repos: - id: detect-private-key - id: requirements-txt-fixer - repo: https://github.com/codespell-project/codespell - rev: v2.4.1 + rev: v2.4.2 hooks: - id: codespell exclude: ^locale/ - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.0 + rev: v0.15.10 hooks: - id: ruff-check args: [--fix] diff --git a/magic_admin/resources/user.py b/magic_admin/resources/user.py index f684b3d..2a2c6e0 100644 --- a/magic_admin/resources/user.py +++ b/magic_admin/resources/user.py @@ -5,6 +5,7 @@ class User(ResourceComponent): v1_user_info = "/v1/admin/user" + v1_users_info = "/v1/admin/users" v1_user_logout = "/v1/admin/user/logout" v2_user_info = "/v2/admin/user" @@ -41,6 +42,18 @@ def get_metadata_by_public_address(self, public_address): construct_issuer_with_public_address(public_address), ) + def get_metadata_by_public_addresses(self, public_addresses): + return self.request( + "post", + self.v1_users_info, + data={ + "issuers": [ + construct_issuer_with_public_address(addr) + for addr in public_addresses + ], + }, + ) + def get_metadata_by_token(self, did_token): return self.get_metadata_by_issuer(self.Token.get_issuer(did_token)) From 1dbefa0ecce169717bc890b847bd8de3dbc50db7 Mon Sep 17 00:00:00 2001 From: Okhunjon Kuvatov Date: Tue, 14 Apr 2026 21:29:55 +0500 Subject: [PATCH 2/2] Bump version to 2.3.0 --- CHANGELOG.md | 11 +++++++++++ magic_admin/version.py | 2 +- pyproject.toml | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ba4678..f6cfbe0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +## `2.3.0` - 2026-04-14 + +#### 🚀 New Features + +- **Added `get_metadata_by_public_addresses` to User resource** + - Enables retrieving metadata for a batch of users in a single request, avoiding rate limiting issues when exporting large numbers of users + - Accepts a list of Ethereum public addresses and returns metadata for each user + - Errors for individual addresses (not found, unauthorized, malformed) are returned per-entry without failing the whole request + +--- + ## `2.2.1` - 2026-02-10 #### 🐛 Bug Fixes diff --git a/magic_admin/version.py b/magic_admin/version.py index 3f755ed..707faad 100644 --- a/magic_admin/version.py +++ b/magic_admin/version.py @@ -1 +1 @@ -VERSION = "2.2.1" +VERSION = "2.3.0" diff --git a/pyproject.toml b/pyproject.toml index 9c4bee8..27e5508 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "magic-admin" -version = "2.2.1" +version = "2.3.0" description = "Magic Python Library" readme = "README.md" authors = [