{"id":15066809,"url":"https://github.com/linuxwhatelse/mjs","last_synced_at":"2026-02-04T06:03:19.272Z","repository":{"id":89593198,"uuid":"54727702","full_name":"linuxwhatelse/mjs","owner":"linuxwhatelse","description":"A JSON-Server component which uses the mapper project","archived":false,"fork":false,"pushed_at":"2018-04-19T09:08:31.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-06T23:13:01.389Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/linuxwhatelse.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-03-25T15:27:44.000Z","updated_at":"2018-04-19T09:08:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"ce31edc4-33d8-4ffe-a238-1fd0f2785b56","html_url":"https://github.com/linuxwhatelse/mjs","commit_stats":{"total_commits":31,"total_committers":3,"mean_commits":"10.333333333333334","dds":0.5161290322580645,"last_synced_commit":"a3d03bfad952c841e1c56b04d807b512e6ea218c"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/linuxwhatelse/mjs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linuxwhatelse%2Fmjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linuxwhatelse%2Fmjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linuxwhatelse%2Fmjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linuxwhatelse%2Fmjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linuxwhatelse","download_url":"https://codeload.github.com/linuxwhatelse/mjs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linuxwhatelse%2Fmjs/sbom","scorecard":{"id":591577,"data":{"date":"2025-08-11","repo":{"name":"github.com/linuxwhatelse/mjs","commit":"a3d03bfad952c841e1c56b04d807b512e6ea218c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"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 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":"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":"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":"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":"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":"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":"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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU General Public License v3.0: 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":"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-20T22:04:46.432Z","repository_id":89593198,"created_at":"2025-08-20T22:04:46.432Z","updated_at":"2025-08-20T22:04:46.432Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29072473,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-04T03:31:03.593Z","status":"ssl_error","status_checked_at":"2026-02-04T03:29:50.742Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":[],"created_at":"2024-09-25T01:12:27.527Z","updated_at":"2026-02-04T06:03:19.257Z","avatar_url":"https://github.com/linuxwhatelse.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"mjs - Mapper JSON Server\n========================\n[![pypi](https://img.shields.io/pypi/v/lwe-mjs.svg)](https://pypi.python.org/pypi/lwe-mjs)\n\n**mjs** is a simple server component which uses the [mapper project](https://github.com/linuxwhatelse/mapper) to run functions mapped to url patterns.\n\n## Requirements\n1. python 3.4 and up\n2. [mapper.py](https://github.com/linuxwhatelse/mapper)\n\n## Installation\nJust run:\n```bash\npip install lwe-mjs\n```\n\n## Usage\nIt's pretty straight forward...\n```python\nimport mjs\nimport mapper\n\nmpr = mapper.Mapper.get()\n\ndef validator(path, headers):\n    # Would verify if the request is allowed or not\n    return True\n\n# Map \"/index\" to the index function.\n#\n# To see how the mapper works and what it can do, head over to\n# https://github.com/linuxwhatelse/mapper\n@mpr.url('^/index/$', 'GET')\ndef index():\n    # When using mjs, your functions response HAS to look like this!\n    return {\n        # (Required) Status-Code to be sent to the client\n        'status_code' : 200,\n\n        # (Optional) Alternative message to be sent to the client\n        'message' : 'Success',\n\n        # (Optional) A cookie to be sent to the client.\n        # e.g. http.cookies.SimpleCookie()\n        'cookie' : None,\n\n        # (Optional) Payload/Body to be sent to the client\n        # Has to be of type dict or list\n        'payload' : None\n    }\n\nif __name__ == '__main__':\n    # Create a default configuration\n    conf = mjs.Config()\n\n    # Who is allowed to access the server\n    conf.address = '0.0.0.0'\n\n    # The port to be used with the server\n    conf.port = 8088\n\n    # A callback to be called for EVERY request (GET, POST, PUT, DELETE)\n    # BEFORE the resolved function will be run.\n    #\n    # This callback HAS to return either True (if the request is allowed), or\n    # False (if the request should be denied)\n    #\n    # Usefully to implement e.g. authentication\n    conf.validate_callback = validator\n\n    # A list of url-paths (without host:port) to be excluded from validation.\n    conf.validate_exclude_paths = ['/login', '/register']\n\n    # Create a new server instance\n    server = mjs.Server(conf)\n    # or\n    server = mjs.ThreadedServer(conf)\n\n    # Start the server\n    print('Server running: %s:%s' % (conf.address, conf.port))\n    print('use ctrl+c to exit')\n    try:\n        server.serve_forever()\n\n    except KeyboardInterrupt:\n        print('Server closed...')\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinuxwhatelse%2Fmjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinuxwhatelse%2Fmjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinuxwhatelse%2Fmjs/lists"}