{"id":28194234,"url":"https://github.com/monkey-projects/martian-aleph","last_synced_at":"2026-02-21T14:03:25.450Z","repository":{"id":252212969,"uuid":"839763573","full_name":"monkey-projects/martian-aleph","owner":"monkey-projects","description":"Martian plugin to use the Aleph http client","archived":false,"fork":false,"pushed_at":"2025-10-03T08:47:40.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-03T10:31:55.654Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Clojure","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/monkey-projects.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-08-08T09:26:15.000Z","updated_at":"2025-10-03T08:47:43.000Z","dependencies_parsed_at":"2025-10-06T09:03:07.169Z","dependency_job_id":null,"html_url":"https://github.com/monkey-projects/martian-aleph","commit_stats":null,"previous_names":["monkey-projects/martian-aleph"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/monkey-projects/martian-aleph","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monkey-projects%2Fmartian-aleph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monkey-projects%2Fmartian-aleph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monkey-projects%2Fmartian-aleph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monkey-projects%2Fmartian-aleph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/monkey-projects","download_url":"https://codeload.github.com/monkey-projects/martian-aleph/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monkey-projects%2Fmartian-aleph/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29682749,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T13:29:26.630Z","status":"ssl_error","status_checked_at":"2026-02-21T13:26:50.125Z","response_time":107,"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":[],"created_at":"2025-05-16T13:11:41.183Z","updated_at":"2026-02-21T14:03:25.435Z","avatar_url":"https://github.com/monkey-projects.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Martian Aleph plugin\n\nThis is a Clojure lib for a [Martian](https://github.com/oliyh/martian) plugin\nto use the [Aleph](https://aleph.io) http client.\n\n## Usage\n\nFor more details on how to use Martian, see the [Martian docs](https://github.com/oliyh/martian#latest-versions--api-docs).\n\nIn order to use Aleph as your http client, include the lib in your `deps.edn`:\n\n```clojure\n{:deps {com.monkeyprojects/martian-aleph {:mvn/version \"\u003cVERSION\u003e\"}}}\n```\nOr when using Leiningen:\n```clojure\n(...\n :dependencies [[com.monkeyprojects/martian-aleph \"\u003cVERSION\u003e\"]])\n```\n\nIf the endpoint provides an OpenAPI definition, you can set up a context:\n```clojure\n(require '[monkey.martian.aleph :as mma])\n\n(def ctx (mma/bootstrap-openapi \"https://some-rest-endpoint/swagger.json\"))\n```\nAfter that, you can use `martian.core/response-for` to send requests to the remote API.\nIf necessary, you can pass in additional options for the Martian requests and also\nto load the OpenAPI spec.\n```clojure\n(mma/bootstrap-openapi\n  \"swagger-url\"                                  ; Url to the swagger page\n  {:interceptors my-interceptors}                ; Options to pass to the Martian client creator\n  {:headers {\"Authorization\" \"Bearer \u003ctoken\u003e\"}}) ; Options to pass to the openapi request\n```\nThe Martian options are merged in with the `default-opts` map, which already contain\n    \t    \t    predefined interceptors.\n\nWhen defining your own routes (when the other end does not provide a spec), you\ncan use `bootstrap`:\n```clojure\n(def routes\n [{:route-name ::test-route\n   :path-parts [\"/test\"]\n   :method :get\n   :produces [\"application/json\"]}])\n\n(def ctx (mma/bootstrap \"http://remote-endpoint\" routes))\n;; You can also pass in additional options as a third argument\n```\n\nThis will set up a Martian context that adds interceptors specific to using Aleph HTTP\nclients.  Since Aleph always uses async requests, the response is a [Manifold](https://github.com/clj-commons/manifold)\ndeferred, so you need to `deref` the response, or you can compose it with other async calls.\n\n## Testing\n\nMartian provides functionality for mocking endpoints for testing purposes.  Unfortunately,\nthis is not client-agnostic, so we have provided custom functions for creating a Martian\ntest context.\n\n```clojure\n(require '[martian.test :as mt])\n(require '[martian.core :as mc])\n\n;; Create a test context\n(def test-ctx (-\u003e (mma/as-test-context ctx)\n                  (mt/respond-with {::test-route {:status 200}})))\n\n;; Testing\n(is (= 200 (:status @(mc/response-for test-ctx ::test-route))))\n```\n\nIn the future, it's the intention to actually PR this into the Martian source code\nitself, so we can also include the test code in `martian.test` itself.  But until then,\nconsider this a workaround.\n\n## License\n\nCopyright (c) 2024 by [Monkey Projects](https://www.monkey-projects.be).\n\n[MIT License](LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonkey-projects%2Fmartian-aleph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmonkey-projects%2Fmartian-aleph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonkey-projects%2Fmartian-aleph/lists"}