{"id":42620312,"url":"https://github.com/go-passwd/validator","last_synced_at":"2026-01-29T04:19:14.318Z","repository":{"id":57605609,"uuid":"144065816","full_name":"go-passwd/validator","owner":"go-passwd","description":"Flexible and customizable password validation","archived":false,"fork":false,"pushed_at":"2025-04-07T04:48:38.000Z","size":518,"stargazers_count":15,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-03T00:08:08.412Z","etag":null,"topics":["go","go-library","go-package","golang","golang-library","golang-package","password-validation","password-validator"],"latest_commit_sha":null,"homepage":"https://go-passwd.github.io/validator.html","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/go-passwd.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":"2018-08-08T20:46:30.000Z","updated_at":"2025-07-15T10:15:14.000Z","dependencies_parsed_at":"2022-09-26T20:01:51.516Z","dependency_job_id":null,"html_url":"https://github.com/go-passwd/validator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/go-passwd/validator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-passwd%2Fvalidator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-passwd%2Fvalidator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-passwd%2Fvalidator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-passwd%2Fvalidator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/go-passwd","download_url":"https://codeload.github.com/go-passwd/validator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-passwd%2Fvalidator/sbom","scorecard":{"id":432300,"data":{"date":"2025-08-11","repo":{"name":"github.com/go-passwd/validator","commit":"c284a2f4d9904195fc73a7908a152798273c905d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"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":"Code-Review","score":0,"reason":"Found 0/28 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":"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":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/lint.yml:1","Warn: no topLevel permission defined: .github/workflows/test.yml:1","Info: no jobLevel write permissions found"],"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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lint.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/go-passwd/validator/lint.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lint.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/go-passwd/validator/lint.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lint.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/go-passwd/validator/lint.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/lint.yml:42: update your workflow using https://app.stepsecurity.io/secureworkflow/go-passwd/validator/lint.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/lint.yml:54: update your workflow using https://app.stepsecurity.io/secureworkflow/go-passwd/validator/lint.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/go-passwd/validator/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/go-passwd/validator/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/go-passwd/validator/test.yml/master?enable=pin","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned"],"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":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: 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"}},{"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 3 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"}},{"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"}}]},"last_synced_at":"2025-08-19T03:39:48.801Z","repository_id":57605609,"created_at":"2025-08-19T03:39:48.801Z","updated_at":"2025-08-19T03:39:48.801Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28862142,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T22:56:21.783Z","status":"online","status_checked_at":"2026-01-29T02:00:06.714Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["go","go-library","go-package","golang","golang-library","golang-package","password-validation","password-validator"],"created_at":"2026-01-29T04:19:13.621Z","updated_at":"2026-01-29T04:19:14.307Z","avatar_url":"https://github.com/go-passwd.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Password validator library for Go\n\n[![Latest tag](https://img.shields.io/github/tag/go-passwd/validator.svg)](https://github.com/go-passwd/validator/tags)\n[![GoDoc](https://godoc.org/github.com/go-passwd/validator?status.svg)](https://pkg.go.dev/github.com/go-passwd/validator)\n[![Tests status](https://github.com/go-passwd/validator/actions/workflows/test.yml/badge.svg)](https://github.com/go-passwd/validator/actions/workflows/test.yml)\n[![Go report](https://goreportcard.com/badge/github.com/go-passwd/validator)](https://goreportcard.com/report/github.com/go-passwd/validator)\n[![License](https://img.shields.io/github/license/go-passwd/validator)](./LICENSE)\n\n## Installation\n\n~~~sh\ngo get -u github.com/go-passwd/validator\n~~~\n\n## Usage\n\n~~~go\nimport \"github.com/go-passwd/validator\"\n\npasswordValidator := validator.New(validator.MinLength(5, nil), validator.MaxLength(10, nil))\nerr := passwordValidator.Validate(form.Password)\nif err != nil {\n  panic(err)\n}\n~~~\n\nYou can pass to every validator functions ``customError`` parameter witch will be returned on error instead of default error.\n\n~~~go\nimport \"github.com/go-passwd/validator\"\n\npasswordValidator := validator.New(validator.MinLength(5, errors.New(\"too short\")), validator.MaxLength(10, errors.New(\"too long\")))\nerr := passwordValidator.Validate(form.Password)\nif err != nil {\n  panic(err)\n}\n~~~\n\n## Validators\n\n### CommonPassword\n\nCheck if password is a common password.\n\nCommon password list is based on list created by Mark Burnett: https://xato.net/passwords/more-top-worst-passwords/\n\n~~~go\npasswordValidator := validator.New(validator.CommonPassword(nil))\n~~~\n\n### ContainsAtLeast\n\nCount occurrences of a chars and compares it with required value.\n\n~~~go\npasswordValidator := validator.New(validator.ContainsAtLeast(5, \"abcdefghijklmnopqrstuvwxyz\", nil))\n~~~\n\n### ContainsOnly\n\nCheck if password contains only selected chars.\n\n~~~go\npasswordValidator := validator.New(validator.ContainsOnly(\"abcdefghijklmnopqrstuvwxyz\", nil))\n~~~\n\n### MaxLength\n\nCheck if password length is not greater that defined length.\n\n~~~go\npasswordValidator := validator.New(validator.MaxLength(10, nil))\n~~~\n\n### MinLength\n\nCheck if password length is not lower that defined length.\n\n~~~go\npasswordValidator := validator.New(validator.MinLength(5, nil))\n~~~\n\n### Noop\n\nAlways return custom error.\n\n~~~go\npasswordValidator := validator.New(validator.Noop(nil))\n~~~\n\n### Regex\n\nCheck if password match regexp pattern.\n\n~~~go\npasswordValidator := validator.New(validator.Regex(\"^\\\\w+$\", nil))\n~~~\n\n### Similarity\n\nCheck if password is sufficiently different from the attributes.\n\nAttributes can be: user login, email, first name, last name, …\n\n~~~go\npasswordValidator := validator.New(validator.Similarity([]string{\"username\", \"username@example.com\"}, nil, nil))\n~~~\n\n### StartsWith\n\nCheck if password starts with one of letter.\n\n~~~go\npasswordValidator := validator.New(validator.StartsWith(\"abcdefghijklmnopqrstuvwxyz\", nil))\n~~~\n\n### Unique\n\nCheck if password contains only unique chars.\n\n~~~go\npasswordValidator := validator.New(validator.Unique(nil))\n~~~\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-passwd%2Fvalidator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgo-passwd%2Fvalidator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-passwd%2Fvalidator/lists"}