{"id":39952519,"url":"https://github.com/a-musing-moose/bakedbeans","last_synced_at":"2026-01-18T20:32:08.061Z","repository":{"id":57413799,"uuid":"117011215","full_name":"a-musing-moose/bakedbeans","owner":"a-musing-moose","description":"A Simple REST Server Mocker","archived":false,"fork":false,"pushed_at":"2018-01-24T21:59:22.000Z","size":23,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-27T11:30:05.389Z","etag":null,"topics":["http-server","mock","rest-api","stub"],"latest_commit_sha":null,"homepage":null,"language":"Python","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/a-musing-moose.png","metadata":{"files":{"readme":"README.rst","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":"2018-01-10T21:10:33.000Z","updated_at":"2024-01-19T10:25:07.000Z","dependencies_parsed_at":"2022-09-05T03:51:07.216Z","dependency_job_id":null,"html_url":"https://github.com/a-musing-moose/bakedbeans","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/a-musing-moose/bakedbeans","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-musing-moose%2Fbakedbeans","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-musing-moose%2Fbakedbeans/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-musing-moose%2Fbakedbeans/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-musing-moose%2Fbakedbeans/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/a-musing-moose","download_url":"https://codeload.github.com/a-musing-moose/bakedbeans/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-musing-moose%2Fbakedbeans/sbom","scorecard":{"id":157767,"data":{"date":"2025-08-11","repo":{"name":"github.com/a-musing-moose/bakedbeans","commit":"c7171d42ae7b4b0c0ccdad26c70322ec5aab5c6f"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.1,"checks":[{"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":0,"reason":"Found 1/11 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":"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":"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":"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":"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":"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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: containerImage not pinned by hash: Dockerfile:1: pin your Docker image by updating python:3.6-alpine to python:3.6-alpine@sha256:579978dec4602646fe1262f02b96371779bfb0294e92c91392707fa999c0c989","Warn: pipCommand not pinned by hash: Dockerfile:7","Info:   0 out of   1 containerImage dependencies pinned","Info:   0 out of   1 pipCommand dependencies pinned"],"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":"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 3 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"}},{"name":"Vulnerabilities","score":4,"reason":"6 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-29gw-9793-fvw7","Warn: Project is vulnerable to: PYSEC-2015-24 / GHSA-4vwq-x64q-j4cj","Warn: Project is vulnerable to: PYSEC-2017-46 / GHSA-66gw-5xpf-gfp5","Warn: Project is vulnerable to: PYSEC-2015-25 / GHSA-92mr-v722-f48m","Warn: Project is vulnerable to: PYSEC-2022-12 / GHSA-pq7m-3gw7-gq5x","Warn: Project is vulnerable to: PYSEC-2017-47"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-16T12:20:41.611Z","repository_id":57413799,"created_at":"2025-08-16T12:20:41.611Z","updated_at":"2025-08-16T12:20:41.611Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28549823,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T19:56:05.265Z","status":"ssl_error","status_checked_at":"2026-01-18T19:55:54.685Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["http-server","mock","rest-api","stub"],"created_at":"2026-01-18T20:32:07.915Z","updated_at":"2026-01-18T20:32:08.051Z","avatar_url":"https://github.com/a-musing-moose.png","language":"Python","readme":"Baked Beans\n===========\n\n.. image:: https://travis-ci.org/a-musing-moose/bakedbeans.svg?branch=master\n    :target: https://travis-ci.org/a-musing-moose/bakedbeans\n\nBaked Beans is a terribly named HTTP stub server for REST services that deal in JSON payloads written in Python but easily runnable as a Docker container.\n\nIt takes a super simple approach of using a folder of contents that provide the canned responses it produces.\n\ne.g ``GET http://localhost:3000/path/to/some/resource`` would map to the file: ``\u003cbase_folder\u003e/path/to/some/resource.get.json``.\n\nNote in the example above that the file name looked for includes the HTTP method used.\n\nIn it's basic mode, Baked Beans will simply load the matching file and pipe it back to the client.\n\nIt also supports a limited amount of smarts. JSON file constructed to a specific schema can be used by Baked Beans to return specific responses. For example, it can match responses based on GET parameters.\n\n\nInstallation\n------------\n\nCreate a python virtual environment with your favourite tools. Then use pip to install ``bakedbeans``:\n\n.. code-block:: bash\n\n    (venv) $ pip install bakedbeans\n\n\nRunning\n-------\n\nBaked Beans provides a simple command line executable to run the server:\n\n.. code-block:: bash\n\n    (venv) $ baked /path/to/contents/folder\n     * Running on http://127.0.0.1:3000/ (Press CTRL+C to quit)\n\n\nYou can specify the host name with ``--host`` and the port it binds to with ``--port``.\n\nBaked Beans is also built with Docker in mind. To run Baked Beans in docker you will need to mount your local contents directory as a volume.  For example:\n\n.. code-block:: bash\n\n    docker run -it --rm -p 3000:3000 -v /full/path/to/contents:/contents moose/bakedbeans\n\nThis will run Baked Beans in a container that will remove itself once exit, mounting the ``/full/path/to/contents`` inside the container at ``/contents`` which is where Baked Beans is configured to load the contents from.\n\nWriting contents\n-----------------\n\nBaked Beans maps URLs to file paths, adding ``.\u003cmethod\u003e.json`` to the end of the path. There are a couple of exceptions, for example if the URL ends with ``/`` it will instead add ``index.\u003cmethod\u003e.json``.\n\nExamples:\n\n    +-------------------------------------+--------------------------------+\n    | Request URL                         | Mapped Path                    |\n    +=====================================+================================+\n    | GET http://localhost:3000/somewhere |  ``\u003cbase\u003e/somewhere.get.json`` |\n    +-------------------------------------+--------------------------------+\n    | POST http://localhost:3000/another  |  ``\u003cbase\u003e/another.post.json``  |\n    +-------------------------------------+--------------------------------+\n    | GET http://localhost:3000/          |  ``\u003cbase\u003e/index.get.json``     |\n    +-------------------------------------+--------------------------------+\n\nBy default the contents of the file once loaded to feed back to the request verbatim.\n\nHowever, if you want to get clever with the response you can write the JSON file in the ``bean`` format. ``Beans`` are just something I made up for this project and take the form of a JSON object. For example:\n\n\n.. code-block:: javascript\n\n    {\n        \"_bean\": true,\n        \"responses\": [\n            {\n                \"params\": {\n                    \"product\": \"1111\"\n                },\n                \"contents\": {\n                    \"id\": 1111,\n                    \"name\": \"Product A\"\n                }\n            },\n            {\n                \"params\": {\n                    \"product\": \"2222\"\n                },\n                \"status\": 203,\n                \"contents\": {\n                    \"id\": 2222,\n                    \"name\": \"Product B\"\n                }\n            }\n\n\n        ]\n\n    }\n\n\nWith the ``bean`` above, it is matching the response based on the GET parameters that accompany the request.  e.g. ``http://localhost:3000/path?product=1111`` would match the first response and return the value of ``contents``. A GET param of ``product=2222`` would match the second. If no match is found, then the first one is selected regardless.\n\nNote also that the second response specifies a ``status``, this allow you to specify a specific status code to use for the response. If not specified then a default value based on the HTTP method is used.\n\nThe default status codes are:\n\n+---------+------+\n| Method  | Code |\n+=========+======+\n| GET     |  200 |\n+---------+------+\n| POST    |  201 |\n+---------+------+\n| DELETE  |  204 |\n+---------+------+\n| PUT     |  200 |\n+---------+------+\n| PATCH   |  200 |\n+---------+------+\n| \u003cOTHER\u003e |  200 |\n+---------+------+\n\nCurrently only GET parameter matching is supported but header and body matching would be a nice addition as would regex of values and use of matched criteria within the content...\n\n\nHits \u0026 Misses\n-------------\n\nThe above describes have things work if everything is perfect. The url matches a content file, the content file is valid JSON, and if needed a valid ``bean``.  But what happens when things don't match up:\n\nContent not found\n    ``404`` status with a body of ``{\"error\": \"content not found the/missing/path\"}``\n\nInvalid content file\n    ``500`` status with a body of ``{\"error\": \"content invalid\"}``\n\nBean fails validation\n    ``500`` status with a body of ``{\"error\": \"This is one mouldy bean\"}``\n\n\nMore detailed descriptions of the error encountered can be found in the logs.\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa-musing-moose%2Fbakedbeans","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fa-musing-moose%2Fbakedbeans","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa-musing-moose%2Fbakedbeans/lists"}