{"id":39584742,"url":"https://github.com/pileworx/akka-http-hal","last_synced_at":"2026-01-26T15:01:22.736Z","repository":{"id":57736041,"uuid":"56454454","full_name":"pileworx/akka-http-hal","owner":"pileworx","description":"HAL (Hypermedia Application Language) specification support for akka-http","archived":false,"fork":false,"pushed_at":"2020-07-25T21:14:12.000Z","size":362,"stargazers_count":17,"open_issues_count":0,"forks_count":7,"subscribers_count":7,"default_branch":"develop","last_synced_at":"2023-12-13T17:09:42.023Z","etag":null,"topics":["akka-http","hal","hateoas","hypermedia"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pileworx.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}},"created_at":"2016-04-17T19:31:35.000Z","updated_at":"2023-03-18T14:46:24.000Z","dependencies_parsed_at":"2022-08-24T00:41:04.374Z","dependency_job_id":null,"html_url":"https://github.com/pileworx/akka-http-hal","commit_stats":null,"previous_names":[],"tags_count":6,"template":null,"template_full_name":null,"purl":"pkg:github/pileworx/akka-http-hal","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pileworx%2Fakka-http-hal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pileworx%2Fakka-http-hal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pileworx%2Fakka-http-hal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pileworx%2Fakka-http-hal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pileworx","download_url":"https://codeload.github.com/pileworx/akka-http-hal/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pileworx%2Fakka-http-hal/sbom","scorecard":{"id":733882,"data":{"date":"2025-08-11","repo":{"name":"github.com/pileworx/akka-http-hal","commit":"ed5b07626fe382e48ccbff57460a89ad025775ce"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.6,"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":"Code-Review","score":1,"reason":"Found 1/10 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":"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":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Warn: project license file does not contain an FSF or OSI license."],"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":"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":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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 30 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-22T15:11:05.456Z","repository_id":57736041,"created_at":"2025-08-22T15:11:05.456Z","updated_at":"2025-08-22T15:11:05.456Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28781308,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T13:55:28.044Z","status":"ssl_error","status_checked_at":"2026-01-26T13:55:26.068Z","response_time":59,"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":["akka-http","hal","hateoas","hypermedia"],"created_at":"2026-01-18T07:35:27.100Z","updated_at":"2026-01-26T15:01:22.731Z","avatar_url":"https://github.com/pileworx.png","language":"Scala","funding_links":[],"categories":["\u003ca name=\"Scala\"\u003e\u003c/a\u003eScala"],"sub_categories":[],"readme":"akka-http-hal\n=============\n\nHAL Specification support library for akka-http.\n\nLicensed under the Apache 2 license.\n\n[![Build Status](https://travis-ci.org/pileworx/akka-http-hal.svg?branch=develop)](https://travis-ci.org/pileworx/akka-http-hal)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/2b351c4ec64e441f8b1bbf6ea4db3492)](https://www.codacy.com/app/Pileworx/akka-http-hal?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=pileworx/akka-http-hal\u0026amp;utm_campaign=Badge_Grade)\n[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/2b351c4ec64e441f8b1bbf6ea4db3492)](https://www.codacy.com/app/Pileworx/akka-http-hal?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=pileworx/akka-http-hal\u0026utm_campaign=Badge_Coverage)\n\nGetting Started\n---------------\n\nInstallation:\n```scala\nlibraryDependencies += \"io.pileworx\" %% \"akka-http-hal\" % \"1.2.5\"\n```\nSupport for Scala 2.11, 2.12, 2.13.\n\nUsage\n-----\nCreate your marshaller:\n```scala\ntrait FooProtocol extends DefaultJsonProtocol {\n  implicit val fooFormat = jsonFormat3(FooDto)\n}\n```\n\nYou can import a collection of IANA Relations (Self, Next, etc):\n```scala\nimport io.pileworx.akka.http.rest.hal.Relations._\n```\n\nCreate a resource adapter:\n```scala\ntrait FooAdapter extends FooProtocol {\n  def fooLink(rel: String, id: String) = rel -\u003e Link(href = s\"/foos/$id\")\n  def foosLink(rel: String) = rel -\u003e Link(href = \"/foos\")\n\n  def newResource(id: String): JsValue = {\n    ResourceBuilder(\n      withLinks = Some(Map(\n        fooLink(Self, id),\n        foosLink(Up)\n      ))\n    ).build\n  }\n\n  def notFoundResource: JsValue = {\n    ResourceBuilder(\n      withLinks = Some(Map(contactsLink(Up)))\n    ).build\n  }\n\n  def toResources(foos: Seq[FooDto]): JsValue = {\n    ResourceBuilder(\n      withEmbedded = Some(Map(\n        \"foos\" -\u003e foos.map(f =\u003e toResource(f))\n      )),\n      withLinks = Some(Map(foosLink(Self)))\n    ).build\n  }\n\n  def toResource(foo: FooDto): JsValue = {\n    ResourceBuilder(\n      withData = Some(foo.toJson),\n      withLinks = Some(Map(\n        fooLink(Self, foo.id),\n        foosLink(Up)\n      ))\n    ).build\n  }\n}\n```\nCreate your routes:\n```scala\ntrait FooRestPort extends FooAdapter {\n\n  val fooService = new FooService with FooComponent\n\n  val fooRoutes = path(\"foos\") {\n    get {\n      complete {\n        fooService.getAll.map(f =\u003e toResources(f))\n      }\n    } ~\n    post {\n      entity(as[CreateFooCommand]) { newFoo =\u003e\n        complete {\n          Created -\u003e fooService.add(newFoo).map(id =\u003e newResource(id))\n        }\n      }\n    }\n  } ~\n  pathPrefix(\"foos\" / Segment) { id =\u003e\n    get {\n      complete {\n        fooService.getById(id).map {\n          case Some(f) =\u003e Marshal(toResource(f)).to[HttpResponse]\n          case _ =\u003e Marshal(NotFound -\u003e notFoundResource).to[HttpResponse]\n        }\n      }\n    }\n  }\n}\n```\n\nCuries Support\n--------------\n\nCuries are supported in two ways.\n\nThe first is per resource:\n```scala\nResourceBuilder(\n  withCuries = Some(Seq(\n    Curie(name = \"ts\", href = \"http://typesafe.com/{rel}\")\n))).build\n```\nThe second, and most likely more common way, is to set them globally:\n```scala\nResourceBuilder.curies(Seq(\n  Curie(name = \"ts\", href = \"http://typesafe.com/{rel}\"),\n  Curie(name = \"akka\", href = \"http://akka.io/{rel}\")\n))\n```\nNote: If you mix global and resource based curies they will be combined. Currently we do not check for duplicate entries.\n\nFor the links pointing to a curie, just prefix the key with the curie name and colon (ex \"ts:info\"). If a colon is found in a key, we do not alter the href by adding X-Forwarded data or the request host/port.\n\nArray of Links Support\n----------------------\nIf you require an array of links:\n```json\n{\n  \"_links\": {\n    \"multiple_links\": [\n      {\n        \"href\": \"http://www.test.com?foo=bar\",\n        \"name\": \"one\"\n      },\n      {\n        \"href\": \"http://www.test.com?bar=baz\",\n        \"name\": \"two\"\n      }\n    ]\n  }\n}\n```\nThis can be achieved by using the Links class which accepts a Sequence of Link:\n\n```scala\nMap(\n  \"multiple_links\" -\u003e Links(Seq(\n    Link(href = url, name = Some(\"one\")),\n    Link(href = url, name = Some(\"two\"))\n)))\n```\n\nHttpRequest Support\n-------------------\n\nBy default the HAL links will not include the host or port.\n\nIf you would like host, port, or path prefix included, provide the HttpRequest.\n\n```scala\ndef toResource(foo: FooDto, req: HttpRequest): JsValue = {\n  ResourceBuilder(\n    withRequest = req,\n    withData = Some(foo.toJson),\n    withLinks = Some(Map(\n      fooLink(\"self\", foo.id),\n      foosLink(\"parent\")\n    ))\n  ).build\n}\n```\n\nThis will produce a link with either the current host's information OR construct the links based on\nthe X-Forwarded-Proto, X-Forwarded-Host, X-Forwarded-Port, and X-Forwarded-Prefix headers.\n\nHAL Browser\n-----------\nTo expose HAL Browser from your API add the halBrowser route.\n\n```scala\nval routes = otherRoutes ~ halBrowserRoutes\n```\n\nThe browser will be available at /halbrowser.\n\nTODO\n-----------\nFind more contributors (hint).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpileworx%2Fakka-http-hal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpileworx%2Fakka-http-hal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpileworx%2Fakka-http-hal/lists"}