{"id":45978020,"url":"https://github.com/corbaltcode/go-onetimesecret","last_synced_at":"2026-02-28T17:07:56.627Z","repository":{"id":45128180,"uuid":"428483695","full_name":"corbaltcode/go-onetimesecret","owner":"corbaltcode","description":"Go client for One-Time Secret","archived":false,"fork":false,"pushed_at":"2025-03-03T19:26:50.000Z","size":16,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-03T20:30:27.484Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/corbaltcode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-11-16T01:58:50.000Z","updated_at":"2025-03-03T19:26:44.000Z","dependencies_parsed_at":"2022-09-07T13:50:12.653Z","dependency_job_id":null,"html_url":"https://github.com/corbaltcode/go-onetimesecret","commit_stats":null,"previous_names":["corbaltcode/onetimesecret"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/corbaltcode/go-onetimesecret","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corbaltcode%2Fgo-onetimesecret","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corbaltcode%2Fgo-onetimesecret/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corbaltcode%2Fgo-onetimesecret/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corbaltcode%2Fgo-onetimesecret/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/corbaltcode","download_url":"https://codeload.github.com/corbaltcode/go-onetimesecret/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corbaltcode%2Fgo-onetimesecret/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29943807,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-28T13:49:17.081Z","status":"ssl_error","status_checked_at":"2026-02-28T13:48:50.396Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2026-02-28T17:07:53.935Z","updated_at":"2026-02-28T17:07:55.541Z","avatar_url":"https://github.com/corbaltcode.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-onetimesecret\n\ngo-onetimesecret is a Go client for [One-Time Secret](https://onetimesecret.com). It includes a command-line interface, [ots](https://github.com/corbaltcode/go-onetimesecret/tree/main/cmd/ots).\n\n## Installation\n\n```\n$ go get github.com/corbaltcode/go-onetimesecret\n```\n\n## Creating a Client\n\nAll operations are performed by calling methods on a `Client`. Create a `Client` by supplying your username (email) and password from [onetimesecret.com](https://onetimesecret.com).\n\n```\nimport ots \"github.com/corbaltcode/go-onetimesecret\"\n\nclient := ots.Client{\n  Username: \"user@example.com\",\n  Key: \"my-api-key\",\n}\n```\n\n## Storing \u0026 Retrieving Secrets\n\nUse `Client.Put` and `Client.Get` to store and retrieve secrets. Once a secret has been retrieved, it's gone.\n\n```\nmetadata, err := client.Put(\"the launch codes\", \"\", 0, \"\")\nif err != nil { ... }\n\nsecret, err := client.Get(metadata.SecretKey, \"\")\nif err != nil { ... }\n\n// prints \"the launch codes\"\nprint(secret)\n\n// now the secret is gone\nsecret, err = client.Get(metadata.SecretKey, \"\")\nif errors.Is(err, ots.ErrNotFound) {\n  // handle error\n}\n```\n\n## Using a Passphrase\n\nProtect a secret by providing a passphrase to `Client.Put` and `Client.Generate` (see below). The passphrase will be required to retrieve or destroy the secret.\n\n```\npassphrase := xyzzy\n\nmetadata, err := client.Put(\"the launch codes\", passphrase, 0, \"\")\nif err != nil { ... }\n\nsecret, err = client.Get(metadata.SecretKey, \"wrong passphrase\")\nif errors.Is(err, ots.ErrNotFound) {\n  // handle error\n}\n\nsecret, err := client.Get(metadata.SecretKey, passphrase)\nif err != nil { ... }\n\n// prints \"the launch codes\"\nprint(secret)\n```\n\n## Generating Secrets\n\nOne-Time Secret can generate short, unique secrets.\n\n```\npassphrase := \"xyzzy\"\n\nsecret, metadata, err := client.Generate(passphrase, 0, \"\")\nif err != nil { ... }\n\n// prints the generated secret\nprint(secret)\n```\n\n## Destroying Secrets\n\nDestroy a secret by passing the metadata key and passphrase, if necessary, to `Client.Burn`.\n\n```\npassphrase := \"xyzzy\"\n\nmetadata, err := client.Put(\"the launch codes\", passphrase, 0, \"\")\nif err != nil { ... }\n\n// destroys the secret\nmetadata, err = client.Burn(metadata.MetadataKey, passphrase)\nif err != nil { ... }\n\n// now the secret is gone\nmetadata, err = client.Burn(metadata.MetadataKey, passphrase)\nif errors.Is(err, ots.ErrNotFound) {\n  // handle error\n}\n```\n\n## Sharing Secrets\n\nUse `Metadata.SecretURL` to get a URL for sharing the secret:\n\n```\nmetadata, err := client.Generate(\"\", 0, \"\")\nif err != nil { ... }\n\nurl, err := metadata.SecretURL()\nif err != nil { ... }\n\n// prints \"https://onetimesecret.com/secret/\u003csecret-key\u003e\"\nprint(url.String())\n```\n\n## Testing\n\nSet the environment variables `OTS_USERNAME` and `OTS_KEY`, then:\n\n```\ngo test ./...\n```\n\n## Contributing\n\nSubmit issues and pull requests to [corbaltcode/go-onetimesecret](https://github.com/corbaltcode/go-onetimesecret) on GitHub.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorbaltcode%2Fgo-onetimesecret","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcorbaltcode%2Fgo-onetimesecret","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorbaltcode%2Fgo-onetimesecret/lists"}