{"id":13585560,"url":"https://github.com/google/nsscache","last_synced_at":"2026-01-10T14:12:34.539Z","repository":{"id":17453854,"uuid":"20227767","full_name":"google/nsscache","owner":"google","description":"asynchronously synchronise local NSS databases with remote directory services","archived":false,"fork":false,"pushed_at":"2025-03-10T00:43:12.000Z","size":1259,"stargazers_count":146,"open_issues_count":9,"forks_count":56,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-03-22T00:42:17.637Z","etag":null,"topics":["getpwent","ldap","nss","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/google.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"COPYING","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2014-05-27T16:57:00.000Z","updated_at":"2025-03-10T00:43:15.000Z","dependencies_parsed_at":"2024-01-21T00:31:17.668Z","dependency_job_id":"3895b9da-88b1-4e56-a9e1-e21cb69c70da","html_url":"https://github.com/google/nsscache","commit_stats":null,"previous_names":[],"tags_count":45,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fnsscache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fnsscache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fnsscache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fnsscache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/google","download_url":"https://codeload.github.com/google/nsscache/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247636127,"owners_count":20970865,"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":["getpwent","ldap","nss","python"],"created_at":"2024-08-01T15:05:00.908Z","updated_at":"2026-01-10T14:12:34.453Z","avatar_url":"https://github.com/google.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"nsscache - Asynchronously synchronise local NSS databases with remote directory services\n========================================================================================\n\n![ci](https://github.com/google/nsscache/workflows/CI/badge.svg)\n[![codecov](https://codecov.io/gh/google/nsscache/branch/master/graph/badge.svg)](https://codecov.io/gh/google/nsscache)\n\n*nsscache* is a commandline tool and Python library that synchronises a local NSS cache from a remote directory service, such as LDAP.\n\nAs soon as you have more than one machine in your network, you want to share usernames between those systems. Linux administrators have been brought up on the convention of LDAP or NIS as a directory service, and `/etc/nsswitch.conf`, `nss_ldap.so`, and `nscd` to manage their nameservice lookups.\n\nEven small networks will have experienced intermittent name lookup failures, such as a mail receiver sometimes returning \"User not found\" on a mailbox destination because of a slow socket over a congested network, or erratic cache behaviour by `nscd`. To combat this problem, we have separated the network from the NSS lookup codepath, by using an asynchronous cron job and a glorified script, to improve the speed and reliability of NSS lookups.  We [presented at linux.conf.au 2008](https://mirror.linux.org.au/pub/linux.conf.au/2008/Wed/mel8-056.ogg), ([PDF slides](https://mirror.linux.org.au/pub/linux.conf.au/2008/slides/056-posix-jaq-v.pdf)) on the problems in NSS and the requirements for a solution.\n\nHere, we present to you this glorified script, which is just a little more extensible than\n\n    ldapsearch | awk \u003e /etc/passwd\n\nRead the [Google Code blog announcement](http://www.anchor.com.au/blog/2009/02/nsscache-and-ldap-reliability/) for nsscache, or more about the [motivation behind this tool](https://github.com/google/nsscache/wiki/MotivationBehindNssCache).\n\nHere's a [testimonial from Anchor Systems](http://www.anchor.com.au/blog/2009/02/nsscache-and-ldap-reliability/) on their deployment of nsscache.\n\n\nPair *nsscache* with https://github.com/google/libnss-cache to integrate the local cache with your name service switch.\n\n---\n\nMailing list: https://groups.google.com/forum/#!forum/nsscache-discuss\n\nIssue history is at https://code.google.com/p/nsscache/issues/list\n\n---\n\n# Contributions\n\nPlease format your code with https://github.com/google/yapf (installable as `pip install yapf` or the `yapf3` package on Debian systems) before sending pull requests.\n\n# Testing\n\nThe [`Dockerfile`](Dockerfile) sets up a container that then executes the python unit tests and [`tests/slapd-regtest`](tests/slapd-regtest) integration test.  Execute that with `podman build .` to get a reproducible test environment.\n\nThe `Dockerfile` mimics the test environment used by the Github Actions workflow [`.github/workflows/ci.yml`](.github/workflows/ci.yml)\n\n# Setup\n\n## `gcs` source\n\nInstall\n[Google Cloud Storage Python Client](https://cloud.google.com/python/docs/reference/storage/latest):\n`sudo pip install google-cloud-storage`\n\nFor Compute Engine Instances to use the `gcs` source, their attached service\naccount must have the _Storage Object Viewer_ role on the GCS bucket storing\nthe `passwd`, `group`, and `shadow` objects, or on the objects themselves\nif using find-grained access controls.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Fnsscache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoogle%2Fnsscache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Fnsscache/lists"}