diff --git a/.gitignore b/.gitignore index 0d20b64..4930881 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ *.pyc +_build diff --git a/Makefile b/Makefile index a490a88..2618fa8 100644 --- a/Makefile +++ b/Makefile @@ -41,3 +41,11 @@ fix: .PHONY: test test: poetry run python -m unittest -v + +.PHONY: generate-api-docs +generate-api-docs: + poetry run sphinx-apidoc --separate --maxdepth 1 --tocfile index --output-dir docs/api src/nitrokey + +.PHONY: build-docs +build-docs: + poetry run sphinx-build docs _build diff --git a/docs/api/index.rst b/docs/api/index.rst new file mode 100644 index 0000000..80e8948 --- /dev/null +++ b/docs/api/index.rst @@ -0,0 +1,7 @@ +API Reference +============= + +.. toctree:: + :maxdepth: 1 + + nitrokey diff --git a/docs/api/nitrokey.nk3.bootloader.rst b/docs/api/nitrokey.nk3.bootloader.rst new file mode 100644 index 0000000..5a4d2fe --- /dev/null +++ b/docs/api/nitrokey.nk3.bootloader.rst @@ -0,0 +1,7 @@ +nitrokey.nk3.bootloader module +============================== + +.. automodule:: nitrokey.nk3.bootloader + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/api/nitrokey.nk3.device.rst b/docs/api/nitrokey.nk3.device.rst new file mode 100644 index 0000000..5de09e7 --- /dev/null +++ b/docs/api/nitrokey.nk3.device.rst @@ -0,0 +1,7 @@ +nitrokey.nk3.device module +========================== + +.. automodule:: nitrokey.nk3.device + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/api/nitrokey.nk3.rst b/docs/api/nitrokey.nk3.rst new file mode 100644 index 0000000..f66774b --- /dev/null +++ b/docs/api/nitrokey.nk3.rst @@ -0,0 +1,21 @@ +nitrokey.nk3 package +==================== + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + nitrokey.nk3.bootloader + nitrokey.nk3.device + nitrokey.nk3.secrets_app + nitrokey.nk3.updates + +Module contents +--------------- + +.. automodule:: nitrokey.nk3 + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/api/nitrokey.nk3.secrets_app.rst b/docs/api/nitrokey.nk3.secrets_app.rst new file mode 100644 index 0000000..8e70c0d --- /dev/null +++ b/docs/api/nitrokey.nk3.secrets_app.rst @@ -0,0 +1,7 @@ +nitrokey.nk3.secrets\_app module +================================ + +.. automodule:: nitrokey.nk3.secrets_app + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/api/nitrokey.nk3.updates.rst b/docs/api/nitrokey.nk3.updates.rst new file mode 100644 index 0000000..a21d818 --- /dev/null +++ b/docs/api/nitrokey.nk3.updates.rst @@ -0,0 +1,7 @@ +nitrokey.nk3.updates module +=========================== + +.. automodule:: nitrokey.nk3.updates + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/api/nitrokey.nkpk.rst b/docs/api/nitrokey.nkpk.rst new file mode 100644 index 0000000..eed116c --- /dev/null +++ b/docs/api/nitrokey.nkpk.rst @@ -0,0 +1,7 @@ +nitrokey.nkpk module +==================== + +.. automodule:: nitrokey.nkpk + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/api/nitrokey.rst b/docs/api/nitrokey.rst new file mode 100644 index 0000000..b59c567 --- /dev/null +++ b/docs/api/nitrokey.rst @@ -0,0 +1,28 @@ +nitrokey package +================ + +Subpackages +----------- + +.. toctree:: + :maxdepth: 1 + + nitrokey.nk3 + nitrokey.trussed + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + nitrokey.nkpk + nitrokey.updates + +Module contents +--------------- + +.. automodule:: nitrokey + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/api/nitrokey.trussed.admin_app.rst b/docs/api/nitrokey.trussed.admin_app.rst new file mode 100644 index 0000000..bf810bf --- /dev/null +++ b/docs/api/nitrokey.trussed.admin_app.rst @@ -0,0 +1,7 @@ +nitrokey.trussed.admin\_app module +================================== + +.. automodule:: nitrokey.trussed.admin_app + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/api/nitrokey.trussed.base.rst b/docs/api/nitrokey.trussed.base.rst new file mode 100644 index 0000000..494d9aa --- /dev/null +++ b/docs/api/nitrokey.trussed.base.rst @@ -0,0 +1,7 @@ +nitrokey.trussed.base module +============================ + +.. automodule:: nitrokey.trussed.base + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/api/nitrokey.trussed.bootloader.lpc55.rst b/docs/api/nitrokey.trussed.bootloader.lpc55.rst new file mode 100644 index 0000000..d26f4b6 --- /dev/null +++ b/docs/api/nitrokey.trussed.bootloader.lpc55.rst @@ -0,0 +1,7 @@ +nitrokey.trussed.bootloader.lpc55 module +======================================== + +.. automodule:: nitrokey.trussed.bootloader.lpc55 + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/api/nitrokey.trussed.bootloader.nrf52.rst b/docs/api/nitrokey.trussed.bootloader.nrf52.rst new file mode 100644 index 0000000..7eb6ad9 --- /dev/null +++ b/docs/api/nitrokey.trussed.bootloader.nrf52.rst @@ -0,0 +1,7 @@ +nitrokey.trussed.bootloader.nrf52 module +======================================== + +.. automodule:: nitrokey.trussed.bootloader.nrf52 + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/api/nitrokey.trussed.bootloader.rst b/docs/api/nitrokey.trussed.bootloader.rst new file mode 100644 index 0000000..ab47974 --- /dev/null +++ b/docs/api/nitrokey.trussed.bootloader.rst @@ -0,0 +1,19 @@ +nitrokey.trussed.bootloader package +=================================== + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + nitrokey.trussed.bootloader.lpc55 + nitrokey.trussed.bootloader.nrf52 + +Module contents +--------------- + +.. automodule:: nitrokey.trussed.bootloader + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/api/nitrokey.trussed.device.rst b/docs/api/nitrokey.trussed.device.rst new file mode 100644 index 0000000..5710f3d --- /dev/null +++ b/docs/api/nitrokey.trussed.device.rst @@ -0,0 +1,7 @@ +nitrokey.trussed.device module +============================== + +.. automodule:: nitrokey.trussed.device + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/api/nitrokey.trussed.exceptions.rst b/docs/api/nitrokey.trussed.exceptions.rst new file mode 100644 index 0000000..54db013 --- /dev/null +++ b/docs/api/nitrokey.trussed.exceptions.rst @@ -0,0 +1,7 @@ +nitrokey.trussed.exceptions module +================================== + +.. automodule:: nitrokey.trussed.exceptions + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/api/nitrokey.trussed.provisioner_app.rst b/docs/api/nitrokey.trussed.provisioner_app.rst new file mode 100644 index 0000000..a6ad418 --- /dev/null +++ b/docs/api/nitrokey.trussed.provisioner_app.rst @@ -0,0 +1,7 @@ +nitrokey.trussed.provisioner\_app module +======================================== + +.. automodule:: nitrokey.trussed.provisioner_app + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/api/nitrokey.trussed.rst b/docs/api/nitrokey.trussed.rst new file mode 100644 index 0000000..ed4bcab --- /dev/null +++ b/docs/api/nitrokey.trussed.rst @@ -0,0 +1,31 @@ +nitrokey.trussed package +======================== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 1 + + nitrokey.trussed.bootloader + +Submodules +---------- + +.. toctree:: + :maxdepth: 1 + + nitrokey.trussed.admin_app + nitrokey.trussed.base + nitrokey.trussed.device + nitrokey.trussed.exceptions + nitrokey.trussed.provisioner_app + nitrokey.trussed.utils + +Module contents +--------------- + +.. automodule:: nitrokey.trussed + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/api/nitrokey.trussed.utils.rst b/docs/api/nitrokey.trussed.utils.rst new file mode 100644 index 0000000..7cf7972 --- /dev/null +++ b/docs/api/nitrokey.trussed.utils.rst @@ -0,0 +1,7 @@ +nitrokey.trussed.utils module +============================= + +.. automodule:: nitrokey.trussed.utils + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/api/nitrokey.updates.rst b/docs/api/nitrokey.updates.rst new file mode 100644 index 0000000..fb3529d --- /dev/null +++ b/docs/api/nitrokey.updates.rst @@ -0,0 +1,7 @@ +nitrokey.updates module +======================= + +.. automodule:: nitrokey.updates + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000..71cadbd --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,11 @@ +project = 'Nitrokey Python SDK' +copyright = '2024, Nitrokey' +author = 'Nitrokey' +release = '0.1.0' +extensions = [ + 'sphinx.ext.autodoc', +] +html_theme = 'alabaster' +autodoc_class_signature = 'separated' +autodoc_member_order = 'groupwise' +autodoc_typehints = 'description' diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 0000000..4349f0f --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,8 @@ +Nitrokey Python SDK +=================== + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + api/index diff --git a/poetry.lock b/poetry.lock index bf635bb..cc91bfd 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,5 +1,16 @@ # This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand. +[[package]] +name = "alabaster" +version = "0.7.16" +description = "A light, configurable Sphinx theme" +optional = false +python-versions = ">=3.9" +files = [ + {file = "alabaster-0.7.16-py3-none-any.whl", hash = "sha256:b46733c07dce03ae4e150330b975c75737fa60f0a7c591b6c8bf4928a28e2c92"}, + {file = "alabaster-0.7.16.tar.gz", hash = "sha256:75a8b99c28a5dad50dd7f8ccdd447a121ddb3892da9e53d1ca5cca3106d58d65"}, +] + [[package]] name = "appdirs" version = "1.4.4" @@ -33,6 +44,20 @@ files = [ {file = "asn1crypto-1.5.1.tar.gz", hash = "sha256:13ae38502be632115abf8a24cbe5f4da52e3b5231990aff31123c805306ccb9c"}, ] +[[package]] +name = "babel" +version = "2.15.0" +description = "Internationalization utilities" +optional = false +python-versions = ">=3.8" +files = [ + {file = "Babel-2.15.0-py3-none-any.whl", hash = "sha256:08706bdad8d0a3413266ab61bd6c34d0c28d6e1e7badf40a2cebe67644e2e1fb"}, + {file = "babel-2.15.0.tar.gz", hash = "sha256:8daf0e265d05768bc6c7a314cf1321e9a123afc328cc635c18622a2f30a04413"}, +] + +[package.extras] +dev = ["freezegun (>=1.0,<2.0)", "pytest (>=6.0)", "pytest-cov"] + [[package]] name = "bincopy" version = "17.14.5" @@ -588,6 +613,17 @@ files = [ {file = "deepmerge-1.1.1.tar.gz", hash = "sha256:53a489dc9449636e480a784359ae2aab3191748c920649551c8e378622f0eca4"}, ] +[[package]] +name = "docutils" +version = "0.21.2" +description = "Docutils -- Python Documentation Utilities" +optional = false +python-versions = ">=3.9" +files = [ + {file = "docutils-0.21.2-py3-none-any.whl", hash = "sha256:dafca5b9e384f0e419294eb4d2ff9fa826435bf15f15b7bd45723e8ad76811b2"}, + {file = "docutils-0.21.2.tar.gz", hash = "sha256:3a6b18732edf182daa3cd12775bbb338cf5691468f91eeeb109deff6ebfa986f"}, +] + [[package]] name = "ecdsa" version = "0.19.0" @@ -769,6 +805,17 @@ files = [ {file = "idna-3.7.tar.gz", hash = "sha256:028ff3aadf0609c1fd278d8ea3089299412a7a8b9bd005dd08b9f8285bcb5cfc"}, ] +[[package]] +name = "imagesize" +version = "1.4.1" +description = "Getting image size from png/jpeg/jpeg2000/gif file" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +files = [ + {file = "imagesize-1.4.1-py2.py3-none-any.whl", hash = "sha256:0d8d18d08f840c19d0ee7ca1fd82490fdc3729b7ac93f49870406ddde8ef8d8b"}, + {file = "imagesize-1.4.1.tar.gz", hash = "sha256:69150444affb9cb0d5cc5a92b3676f0b2fb7cd9ae39e947a5e11a36b4497cd4a"}, +] + [[package]] name = "importlib-metadata" version = "8.0.0" @@ -844,6 +891,23 @@ files = [ [package.extras] colors = ["colorama (>=0.4.6)"] +[[package]] +name = "jinja2" +version = "3.1.4" +description = "A very fast and expressive template engine." +optional = false +python-versions = ">=3.7" +files = [ + {file = "jinja2-3.1.4-py3-none-any.whl", hash = "sha256:bc5dd2abb727a5319567b7a813e6a2e7318c39f4f487cfe6c89c6f9c7d25197d"}, + {file = "jinja2-3.1.4.tar.gz", hash = "sha256:4a3aee7acbbe7303aede8e9648d13b8bf88a429282aa6122a993f0ac800cb369"}, +] + +[package.dependencies] +MarkupSafe = ">=2.0" + +[package.extras] +i18n = ["Babel (>=2.7)"] + [[package]] name = "lark" version = "1.1.9" @@ -948,6 +1012,75 @@ files = [ {file = "libusbsio-2.1.12.tar.gz", hash = "sha256:45d521c229413b0835f5acb73e8df3b31aa5055f454f2ddbb490db3b8604292f"}, ] +[[package]] +name = "markupsafe" +version = "2.1.5" +description = "Safely add untrusted strings to HTML/XML markup." +optional = false +python-versions = ">=3.7" +files = [ + {file = "MarkupSafe-2.1.5-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:a17a92de5231666cfbe003f0e4b9b3a7ae3afb1ec2845aadc2bacc93ff85febc"}, + {file = "MarkupSafe-2.1.5-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:72b6be590cc35924b02c78ef34b467da4ba07e4e0f0454a2c5907f473fc50ce5"}, + {file = "MarkupSafe-2.1.5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e61659ba32cf2cf1481e575d0462554625196a1f2fc06a1c777d3f48e8865d46"}, + {file = "MarkupSafe-2.1.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2174c595a0d73a3080ca3257b40096db99799265e1c27cc5a610743acd86d62f"}, + {file = "MarkupSafe-2.1.5-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ae2ad8ae6ebee9d2d94b17fb62763125f3f374c25618198f40cbb8b525411900"}, + {file = "MarkupSafe-2.1.5-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:075202fa5b72c86ad32dc7d0b56024ebdbcf2048c0ba09f1cde31bfdd57bcfff"}, + {file = "MarkupSafe-2.1.5-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:598e3276b64aff0e7b3451b72e94fa3c238d452e7ddcd893c3ab324717456bad"}, + {file = "MarkupSafe-2.1.5-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:fce659a462a1be54d2ffcacea5e3ba2d74daa74f30f5f143fe0c58636e355fdd"}, + {file = "MarkupSafe-2.1.5-cp310-cp310-win32.whl", hash = "sha256:d9fad5155d72433c921b782e58892377c44bd6252b5af2f67f16b194987338a4"}, + {file = "MarkupSafe-2.1.5-cp310-cp310-win_amd64.whl", hash = "sha256:bf50cd79a75d181c9181df03572cdce0fbb75cc353bc350712073108cba98de5"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:629ddd2ca402ae6dbedfceeba9c46d5f7b2a61d9749597d4307f943ef198fc1f"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:5b7b716f97b52c5a14bffdf688f971b2d5ef4029127f1ad7a513973cfd818df2"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6ec585f69cec0aa07d945b20805be741395e28ac1627333b1c5b0105962ffced"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b91c037585eba9095565a3556f611e3cbfaa42ca1e865f7b8015fe5c7336d5a5"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7502934a33b54030eaf1194c21c692a534196063db72176b0c4028e140f8f32c"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:0e397ac966fdf721b2c528cf028494e86172b4feba51d65f81ffd65c63798f3f"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:c061bb86a71b42465156a3ee7bd58c8c2ceacdbeb95d05a99893e08b8467359a"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:3a57fdd7ce31c7ff06cdfbf31dafa96cc533c21e443d57f5b1ecc6cdc668ec7f"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-win32.whl", hash = "sha256:397081c1a0bfb5124355710fe79478cdbeb39626492b15d399526ae53422b906"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-win_amd64.whl", hash = "sha256:2b7c57a4dfc4f16f7142221afe5ba4e093e09e728ca65c51f5620c9aaeb9a617"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:8dec4936e9c3100156f8a2dc89c4b88d5c435175ff03413b443469c7c8c5f4d1"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:3c6b973f22eb18a789b1460b4b91bf04ae3f0c4234a0a6aa6b0a92f6f7b951d4"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ac07bad82163452a6884fe8fa0963fb98c2346ba78d779ec06bd7a6262132aee"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f5dfb42c4604dddc8e4305050aa6deb084540643ed5804d7455b5df8fe16f5e5"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ea3d8a3d18833cf4304cd2fc9cbb1efe188ca9b5efef2bdac7adc20594a0e46b"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:d050b3361367a06d752db6ead6e7edeb0009be66bc3bae0ee9d97fb326badc2a"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:bec0a414d016ac1a18862a519e54b2fd0fc8bbfd6890376898a6c0891dd82e9f"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:58c98fee265677f63a4385256a6d7683ab1832f3ddd1e66fe948d5880c21a169"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-win32.whl", hash = "sha256:8590b4ae07a35970728874632fed7bd57b26b0102df2d2b233b6d9d82f6c62ad"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-win_amd64.whl", hash = "sha256:823b65d8706e32ad2df51ed89496147a42a2a6e01c13cfb6ffb8b1e92bc910bb"}, + {file = "MarkupSafe-2.1.5-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:c8b29db45f8fe46ad280a7294f5c3ec36dbac9491f2d1c17345be8e69cc5928f"}, + {file = "MarkupSafe-2.1.5-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ec6a563cff360b50eed26f13adc43e61bc0c04d94b8be985e6fb24b81f6dcfdf"}, + {file = "MarkupSafe-2.1.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a549b9c31bec33820e885335b451286e2969a2d9e24879f83fe904a5ce59d70a"}, + {file = "MarkupSafe-2.1.5-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4f11aa001c540f62c6166c7726f71f7573b52c68c31f014c25cc7901deea0b52"}, + {file = "MarkupSafe-2.1.5-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:7b2e5a267c855eea6b4283940daa6e88a285f5f2a67f2220203786dfa59b37e9"}, + {file = "MarkupSafe-2.1.5-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:2d2d793e36e230fd32babe143b04cec8a8b3eb8a3122d2aceb4a371e6b09b8df"}, + {file = "MarkupSafe-2.1.5-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:ce409136744f6521e39fd8e2a24c53fa18ad67aa5bc7c2cf83645cce5b5c4e50"}, + {file = "MarkupSafe-2.1.5-cp37-cp37m-win32.whl", hash = "sha256:4096e9de5c6fdf43fb4f04c26fb114f61ef0bf2e5604b6ee3019d51b69e8c371"}, + {file = "MarkupSafe-2.1.5-cp37-cp37m-win_amd64.whl", hash = "sha256:4275d846e41ecefa46e2015117a9f491e57a71ddd59bbead77e904dc02b1bed2"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:656f7526c69fac7f600bd1f400991cc282b417d17539a1b228617081106feb4a"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:97cafb1f3cbcd3fd2b6fbfb99ae11cdb14deea0736fc2b0952ee177f2b813a46"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1f3fbcb7ef1f16e48246f704ab79d79da8a46891e2da03f8783a5b6fa41a9532"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fa9db3f79de01457b03d4f01b34cf91bc0048eb2c3846ff26f66687c2f6d16ab"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ffee1f21e5ef0d712f9033568f8344d5da8cc2869dbd08d87c84656e6a2d2f68"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:5dedb4db619ba5a2787a94d877bc8ffc0566f92a01c0ef214865e54ecc9ee5e0"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:30b600cf0a7ac9234b2638fbc0fb6158ba5bdcdf46aeb631ead21248b9affbc4"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:8dd717634f5a044f860435c1d8c16a270ddf0ef8588d4887037c5028b859b0c3"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-win32.whl", hash = "sha256:daa4ee5a243f0f20d528d939d06670a298dd39b1ad5f8a72a4275124a7819eff"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-win_amd64.whl", hash = "sha256:619bc166c4f2de5caa5a633b8b7326fbe98e0ccbfacabd87268a2b15ff73a029"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:7a68b554d356a91cce1236aa7682dc01df0edba8d043fd1ce607c49dd3c1edcf"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:db0b55e0f3cc0be60c1f19efdde9a637c32740486004f20d1cff53c3c0ece4d2"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3e53af139f8579a6d5f7b76549125f0d94d7e630761a2111bc431fd820e163b8"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:17b950fccb810b3293638215058e432159d2b71005c74371d784862b7e4683f3"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4c31f53cdae6ecfa91a77820e8b151dba54ab528ba65dfd235c80b086d68a465"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:bff1b4290a66b490a2f4719358c0cdcd9bafb6b8f061e45c7a2460866bf50c2e"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:bc1667f8b83f48511b94671e0e441401371dfd0f0a795c7daa4a3cd1dde55bea"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5049256f536511ee3f7e1b3f87d1d1209d327e818e6ae1365e8653d7e3abb6a6"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-win32.whl", hash = "sha256:00e046b6dd71aa03a41079792f8473dc494d564611a8f89bbbd7cb93295ebdcf"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-win_amd64.whl", hash = "sha256:fa173ec60341d6bb97a89f5ea19c85c5643c1e7dedebc22f5181eb73573142c5"}, + {file = "MarkupSafe-2.1.5.tar.gz", hash = "sha256:d283d37a890ba4c1ae73ffadf8046435c76e7bc2247bbb63c00bd1a709c6544b"}, +] + [[package]] name = "mccabe" version = "0.7.0" @@ -1205,6 +1338,20 @@ files = [ {file = "pyflakes-3.2.0.tar.gz", hash = "sha256:1c61603ff154621fb2a9172037d84dca3500def8c8b630657d1701f026f8af3f"}, ] +[[package]] +name = "pygments" +version = "2.18.0" +description = "Pygments is a syntax highlighting package written in Python." +optional = false +python-versions = ">=3.8" +files = [ + {file = "pygments-2.18.0-py3-none-any.whl", hash = "sha256:b8e6aca0523f3ab76fee51799c488e38782ac06eafcf95e7ba832985c8e7b13a"}, + {file = "pygments-2.18.0.tar.gz", hash = "sha256:786ff802f32e91311bff3889f6e9a86e81505fe99f2735bb6d60ae0c5004f199"}, +] + +[package.extras] +windows-terminal = ["colorama (>=0.4.6)"] + [[package]] name = "pylink-square" version = "1.2.1" @@ -1545,6 +1692,17 @@ files = [ {file = "sly-0.5.tar.gz", hash = "sha256:251d42015e8507158aec2164f06035df4a82b0314ce6450f457d7125e7649024"}, ] +[[package]] +name = "snowballstemmer" +version = "2.2.0" +description = "This package provides 29 stemmers for 28 languages generated from Snowball algorithms." +optional = false +python-versions = "*" +files = [ + {file = "snowballstemmer-2.2.0-py2.py3-none-any.whl", hash = "sha256:c8e1716e83cc398ae16824e5572ae04e0d9fc2c6b985fb0f900f5f0c96ecba1a"}, + {file = "snowballstemmer-2.2.0.tar.gz", hash = "sha256:09b16deb8547d3412ad7b590689584cd0fe25ec8db3be37788be3810cbf19cb1"}, +] + [[package]] name = "sortedcontainers" version = "2.4.0" @@ -1556,6 +1714,136 @@ files = [ {file = "sortedcontainers-2.4.0.tar.gz", hash = "sha256:25caa5a06cc30b6b83d11423433f65d1f9d76c4c6a0c90e3379eaa43b9bfdb88"}, ] +[[package]] +name = "sphinx" +version = "7.4.7" +description = "Python documentation generator" +optional = false +python-versions = ">=3.9" +files = [ + {file = "sphinx-7.4.7-py3-none-any.whl", hash = "sha256:c2419e2135d11f1951cd994d6eb18a1835bd8fdd8429f9ca375dc1f3281bd239"}, + {file = "sphinx-7.4.7.tar.gz", hash = "sha256:242f92a7ea7e6c5b406fdc2615413890ba9f699114a9c09192d7dfead2ee9cfe"}, +] + +[package.dependencies] +alabaster = ">=0.7.14,<0.8.0" +babel = ">=2.13" +colorama = {version = ">=0.4.6", markers = "sys_platform == \"win32\""} +docutils = ">=0.20,<0.22" +imagesize = ">=1.3" +importlib-metadata = {version = ">=6.0", markers = "python_version < \"3.10\""} +Jinja2 = ">=3.1" +packaging = ">=23.0" +Pygments = ">=2.17" +requests = ">=2.30.0" +snowballstemmer = ">=2.2" +sphinxcontrib-applehelp = "*" +sphinxcontrib-devhelp = "*" +sphinxcontrib-htmlhelp = ">=2.0.0" +sphinxcontrib-jsmath = "*" +sphinxcontrib-qthelp = "*" +sphinxcontrib-serializinghtml = ">=1.1.9" +tomli = {version = ">=2", markers = "python_version < \"3.11\""} + +[package.extras] +docs = ["sphinxcontrib-websupport"] +lint = ["flake8 (>=6.0)", "importlib-metadata (>=6.0)", "mypy (==1.10.1)", "pytest (>=6.0)", "ruff (==0.5.2)", "sphinx-lint (>=0.9)", "tomli (>=2)", "types-docutils (==0.21.0.20240711)", "types-requests (>=2.30.0)"] +test = ["cython (>=3.0)", "defusedxml (>=0.7.1)", "pytest (>=8.0)", "setuptools (>=70.0)", "typing_extensions (>=4.9)"] + +[[package]] +name = "sphinxcontrib-applehelp" +version = "1.0.8" +description = "sphinxcontrib-applehelp is a Sphinx extension which outputs Apple help books" +optional = false +python-versions = ">=3.9" +files = [ + {file = "sphinxcontrib_applehelp-1.0.8-py3-none-any.whl", hash = "sha256:cb61eb0ec1b61f349e5cc36b2028e9e7ca765be05e49641c97241274753067b4"}, + {file = "sphinxcontrib_applehelp-1.0.8.tar.gz", hash = "sha256:c40a4f96f3776c4393d933412053962fac2b84f4c99a7982ba42e09576a70619"}, +] + +[package.extras] +lint = ["docutils-stubs", "flake8", "mypy"] +standalone = ["Sphinx (>=5)"] +test = ["pytest"] + +[[package]] +name = "sphinxcontrib-devhelp" +version = "1.0.6" +description = "sphinxcontrib-devhelp is a sphinx extension which outputs Devhelp documents" +optional = false +python-versions = ">=3.9" +files = [ + {file = "sphinxcontrib_devhelp-1.0.6-py3-none-any.whl", hash = "sha256:6485d09629944511c893fa11355bda18b742b83a2b181f9a009f7e500595c90f"}, + {file = "sphinxcontrib_devhelp-1.0.6.tar.gz", hash = "sha256:9893fd3f90506bc4b97bdb977ceb8fbd823989f4316b28c3841ec128544372d3"}, +] + +[package.extras] +lint = ["docutils-stubs", "flake8", "mypy"] +standalone = ["Sphinx (>=5)"] +test = ["pytest"] + +[[package]] +name = "sphinxcontrib-htmlhelp" +version = "2.0.6" +description = "sphinxcontrib-htmlhelp is a sphinx extension which renders HTML help files" +optional = false +python-versions = ">=3.9" +files = [ + {file = "sphinxcontrib_htmlhelp-2.0.6-py3-none-any.whl", hash = "sha256:1b9af5a2671a61410a868fce050cab7ca393c218e6205cbc7f590136f207395c"}, + {file = "sphinxcontrib_htmlhelp-2.0.6.tar.gz", hash = "sha256:c6597da06185f0e3b4dc952777a04200611ef563882e0c244d27a15ee22afa73"}, +] + +[package.extras] +lint = ["docutils-stubs", "flake8", "mypy"] +standalone = ["Sphinx (>=5)"] +test = ["html5lib", "pytest"] + +[[package]] +name = "sphinxcontrib-jsmath" +version = "1.0.1" +description = "A sphinx extension which renders display math in HTML via JavaScript" +optional = false +python-versions = ">=3.5" +files = [ + {file = "sphinxcontrib-jsmath-1.0.1.tar.gz", hash = "sha256:a9925e4a4587247ed2191a22df5f6970656cb8ca2bd6284309578f2153e0c4b8"}, + {file = "sphinxcontrib_jsmath-1.0.1-py2.py3-none-any.whl", hash = "sha256:2ec2eaebfb78f3f2078e73666b1415417a116cc848b72e5172e596c871103178"}, +] + +[package.extras] +test = ["flake8", "mypy", "pytest"] + +[[package]] +name = "sphinxcontrib-qthelp" +version = "1.0.8" +description = "sphinxcontrib-qthelp is a sphinx extension which outputs QtHelp documents" +optional = false +python-versions = ">=3.9" +files = [ + {file = "sphinxcontrib_qthelp-1.0.8-py3-none-any.whl", hash = "sha256:323d6acc4189af76dfe94edd2a27d458902319b60fcca2aeef3b2180c106a75f"}, + {file = "sphinxcontrib_qthelp-1.0.8.tar.gz", hash = "sha256:db3f8fa10789c7a8e76d173c23364bdf0ebcd9449969a9e6a3dd31b8b7469f03"}, +] + +[package.extras] +lint = ["docutils-stubs", "flake8", "mypy"] +standalone = ["Sphinx (>=5)"] +test = ["defusedxml (>=0.7.1)", "pytest"] + +[[package]] +name = "sphinxcontrib-serializinghtml" +version = "1.1.10" +description = "sphinxcontrib-serializinghtml is a sphinx extension which outputs \"serialized\" HTML files (json and pickle)" +optional = false +python-versions = ">=3.9" +files = [ + {file = "sphinxcontrib_serializinghtml-1.1.10-py3-none-any.whl", hash = "sha256:326369b8df80a7d2d8d7f99aa5ac577f51ea51556ed974e7716cfd4fca3f6cb7"}, + {file = "sphinxcontrib_serializinghtml-1.1.10.tar.gz", hash = "sha256:93f3f5dc458b91b192fe10c397e324f262cf163d79f3282c158e8436a2c4511f"}, +] + +[package.extras] +lint = ["docutils-stubs", "flake8", "mypy"] +standalone = ["Sphinx (>=5)"] +test = ["pytest"] + [[package]] name = "spsdk" version = "2.2.0" @@ -1695,4 +1983,4 @@ test = ["big-O", "importlib-resources", "jaraco.functools", "jaraco.itertools", [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "3233d5ed964b6e20ed75b692e84caa56c98921f703b3b3acba7754767d34ea74" +content-hash = "f7310669eab08fe6512b75b12b12fc689c6a49c86bb9b14065f47ac31500453f" diff --git a/pyproject.toml b/pyproject.toml index 70e71bf..5282587 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,6 +40,7 @@ flake8 = "^7.1" isort = "^5.13.2" mypy = "^1.4" types-requests = "^2.32" +sphinx = "^7" [tool.black] target-version = ["py39"] diff --git a/src/nitrokey/__init__.py b/src/nitrokey/__init__.py index e69de29..d05b856 100644 --- a/src/nitrokey/__init__.py +++ b/src/nitrokey/__init__.py @@ -0,0 +1,3 @@ +""" +Nitrokey Python SDK +""" diff --git a/src/nitrokey/nk3/secrets_app.py b/src/nitrokey/nk3/secrets_app.py index e1b6bc6..c2753c7 100644 --- a/src/nitrokey/nk3/secrets_app.py +++ b/src/nitrokey/nk3/secrets_app.py @@ -650,6 +650,7 @@ def encode_properties_to_send( def calculate(self, cred_id: bytes, challenge: Optional[int] = None) -> bytes: """ Calculate the OTP code for the credential named `cred_id`, and with challenge `challenge`. + :param cred_id: The name of the credential :param challenge: Challenge for the calculations (TOTP only). Should be equal to: timestamp/period. The commonly used period value is 30.