{"id":16442833,"url":"https://github.com/mdedetrich/censored-raw-header","last_synced_at":"2026-05-15T00:32:14.231Z","repository":{"id":48657211,"uuid":"92189207","full_name":"mdedetrich/censored-raw-header","owner":"mdedetrich","description":"A RawHeader which can be used for akka-http that allows you to censor the .toString method","archived":false,"fork":false,"pushed_at":"2021-07-15T14:01:01.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-08T18:29:46.142Z","etag":null,"topics":["actors","akka","akka-http","http","logging","oauth2","token"],"latest_commit_sha":null,"homepage":null,"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/mdedetrich.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":"2017-05-23T15:28:08.000Z","updated_at":"2021-07-15T14:00:58.000Z","dependencies_parsed_at":"2022-09-03T18:01:31.721Z","dependency_job_id":null,"html_url":"https://github.com/mdedetrich/censored-raw-header","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdedetrich%2Fcensored-raw-header","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdedetrich%2Fcensored-raw-header/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdedetrich%2Fcensored-raw-header/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdedetrich%2Fcensored-raw-header/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mdedetrich","download_url":"https://codeload.github.com/mdedetrich/censored-raw-header/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240794917,"owners_count":19858719,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["actors","akka","akka-http","http","logging","oauth2","token"],"created_at":"2024-10-11T09:18:49.872Z","updated_at":"2026-05-15T00:32:14.156Z","avatar_url":"https://github.com/mdedetrich.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://img.shields.io/github/workflow/status/mdedetrich/censored-raw-header/Continuous%20Integration.svg)](https://github.com/mdedetrich/censored-raw-header/actions)\n[![Latest version](https://index.scala-lang.org/mdedetrich/censored-raw-header/censored-raw-header/latest.svg?color=orange)](https://index.scala-lang.org/mdedetrich/censored-raw-header)\n[![BSD License](https://img.shields.io/badge/license-BSD-green.svg)](https://opensource.org/licenses/BSD-2-Clause)\n\n## Censored Raw Header\n\nCensored raw header is a simple implementation of `RawHeader` which allows you to provide\na custom `.toString` method. This is useful when it comes to censoring log output of headers of\nsensitive information, such as OAuth2 tokens.\n\n## Usage\n\nPut this into your `build.sbt`\n\n```scala\nlibraryDependencies ++= Seq(\n  \"org.mdedetrich\" %% \"censored-raw-header\" % \"0.7.0\"\n)\n```\n\nThen simply created your own custom `CensoredRawHeader`, i.e. if you want to store an OAuth2\ntoken with implicit flow you might do the following\n\n```scala\nimport akka.http.scaladsl.model.headers.CensoredRawHeader\n\nval token: String = ??? // Some Token  \n\nCensoredRawHeader(\"Authorization\",\n                        s\"Bearer $token\",\n                        s\"Bearer ${token.take(3)}...${token.takeRight(3)}\")\n```\n\nThis means that when someone accesses the raw value from within the `CensoredRawHeader` they will\nget the actual value, however if they call `.toString` on the `CensoredRawHeader` (or any data\nstructure containing the `CensoredRawHeader`) it will print the first 3 characters of the token, then `...` and then\nthe last 3 values of the token\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdedetrich%2Fcensored-raw-header","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmdedetrich%2Fcensored-raw-header","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdedetrich%2Fcensored-raw-header/lists"}