{"id":19681318,"url":"https://github.com/romansky/circuits","last_synced_at":"2026-05-15T02:37:07.765Z","repository":{"id":6480908,"uuid":"7721099","full_name":"romansky/circuits","owner":"romansky","description":"Node.js RESTful socket.io routing","archived":false,"fork":false,"pushed_at":"2014-07-01T13:34:04.000Z","size":476,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-04T03:59:20.105Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"CoffeeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/romansky.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-01-20T20:01:30.000Z","updated_at":"2022-07-20T15:28:32.000Z","dependencies_parsed_at":"2022-09-07T10:13:00.020Z","dependency_job_id":null,"html_url":"https://github.com/romansky/circuits","commit_stats":null,"previous_names":["uniformlyrandom/circuits"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/romansky/circuits","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romansky%2Fcircuits","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romansky%2Fcircuits/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romansky%2Fcircuits/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romansky%2Fcircuits/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/romansky","download_url":"https://codeload.github.com/romansky/circuits/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romansky%2Fcircuits/sbom","scorecard":{"id":783792,"data":{"date":"2025-08-11","repo":{"name":"github.com/romansky/circuits","commit":"1fccde18cc599f4ef8c0c91824387a8f10e2c3b1"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":"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":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","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":"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":"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":"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":"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":"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":"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":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"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"}}]},"last_synced_at":"2025-08-23T05:33:51.086Z","repository_id":6480908,"created_at":"2025-08-23T05:33:51.086Z","updated_at":"2025-08-23T05:33:51.086Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33051245,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-15T02:00:06.351Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-11-11T18:07:31.526Z","updated_at":"2026-05-15T02:37:07.745Z","avatar_url":"https://github.com/romansky.png","language":"CoffeeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"circuits \n====\n[![Build Status](https://travis-ci.org/uniformlyrandom/circuits.png)](https://travis-ci.org/uniformlyrandom/circuits)\n\nA simple socket-io framework for client and server communcation around CRUD operations\n\n## Usage\n\ninstall using npm\n\n\tnpm install circuits\n\nBasic client server example [source](https://github.com/uniformlyrandom/circuits/blob/master/examples/simple.coffee)\n\n```coffee\n# port to listen to\ntestPort = 8001\n# create a server\nhttpServer = http.Server()\n# instantiate a Circuits server with a controller router\nserver = new Server httpServer, (controller)-\u003e\n\tswitch controller\n\t\t# match against the requested router to a specific one\n\t\t# every router needs to implement the CRUD operation \n\t\t# it needs to support\n\t\twhen 'echo' then {\n\t\t\t\t\"read\" : (message, id, cb)-\u003e \n\t\t\t\t\t# the first argument for the callback is \n\t\t\t\t\tcb(null,message)\n\t\t\t}\n\n\nhttpServer.listen testPort\n\nclient = sioc.connect(\"http://localhost:#{testPort}\")\n\nclient.on 'connect', -\u003e\n\tclient.emit Operation, 'echo', CRUD.read, 'any bats in here?',(err, data)-\u003e\n\t\tif (data == 'any bats in here?')\n\t\t\tconsole.log 'No bats here I guess..'\n\t\t\tprocess.exit()\n```\n\nToDo:\nExample using Circuits with a Backbone model\nExample using Circuits with a Backbone collection\nExample using Circuits with Express framework\n\n\n## Whats in the box?\n\n#### create Circuits server instance\n\n`new circuits.Server( httpServer, controllerResolver, [acl, redisHost, redisDB, redis, redisPort, circuitChannel] )`\n\n - `httpServer` instance of `require('http').Server`\n - `controllerResolver` function that returns an object with mapping to CRUD operation for provided controller name\n - `acl` the ACL object, if none provided it allowes everything\n - `redisHost` IP address of your redis (default is \"127.0.0.1\")\n - `redisDB` redis db to use (default is 10 )\n - `redisPort` redis port (deault is 6379)\n - `circuitChannel` name space for communication between Circuits instances\n\n#### messages\n\n`circuits.Messages`\nis a map of String =\u003e String of supported Circuits messages\n\nthe `Operation` message is a request for a message to be dispatched to respective controller on the server \n\narguments\n\nname | type | description\n-----|------|------------\n`controller name` | `String` | the controller to dispatch this message to\n`crudOp` | `circuits.CRUD.{create,read..}` | the crud operation\n`params` | `Object` | parameters to be passed\n`operation params` | `Object*` | depending on the CRUD operation, a set of required fields\n\nrequired `operation params` for the different CRUD operations\n\n`CRUD.create`\n\nname | type | description\n-----|------|------------\n`data` | `Object` | the object to be created\n\n`CRUD.read`\n\nname | type | description\n-----|------|------------\n`id` | `String` | resource id\n\n`CRUD.update`\n\nname | type | description\n-----|------|------------\n`id` | `String` | resource id\n`data` | `Object` | the object to update with\n\n`CRUD.delete`\n\nname | type | description\n-----|------|------------\n`id` | `String` | resource id\n\n#### CRUD operations\n\n`circuits.CRUD`\n\nis simply a map of String =\u003e String of  \n`create`, `read, `update, `delete` and `patch`\n\n#### ACL\n\n`circuits.ACL` constructor arguments\n\nname | type | description\n-----|------|------------\n`rules` | `Object` | mapping of controllers to allowed crud operations and respective user groups\n`controller+crud groups` | `function(userID, callback = function(err, groups))` | function that returns groups for a given user ID\n`optional check` | `function(userID, model, modelId, crudOp, callback = function(message,boolean)` | an optional check for special cases were you want to enforce a finer grained ACL, for example for when only a creater of a resource is only allowed to do a write operation on that model..\n\nexample of a controller+crud group rules\n\n```javascript\n{\n\t\"MyModel\" : {\n\t\t\"create\" : [\"public\"],\n\t\t\"read\" : [\"public\"],\n\t\t\"update\" : [\"users\"],\n\t\t\"delete\" : []\n\t},\n\t\"SecretModel\" : {\n\t\t\"create\" : [\"users\"],\n\t\t\"read\" : [\"users\"],\n\t\t\"update\" : [\"users\"],\n\t\t\"delete\" : [\"users\"]\n\t}\n}\n```\n\nis simply an object mapping controllers to respective allowed crud operations\n\n\n\n## High Level Design\n\n\u003cimg src=\"https://docs.google.com/drawings/d/1ELXFEhsntD2jyYehrcceV-sUHDaTgFCz3Hw180TCKOs/pub?w=982\u0026amp;h=867\"\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromansky%2Fcircuits","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fromansky%2Fcircuits","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromansky%2Fcircuits/lists"}