{"id":21849058,"url":"https://github.com/wils0ns/redact","last_synced_at":"2026-05-16T12:32:56.632Z","repository":{"id":57551264,"uuid":"291257569","full_name":"wils0ns/redact","owner":"wils0ns","description":"Redactor for JSON and text","archived":false,"fork":false,"pushed_at":"2020-09-01T23:43:25.000Z","size":19,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-25T13:59:53.153Z","etag":null,"topics":["blackout","censor","golang","json","omit","redact","string","text"],"latest_commit_sha":null,"homepage":"","language":"Go","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/wils0ns.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":"2020-08-29T11:23:52.000Z","updated_at":"2022-07-21T06:27:53.000Z","dependencies_parsed_at":"2022-09-04T09:22:56.043Z","dependency_job_id":null,"html_url":"https://github.com/wils0ns/redact","commit_stats":null,"previous_names":["wils0ns/redacting"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/wils0ns/redact","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wils0ns%2Fredact","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wils0ns%2Fredact/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wils0ns%2Fredact/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wils0ns%2Fredact/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wils0ns","download_url":"https://codeload.github.com/wils0ns/redact/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wils0ns%2Fredact/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33102812,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T04:41:52.686Z","status":"ssl_error","status_checked_at":"2026-05-16T04:41:52.009Z","response_time":115,"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":["blackout","censor","golang","json","omit","redact","string","text"],"created_at":"2024-11-28T00:10:33.454Z","updated_at":"2026-05-16T12:32:56.617Z","avatar_url":"https://github.com/wils0ns.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Redact\n\n[![GoDoc](https://img.shields.io/badge/go-docs-blue.svg)](http://godoc.org/github.com/wils0ns/redact)\n[![Go Report Card](https://goreportcard.com/badge/github.com/wils0ns/redact)](https://goreportcard.com/report/github.com/wils0ns/redact)\n[![Codecov](https://img.shields.io/codecov/c/github/wils0ns/redact.svg)](https://codecov.io/gh/wils0ns/redact)\n\nJSON and text redactor.\n\n## Blackout secrets in a text\n\nCode:\n\n```go\ns = NewSecret(`[0-9]{3}\\.[0-9]{3}\\.[0-9]{3}-[0-9]{2}`, BlackOut, []byte(\"█\"))\n```\n\nOriginal text:\n\n```text\nThese are a couple of CPFs: 321.654.987-00 and 789.456.123-00\n```\n\nRedacted text:\n\n```text\nThese are a couple of CPFs: ██████████████ and ██████████████\n```\n\n## Blackout secret values and omit secret fields from JSON\n\nCode:\n\n```go\nbo := []byte(\"█\")\ninq := New()\ninq.AddSecretValue(NewSecret(\"secret[s]?\", BlackOut, bo))\ninq.AddSecretValue(NewSecret(\"SSN\", BlackOut, []byte(\"\")))\ninq.AddSecretValue(NewSecret(`[1-9]{3}-[1-9]{2}-[1-9]{4}`, BlackOut, bo))\n\ninq.AddSecretField(\"date\")\ninq.AddSecretField(\"^SSN$\")\n```\n\nOriginal JSON:\n\n```json\n{\n  \"Name\":\"Wilson\",\n  \"create_date\": \"2020-08-31 15:51:14+00:00\",\n  \"modify_date\": \"2020-08-31 15:52:15+00:00\",\n  \"SSN\": \"123-45-6789\",\n  \"quote\": \"We all have secrets\"\n}\n```\n\nRedacted JSON:\n\n```json\n{\n  \"Name\":\"Wilson\",\n  \"quote\":\"We all have ███████\"\n}\n```\n\n\nCheck out the full [code examples](example_test.go).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwils0ns%2Fredact","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwils0ns%2Fredact","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwils0ns%2Fredact/lists"}