{"id":37135269,"url":"https://github.com/marcelofabianov/doberman","last_synced_at":"2026-01-14T15:46:43.043Z","repository":{"id":305887171,"uuid":"1023694237","full_name":"marcelofabianov/doberman","owner":"marcelofabianov","description":"Go PKG para gerenciamento de senhas, oferecendo geração e validação configuráveis e hashing moderno com Argon2id.","archived":false,"fork":false,"pushed_at":"2025-10-06T22:44:00.000Z","size":31,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-07T00:21:14.708Z","etag":null,"topics":["argo2","package","password","security","type-safe","validation"],"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/marcelofabianov.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":"2025-07-21T14:47:57.000Z","updated_at":"2025-10-06T22:43:44.000Z","dependencies_parsed_at":"2025-09-09T23:04:25.600Z","dependency_job_id":"f45e63db-fa09-46c8-871c-b0e6407ac515","html_url":"https://github.com/marcelofabianov/doberman","commit_stats":null,"previous_names":["marcelofabianov/doberman"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/marcelofabianov/doberman","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcelofabianov%2Fdoberman","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcelofabianov%2Fdoberman/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcelofabianov%2Fdoberman/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcelofabianov%2Fdoberman/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marcelofabianov","download_url":"https://codeload.github.com/marcelofabianov/doberman/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcelofabianov%2Fdoberman/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28424775,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T15:24:48.085Z","status":"ssl_error","status_checked_at":"2026-01-14T15:23:41.940Z","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":["argo2","package","password","security","type-safe","validation"],"created_at":"2026-01-14T15:46:42.307Z","updated_at":"2026-01-14T15:46:43.030Z","avatar_url":"https://github.com/marcelofabianov.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Doberman\n\nDoberman is a Go package for secure password generation, validation, and handling. It provides a customizable password validator, supports JSON serialization/deserialization, and integrates with SQL databases using the `database/sql` package.\n\n## Features\n\n- Generate random passwords with customizable requirements (length, character types).\n- Validate passwords against configurable rules (minimum length, required numbers, uppercase, lowercase, symbols).\n- Securely handle passwords with JSON marshaling/unmarshaling.\n- Support for SQL database integration with `Scan` and `Value` methods.\n- Error handling using the `github.com/marcelofabianov/fault` package.\n\n## Installation\n\nTo use Doberman in your Go project, run:\n\n```bash\ngo get github.com/marcelofabianov/doberman\n```\n\nEnsure you have the `fault` package installed:\n\n```bash\ngo get github.com/marcelofabianov/fault\n```\n\n## Usage\n\n### Creating a Password Validator\n\nCreate a `PasswordValidator` with default or custom configuration:\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"github.com/marcelofabianov/doberman\"\n)\n\nfunc main() {\n    // Use default configuration (min length: 10, requires number, uppercase, lowercase, symbol)\n    validator := doberman.NewPasswordValidator(nil)\n\n    // Custom configuration\n    customConfig := \u0026doberman.PasswordConfig{\n        MinLength:     12,\n        RequireNumber: true,\n        RequireUpper:  true,\n        RequireLower:  true,\n        RequireSymbol: false,\n    }\n    customValidator := doberman.NewPasswordValidator(customConfig)\n}\n```\n\n### Generating a Password\n\nGenerate a random password that meets the validator's requirements:\n\n```go\npassword, err := validator.Generate()\nif err != nil {\n    fmt.Printf(\"Error generating password: %v\\n\", err)\n    return\n}\nfmt.Printf(\"Generated password: %s\\n\", password.String())\n```\n\n### Validating a Password\n\nValidate a password against the configured rules:\n\n```go\nerr := validator.Validate(\"MySecureP@ss1\")\nif err != nil {\n    fmt.Printf(\"Validation failed: %v\\n\", err)\n} else {\n    fmt.Println(\"Password is valid\")\n}\n```\n\n### Creating a Password\n\nCreate a `Password` type with validation:\n\n```go\npassword, err := doberman.NewPassword(\"MySecureP@ss1\")\nif err != nil {\n    fmt.Printf(\"Invalid password: %v\\n\", err)\n    return\n}\nfmt.Printf(\"Created password: %s\\n\", password.String())\n```\n\nFor panic-on-error behavior:\n\n```go\npassword := doberman.MustNewPassword(\"MySecureP@ss1\")\nfmt.Printf(\"Created password: %s\\n\", password.String())\n```\n\n### Database Integration\n\nUse the `Password` type with SQL databases:\n\n```go\nimport (\n    \"database/sql\"\n    \"fmt\"\n    \"github.com/marcelofabianov/doberman\"\n    _ \"github.com/mattn/go-sqlite3\"\n)\n\nfunc main() {\n    db, err := sql.Open(\"sqlite3\", \":memory:\")\n    if err != nil {\n        fmt.Printf(\"Error opening database: %v\\n\", err)\n        return\n    }\n    defer db.Close()\n\n    // Create table\n    _, err = db.Exec(\"CREATE TABLE users (id INTEGER PRIMARY KEY, password TEXT)\")\n    if err != nil {\n        fmt.Printf(\"Error creating table: %v\\n\", err)\n        return\n    }\n\n    // Insert password\n    password, _ := doberman.NewPassword(\"DatabaseP@ss1\")\n    _, err = db.Exec(\"INSERT INTO users (password) VALUES (?)\", password)\n    if err != nil {\n        fmt.Printf(\"Error inserting: %v\\n\", err)\n        return\n    }\n\n    // Query password\n    var scannedPassword doberman.Password\n    err = db.QueryRow(\"SELECT password FROM users WHERE id = 1\").Scan(\u0026scannedPassword)\n    if err != nil {\n        fmt.Printf(\"Error querying: %v\\n\", err)\n        return\n    }\n    fmt.Printf(\"Scanned password: %s\\n\", scannedPassword.String())\n}\n```\n\n## Error Handling\n\nDoberman uses the `fault` package for structured error handling. Errors include a message, code, context, and wrapped errors:\n\n```go\npassword, err := doberman.NewPassword(\"invalid\")\nif err != nil {\n    fmt.Printf(\"Error: %s, Code: %s, Context: %v\\n\", err.Message, err.Code, err.Context)\n}\n```\n\n## Testing\n\nRun the tests to verify functionality:\n\n```bash\ngo test -v ./...\n```\n\n## Contributing\n\nContributions are welcome! Please submit issues or pull requests to the [GitHub repository](https://github.com/marcelofabianov/doberman).\n\n## License\n\nThis project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcelofabianov%2Fdoberman","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcelofabianov%2Fdoberman","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcelofabianov%2Fdoberman/lists"}