{"id":26552253,"url":"https://github.com/thorgate/python-linux-keyutils","last_synced_at":"2026-05-09T01:06:17.592Z","repository":{"id":270473292,"uuid":"910487048","full_name":"thorgate/python-linux-keyutils","owner":"thorgate","description":"Linux kernel key-management binding for python using PyO3","archived":false,"fork":false,"pushed_at":"2024-12-31T13:01:19.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-31T13:20:09.654Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thorgate.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-31T12:09:42.000Z","updated_at":"2024-12-31T13:01:18.000Z","dependencies_parsed_at":"2024-12-31T13:20:13.875Z","dependency_job_id":"9dc833ed-c5f7-426d-aeae-762ff02122d9","html_url":"https://github.com/thorgate/python-linux-keyutils","commit_stats":null,"previous_names":["thorgate/python-linux-keyutils"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thorgate%2Fpython-linux-keyutils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thorgate%2Fpython-linux-keyutils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thorgate%2Fpython-linux-keyutils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thorgate%2Fpython-linux-keyutils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thorgate","download_url":"https://codeload.github.com/thorgate/python-linux-keyutils/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244931497,"owners_count":20534008,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-22T08:34:58.445Z","updated_at":"2026-05-09T01:06:12.567Z","avatar_url":"https://github.com/thorgate.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"===============================\nLinux kernel keyutils binddings\n===============================\n\nLinux kernel provides a secure storage for sensitive data. This package provides a way to set, retrieve\nand invalidate key-value pairs in the kernel keyring in session scope.\n\nPackage is in early stage of development, and using keyrings other than session storage is currently\nunsupported.\n\n####\nWhy?\n####\n\nExisting `keyring \u003chttps://pypi.org/project/keyring/\u003e`_ package is very powerful, but somewhat complex\nand heavy.\n\n`keyctl \u003chttps://pypi.org/project/keyctl/\u003e`_ uses subprocess instead of system call, which introduces\npossible points of failure and requires keyctl utility.\n\nThis package uses rust and PyO3 to make system calls directly to the kernel.\n\n############\nUsage\n############\n\nUse following code snippet for inspiration::\n\n  from python_linux_keyutils import get_secret, set_secret, invalidate_secret, KeyRingIdentifier\n\n  # By default, Session keyring is used\n  set_secret(\"test_key\", b\"test value\")\n  print(get_secret(\"test_key\"))\n  # b'test value'\n\n  # You can also specify a different keyring\n  set_secret(\"test_key_2\", b\"\\0\\0\\0\", key_ring=KeyRingIdentifier.User)\n  print(get_secret(\"test_key_2\", key_ring=KeyRingIdentifier.User))\n  # b'\\x00\\x00\\x00'\n\n  # set_secret doesn't automatically create keyring if it doesn't exist, but this can be changed with\n  # `create` keyword argument\n  set_secret(\"test_key_3\", b\"Hello kernel secrets\", key_ring=KeyRingIdentifier.Process)\n  # Raises KeyError\n  set_secret(\"test_key_3\", b\"Hello kernel secrets\", key_ring=KeyRingIdentifier.Process, create=True)\n  get_secret(\"test_key_3\", key_ring=KeyRingIdentifier.Process)\n  # b'Hello kernel secrets'\n\n**********\nExceptions\n**********\n\nThe module may raise following exceptions\n\n- **OSError**: If system call fails due to access being denied, quota exceeded, bad address, write error, etc.\n- **ValueError**: If key name is invalid\n- **KeyError**: If key doesn't exist, or is expired, or keyring doesn't exist\n- **MemoryError**: If memory allocation fails\n- **RuntimeError**: If underlying rust library reports that operation is not supported\n\n############\nContributing\n############\n\nContributions are what make the open source community such an amazing place to learn, inspire, and create.\nAny contributions you make are greatly appreciated.\n\n**********\nDeveloping\n**********\n\nSee `maturin documentation https://github.com/PyO3/maturin` for more information on how to run the project locally\nin development mode.\n\n**********\nOpening MR\n**********\n\n1. Clone the Project\n2. Create your Feature Branch (``git checkout -b feature/AmazingFeature``)\n3. Commit your Changes (``git commit -m 'Add some AmazingFeature'``)\n4. Push to the Branch (``git push origin feature/AmazingFeature``)\n5. Open a Merge Request\n\n#######\nLicense\n#######\n\nDistributed under the MIT License. See LICENSE for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthorgate%2Fpython-linux-keyutils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthorgate%2Fpython-linux-keyutils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthorgate%2Fpython-linux-keyutils/lists"}