Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-pynitrokey for openSUSE:Factory checked in at 2024-07-22 17:18:08 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-pynitrokey (Old) and /work/SRC/openSUSE:Factory/.python-pynitrokey.new.17339 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pynitrokey" Mon Jul 22 17:18:08 2024 rev:11 rq:1188841 version:0.4.49 Changes: -------- --- /work/SRC/openSUSE:Factory/python-pynitrokey/python-pynitrokey.changes 2024-07-16 22:04:15.345878909 +0200 +++ /work/SRC/openSUSE:Factory/.python-pynitrokey.new.17339/python-pynitrokey.changes 2024-07-22 17:19:51.537738116 +0200 @@ -1,0 +2,6 @@ +Wed Jul 17 16:36:06 UTC 2024 - Johannes Kastl <opensuse_buildserv...@ojkastl.de> + +- update to 0.4.49: + * nethsm: Add support for namespaces by @robin-nitrokey in #535 + +------------------------------------------------------------------- Old: ---- pynitrokey-0.4.48.tar.gz New: ---- pynitrokey-0.4.49.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-pynitrokey.spec ++++++ --- /var/tmp/diff_new_pack.iRecD7/_old 2024-07-22 17:19:52.121761597 +0200 +++ /var/tmp/diff_new_pack.iRecD7/_new 2024-07-22 17:19:52.121761597 +0200 @@ -23,7 +23,7 @@ %endif Name: python-pynitrokey -Version: 0.4.48 +Version: 0.4.49 Release: 0 Summary: Python Library for Nitrokey devices License: Apache-2.0 OR MIT @@ -46,7 +46,7 @@ BuildRequires: %{python_module frozendict >= 2.3.4} # "fido2 >=1.1.0,<2" BuildRequires: %{python_module fido2 >= 1.1.0 with %python-fido2 < 2} -BuildRequires: %{python_module nethsm >= 1.1.0 with %python-nethsm < 2} +BuildRequires: %{python_module nethsm >= 1.2.0 with %python-nethsm < 2} BuildRequires: %{python_module nkdfu} #"python-dateutil ~= 2.7.0" BuildRequires: %{python_module python-dateutil >= 2.7.0} @@ -86,7 +86,7 @@ Requires: python-typing_extensions >= 4.3.0 Requires: python-urllib3 >= 1.26.7 Requires: (python-fido2 >= 1.1.0 with python-fido2 < 2) -Requires: (python-nethsm >= 1.1.0 with python-nethsm < 2) +Requires: (python-nethsm >= 1.2.0 with python-nethsm < 2) Requires: (python-spsdk >= 2.0 with python-spsdk < 2.2) Requires(post): update-alternatives Requires(postun): update-alternatives ++++++ pynitrokey-0.4.48.tar.gz -> pynitrokey-0.4.49.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pynitrokey-0.4.48/PKG-INFO new/pynitrokey-0.4.49/PKG-INFO --- old/pynitrokey-0.4.48/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 +++ new/pynitrokey-0.4.49/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: pynitrokey -Version: 0.4.48 +Version: 0.4.49 Summary: Python Library for Nitrokey devices. Author-email: Nitrokey <p...@nitrokey.com> Requires-Python: >=3.9 @@ -33,7 +33,7 @@ Requires-Dist: protobuf >=3.17.3, < 4.0.0 Requires-Dist: click-aliases Requires-Dist: semver -Requires-Dist: nethsm >= 1.1.0,<2 +Requires-Dist: nethsm >=1.2.0, <2 Requires-Dist: black >=22.1.0,<23 ; extra == "dev" Requires-Dist: flake8 ; extra == "dev" Requires-Dist: flit >=3.2,<4 ; extra == "dev" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pynitrokey-0.4.48/pynitrokey/VERSION new/pynitrokey-0.4.49/pynitrokey/VERSION --- old/pynitrokey-0.4.48/pynitrokey/VERSION 2024-07-10 11:06:44.000000000 +0200 +++ new/pynitrokey-0.4.49/pynitrokey/VERSION 2024-07-17 17:54:50.000000000 +0200 @@ -1 +1 @@ -0.4.48 +0.4.49 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pynitrokey-0.4.48/pynitrokey/cli/nethsm.py new/pynitrokey-0.4.49/pynitrokey/cli/nethsm.py --- old/pynitrokey-0.4.48/pynitrokey/cli/nethsm.py 2024-07-10 11:06:44.000000000 +0200 +++ new/pynitrokey-0.4.49/pynitrokey/cli/nethsm.py 2024-07-17 17:54:50.000000000 +0200 @@ -296,9 +296,15 @@ help="The passphrase of the new user", ) @click.option("-u", "--user-id", help="The user ID of the new user") +@click.option("-N", "--namespace", help="The namespace of the new user") @click.pass_context def add_user( - ctx: Context, real_name: str, role: str, passphrase: str, user_id: Optional[str] + ctx: Context, + real_name: str, + role: str, + passphrase: str, + user_id: Optional[str], + namespace: Optional[str], ) -> None: """Create a new user on the NetHSM. @@ -310,7 +316,7 @@ role.""" with connect(ctx) as nethsm: user_id = nethsm.add_user( - real_name, nethsm_sdk.Role.from_string(role), passphrase, user_id + real_name, nethsm_sdk.Role.from_string(role), passphrase, user_id, namespace ) print(f"User {user_id} added to NetHSM {nethsm.host}") @@ -329,6 +335,47 @@ @nethsm.command() +@click.pass_context +def list_namespaces(ctx: Context) -> None: + """List all namespaces on the NetHSM. + + This command requires authentication as a user with the Administrator + role.""" + with connect(ctx) as nethsm: + namespaces = nethsm.list_namespaces() + + print(f"Namespaces on NetHSM {nethsm.host}:") + for namespace in namespaces: + print(f"- {namespace}") + + +@nethsm.command() +@click.argument("namespace") +@click.pass_context +def add_namespace(ctx: Context, namespace: str) -> None: + """Add a new namespace on the NetHSM. + + This command requires authentication as a user with the Administrator + role.""" + with connect(ctx) as nethsm: + nethsm.add_namespace(namespace) + print(f"Namespace {namespace} added to NetHSM {nethsm.host}") + + +@nethsm.command() +@click.argument("namespace") +@click.pass_context +def delete_namespace(ctx: Context, namespace: str) -> None: + """Delete a namespace on the NetHSM. + + This command requires authentication as a user with the Administrator + role.""" + with connect(ctx) as nethsm: + nethsm.delete_namespace(namespace) + print(f"Namespace {namespace} deleted on NetHSM {nethsm.host}") + + +@nethsm.command() @click.option("-u", "--user-id", help="The user ID of the user") @click.option( "-p", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pynitrokey-0.4.48/pyproject.toml new/pynitrokey-0.4.49/pyproject.toml --- old/pynitrokey-0.4.48/pyproject.toml 2024-07-10 11:06:44.000000000 +0200 +++ new/pynitrokey-0.4.49/pyproject.toml 2024-07-17 17:54:50.000000000 +0200 @@ -40,7 +40,7 @@ "protobuf >=3.17.3, < 4.0.0", "click-aliases", "semver", - "nethsm >= 1.1.0,<2", + "nethsm >=1.2.0, <2", ] dynamic = ["version", "description"]