{"id":25315039,"url":"https://github.com/lexicality/secret-token","last_synced_at":"2025-10-28T19:30:55.904Z","repository":{"id":52677306,"uuid":"334683756","full_name":"Lexicality/secret-token","owner":"Lexicality","description":"Easy manipulation of RFC8959 secret-token URIs","archived":false,"fork":false,"pushed_at":"2021-04-21T11:13:58.000Z","size":27,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-19T09:37:03.891Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://pypi.org/project/secret-token/","language":"Python","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/Lexicality.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-01-31T15:08:47.000Z","updated_at":"2021-04-21T11:14:01.000Z","dependencies_parsed_at":"2022-08-20T14:21:00.693Z","dependency_job_id":null,"html_url":"https://github.com/Lexicality/secret-token","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lexicality%2Fsecret-token","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lexicality%2Fsecret-token/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lexicality%2Fsecret-token/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lexicality%2Fsecret-token/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lexicality","download_url":"https://codeload.github.com/Lexicality/secret-token/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238701773,"owners_count":19516223,"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-02-13T17:40:00.495Z","updated_at":"2025-10-28T19:30:50.610Z","avatar_url":"https://github.com/Lexicality.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# secret-token\n\nThis is a utility library for working with [RFC8959][rfc8959] secret-token URIs.\n\nIt provides 3 functions:\n\n- `encode` - Encodes a generated secret into a URI\n- `decode` - Decodes a URI for passing secrets to systems that do not support URI data\n- `validate` - Checks if a secret-token URI is conforms to the spec\n\nThere are two main expected use cases for this library:\n\n1. Creating a service that generates and validates user secrets such as an API server. As per the RFC all secrets should be stored at rest encoded as URIs, so the `encode` function is used immediately after generating tokens and the `validate` function is called when recieving tokens from users.\n2. Use in a service that talks to external services that do _not_ support RFC8959 but where you would like to store all your secrets using it. For example, in an environment with an appropriate secret token present:\n\n```\nexport API_TOKEN='secret-token:E92FB7EB-D882-47A4-A265-A0B6135DC842%20foo'\n```\n\nThe decoding code will look like this:\n\n```python\nimport os\n\nimport secret_token\n\nAPI_TOKEN = secret_token.decode(os.environ.get[\"API_TOKEN\"])\nprint(API_TOKEN)\n```\n\nThe code prints\n\n```\nE92FB7EB-D882-47A4-A265-A0B6135DC842 foo\n```\n\n[rfc8959]: https://tools.ietf.org/html/rfc8959 \"The \\\"secret-token\\\" URI Scheme\"\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flexicality%2Fsecret-token","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flexicality%2Fsecret-token","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flexicality%2Fsecret-token/lists"}