{"id":20767008,"url":"https://github.com/binded/keyed-tus-store","last_synced_at":"2025-03-11T18:51:28.595Z","repository":{"id":97906340,"uuid":"68984298","full_name":"binded/keyed-tus-store","owner":"binded","description":"Higher level tus store that encodes key in upload ID","archived":false,"fork":false,"pushed_at":"2016-09-27T05:20:45.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-01T05:06:37.077Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/binded.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-23T03:14:25.000Z","updated_at":"2017-01-28T04:52:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"a4359486-27a6-4197-a0a7-4c893cf1f8fa","html_url":"https://github.com/binded/keyed-tus-store","commit_stats":null,"previous_names":["blockai/keyed-tus-store"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binded%2Fkeyed-tus-store","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binded%2Fkeyed-tus-store/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binded%2Fkeyed-tus-store/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binded%2Fkeyed-tus-store/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/binded","download_url":"https://codeload.github.com/binded/keyed-tus-store/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243094609,"owners_count":20235531,"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":"2024-11-17T11:27:13.207Z","updated_at":"2025-03-11T18:51:28.573Z","avatar_url":"https://github.com/binded.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# keyed-tus-store\n\n[![Build Status](https://travis-ci.org/blockai/keyed-tus-store.svg?branch=master)](https://travis-ci.org/blockai/keyed-tus-store)\n\n[![tus-store-compatible](https://github.com/blockai/abstract-tus-store/raw/master/badge.png)](https://github.com/blockai/abstract-tus-store)\n\nHigher level [tus store](https://github.com/blockai/abstract-tus-store).\n\nTakes a tus store and returns a new tus store which behaves mostly the\nexcept that it transforms upload IDs returned by `create(key)` so that\nthe transformed upload ID also encodes the `key` argument.\n\nOther functions are wrapped so that the original upload ID is decoded\nbefore being passed.\n\nAn additional `decodeKey(uploadId)` function is exposed which returns\nthe key associated with an upload ID.\n\nThe idea behind this store was to make it easier to retrieve a key given\nan upload ID without requiring additional state.\n\n## Install\n\n```bash\nnpm install --save keyed-tus-store\n```\n\nRequires Node v6+\n\n## Usage\n\nSee [./test](./test) directory for usage examples.\n\n**keyedStore(storeToWrap, secret)**\n\nWhere `storeToWrap` is a tus store and `secret` is a secret passphrase\nused to encrypt and decrypt the upload IDs.\n\nReturns a tus store.\n\n**decodeKey(uploadId)**\n\nReturns the `key` encoded in `uploadId`.\n\n```javascript\nimport keyedStore from 'keyed-tus-store'\nimport { memstore } from 'abstract-tus-store'\n\nconst store = keyedStore(memstore(), 'some secret')\n\nstore.create('some-key').then(({ uploadId }) =\u003e {\n  const key = store.decodeKey(uploadId)\n  key === 'some-key' // =\u003e true\n})\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinded%2Fkeyed-tus-store","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbinded%2Fkeyed-tus-store","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinded%2Fkeyed-tus-store/lists"}