{"id":15680545,"url":"https://github.com/doowb/accountdown-token","last_synced_at":"2026-03-10T11:31:01.764Z","repository":{"id":26795993,"uuid":"30254412","full_name":"doowb/accountdown-token","owner":"doowb","description":"Token authentication for accountdown","archived":false,"fork":false,"pushed_at":"2015-10-16T02:54:16.000Z","size":160,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-10T12:19:09.724Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"rqlite/rqlite","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/doowb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-03T17:10:28.000Z","updated_at":"2021-04-12T22:09:25.000Z","dependencies_parsed_at":"2022-07-08T10:25:02.255Z","dependency_job_id":null,"html_url":"https://github.com/doowb/accountdown-token","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/doowb/accountdown-token","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doowb%2Faccountdown-token","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doowb%2Faccountdown-token/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doowb%2Faccountdown-token/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doowb%2Faccountdown-token/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/doowb","download_url":"https://codeload.github.com/doowb/accountdown-token/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doowb%2Faccountdown-token/sbom","scorecard":{"id":352293,"data":{"date":"2025-08-11","repo":{"name":"github.com/doowb/accountdown-token","commit":"efa277d33fc4202562b233bd21ce02e6a8c0b2d2"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":1,"reason":"Found 2/15 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T08:38:47.161Z","repository_id":26795993,"created_at":"2025-08-18T08:38:47.161Z","updated_at":"2025-08-18T08:38:47.161Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30332259,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T05:25:20.737Z","status":"ssl_error","status_checked_at":"2026-03-10T05:25:17.430Z","response_time":106,"last_error":"SSL_read: 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":"2024-10-03T16:42:44.682Z","updated_at":"2026-03-10T11:31:01.450Z","avatar_url":"https://github.com/doowb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# accountdown-token [![NPM version](https://badge.fury.io/js/accountdown-token.svg)](http://badge.fury.io/js/accountdown-token)\n\n\u003e Token authentication for accountdown\n\nInstall with [npm](https://www.npmjs.com/)\n\n```sh\n$ npm i accountdown-token --save\n```\n\n## Running tests\n\nInstall dev dependencies:\n\n```sh\n$ npm i -d \u0026\u0026 npm test\n```\n\n## Usage\n\n```js\nvar Token = require('accountdown-token');\nvar accountdown = require('accountdown');\nvar level = require('level');\n\nvar db = level('tmp/users.db');\nvar users = accountdown(db, {\n  login: {\n    token: Token\n  }\n});\n\nvar username = 'doowb';\nvar opts = {\n    login: { token: { username: username, token: 'foobarbaz' } },\n    value: { name: 'Brian' }\n};\n\nusers.create(username, opts, function (err) {\n  if (err) return console.log('Error creating user', err);\n\n  users.verify('token', opts.login.token, function (err, ok, id) {\n    if (err) return console.log('Error', err);\n    if (ok === false) return console.log('Invalid token for ' + id);\n    console.log('Valid token for ' + id);\n  });\n});\n```\n\n## API\n\n### [.verify](index.js#L47)\n\nVerify that the token is correct and still valid (e.g. not expired)\n\n**Params**\n\n* `creds` **{Object}**: Credentials object containing a `username` and `token` to validate.\n* `cb` **{Function}**: Callback that takes `err, ok, id`\n\n**Example**\n\n```js\nlogin.verify({ username: 'doowb', token: 'XXXXXXXXXXXX' }, function (err, ok, id) {\n  if (err) return console.log('Error validating token');\n  if (ok === true) return console.log('valid token for ' + id);\n  console.log('Invalid token for ' + id);\n});\n```\n\n### [.create](index.js#L97)\n\nCreate a new user token for the given id and credentials.\n\n**Params**\n\n* `id` **{String}**: Identifier of the account being created.\n* `creds` **{Object}**: Credentials object used for creating the token.\n* `returns` **{Array}**: Array of rows to be added to the [accountdown](https://github.com/substack/accountdown)database\n\n**Example**\n\n```js\nlogin.create('doowb', { username: 'doowb' });\n```\n\n## Related projects\n\n* [accountdown](https://github.com/substack/accountdown): persistent accounts backed to leveldb\n* [level](https://github.com/Level/level): Fast \u0026 simple storage - a Node.js-style LevelDB wrapper (a convenience package bundling LevelUP \u0026… [more](https://github.com/Level/level)\n* [levelup](https://github.com/level/levelup): Fast \u0026 simple storage - a Node.js-style LevelDB wrapper\n* [leveldown](https://github.com/level/leveldown): A Node.js LevelDB binding, primary backend for LevelUP\n\n## Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/doowb/accountdown-token/issues)\n\n## Author\n\n**Brian Woodward**\n\n+ [github/doowb](https://github.com/doowb)\n+ [twitter/doowb](http://twitter.com/doowb)\n\n## License\n\nCopyright © 2015 Brian Woodward\nReleased under the MIT license.\n\n***\n\n_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on July 23, 2015._","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoowb%2Faccountdown-token","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoowb%2Faccountdown-token","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoowb%2Faccountdown-token/lists"}