{"id":23960414,"url":"https://github.com/jamesponddotco/credential-go","last_synced_at":"2025-06-26T19:37:12.269Z","repository":{"id":270776642,"uuid":"910296722","full_name":"jamesponddotco/credential-go","owner":"jamesponddotco","description":"[READ-ONLY] A simple interface for retrieving secrets from systemd's credential management system.","archived":false,"fork":false,"pushed_at":"2024-12-30T23:08:15.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"trunk","last_synced_at":"2025-06-22T00:59:07.219Z","etag":null,"topics":["go","golang","security","systemd","systemd-credentials","systemd-creds"],"latest_commit_sha":null,"homepage":"https://git.sr.ht/~jamesponddotco/credential-go","language":"Go","has_issues":false,"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/jamesponddotco.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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-30T23:04:43.000Z","updated_at":"2024-12-30T23:09:11.000Z","dependencies_parsed_at":"2025-01-03T02:53:28.070Z","dependency_job_id":"3a4db2e5-6053-4214-ab02-8e36ce41d8c7","html_url":"https://github.com/jamesponddotco/credential-go","commit_stats":null,"previous_names":["jamesponddotco/credential-go"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/jamesponddotco/credential-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesponddotco%2Fcredential-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesponddotco%2Fcredential-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesponddotco%2Fcredential-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesponddotco%2Fcredential-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jamesponddotco","download_url":"https://codeload.github.com/jamesponddotco/credential-go/tar.gz/refs/heads/trunk","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesponddotco%2Fcredential-go/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262133385,"owners_count":23264194,"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":["go","golang","security","systemd","systemd-credentials","systemd-creds"],"created_at":"2025-01-06T19:28:01.283Z","updated_at":"2025-06-26T19:37:12.245Z","avatar_url":"https://github.com/jamesponddotco.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# credential\n\n[![Go Documentation](https://godocs.io/git.sr.ht/~jamesponddotco/credential-go?status.svg)](https://godocs.io/git.sr.ht/~jamesponddotco/credential-go)\n[![Go Report Card](https://goreportcard.com/badge/git.sr.ht/~jamesponddotco/credential-go)](https://goreportcard.com/report/git.sr.ht/~jamesponddotco/credential-go)\n[![Coverage Report](https://img.shields.io/badge/coverage-100%25-brightgreen)](https://git.sr.ht/~jamesponddotco/credential-go/tree/trunk/item/cover.out)\n[![builds.sr.ht status](https://builds.sr.ht/~jamesponddotco/credential-go.svg)](https://builds.sr.ht/~jamesponddotco/credential-go?)\n\nPackage `credential` provides a simple and secure interface for\nretrieving secrets from [`systemd`'s credential management\nsystem](https://systemd.io/CREDENTIALS/). It enables Go applications to\nsafely access sensitive information such as cryptographic keys,\ncertificates, passwords, and identity data in `systemd`-managed\nservices.\n\n## Installation\n\nTo install `credential` and use it in your project, run:\n\n```console\ngo get git.sr.ht/~jamesponddotco/credential-go@latest\n```\n\nYou'll want to ensure your system meets these requirements:\n\n- Go 1.23 or later.\n- `systemd`-based Linux distribution.\n- Proper `systemd` service configuration with credentials.\n\n## Documentation\n\n- Please [see the Go reference\n  documentation](https://godocs.io/git.sr.ht/~jamesponddotco/credential-go)\n  for more information about the package.\n- Refer to [`systemd` credentials\n  documentation](https://systemd.io/CREDENTIALS/) for more details on\n  its credential management system.\n\n## Usage\n\nTo use `credential`, your `systemd` service unit must be configured with\ncredentials, as the `CREDENTIALS_DIRECTORY` environment variable\nrequired by the package is set by `systemd` when running as a service\nwith credentials configured.\n\nExample `systemd` service configuration:\n\n```ini\n[Unit]\nDescription=My Application Service\n\n[Service]\nExecStart=/usr/local/bin/myapp\nLoadCredential=myapp-database-password:/path/to/secret/file\nPrivateMounts=yes\n\n[Install]\nWantedBy=multi-user.target\n```\n\nHere's a basic example of how to use the package:\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\n\t\"git.sr.ht/~jamesponddotco/credential-go\"\n)\n\nfunc main() {\n\t// Open the credential store with your application's name as the prefix.\n\tstore, err := credential.Open(\"myapp\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// Retrieve a secret from the store.\n\tsecret, err := store.Get(\"database-password\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// Print the secret or do something else with it.\n\tfmt.Println(\"Database password:\", secret)\n}\n```\n\n## Contributing\n\nAnyone can help make `credential` better. Send patches on the [mailing\nlist](https://lists.sr.ht/~jamesponddotco/credential-devel) and report\nbugs on the [issue\ntracker](https://todo.sr.ht/~jamesponddotco/credential).\n\nYou must sign-off your work using `git commit --signoff`. Follow the\n[Linux kernel developer's certificate of\norigin](https://www.kernel.org/doc/html/latest/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-origin)\nfor more details.\n\nAll contributions are made under [the MIT License](LICENSE.md).\n\n## Resources\n\nThe following resources are available:\n\n- [Package documentation](https://godocs.io/git.sr.ht/~jamesponddotco/credential-go).\n- [Support and general discussions](https://lists.sr.ht/~jamesponddotco/credential-discuss).\n- [Patches and development related questions](https://lists.sr.ht/~jamesponddotco/credential-devel).\n- [Instructions on how to prepare patches](https://git-send-email.io/).\n- [Feature requests and bug reports](https://todo.sr.ht/~jamesponddotco/credential).\n\n---\n\nReleased under the [MIT License](LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesponddotco%2Fcredential-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamesponddotco%2Fcredential-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesponddotco%2Fcredential-go/lists"}