{"id":16603278,"url":"https://github.com/dbrgn/rusty-santa","last_synced_at":"2025-09-28T17:31:04.426Z","repository":{"id":57665999,"uuid":"107818858","full_name":"dbrgn/rusty-santa","owner":"dbrgn","description":"A small Rust library for resolving Secret Santa assignments with additional constraints.","archived":false,"fork":false,"pushed_at":"2017-10-22T11:20:17.000Z","size":49,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-13T06:17:20.589Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dbrgn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-21T21:58:54.000Z","updated_at":"2021-05-06T19:07:38.000Z","dependencies_parsed_at":"2022-09-26T20:31:35.941Z","dependency_job_id":null,"html_url":"https://github.com/dbrgn/rusty-santa","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dbrgn/rusty-santa","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbrgn%2Frusty-santa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbrgn%2Frusty-santa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbrgn%2Frusty-santa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbrgn%2Frusty-santa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dbrgn","download_url":"https://codeload.github.com/dbrgn/rusty-santa/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbrgn%2Frusty-santa/sbom","scorecard":{"id":329212,"data":{"date":"2025-08-11","repo":{"name":"github.com/dbrgn/rusty-santa","commit":"27a2d55bd71ee570ed194d5e7304922ad8def43c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.8,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/20 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":"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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":"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":"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":"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":"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":"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-APACHE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE-APACHE:0"],"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":"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":"Vulnerabilities","score":8,"reason":"2 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: RUSTSEC-2022-0013 / GHSA-m5pq-gvj9-9vr8","Warn: Project is vulnerable to: RUSTSEC-2022-0006 / GHSA-9hpw-r23r-xgm5"],"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-18T03:10:39.766Z","repository_id":57665999,"created_at":"2025-08-18T03:10:39.766Z","updated_at":"2025-08-18T03:10:39.766Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":277193467,"owners_count":25777063,"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","status":"online","status_checked_at":"2025-09-27T02:00:08.978Z","response_time":73,"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":[],"created_at":"2024-10-12T00:48:54.526Z","updated_at":"2025-09-28T17:31:04.116Z","avatar_url":"https://github.com/dbrgn.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rusty Santa\n\n![Logo](logo.png)\n\nLibrary: [![Crates.io Version (Library)][crates-io-badge-lib]][crates-io-lib]\n\nCLI: [![Crates.io Version (CLI)][crates-io-badge-cli]][crates-io-cli]\n\nA small Rust library (and command-line tool) for resolving [Secret\nSanta](https://en.wikipedia.org/wiki/Secret_Santa) assignments with additional\nconstraints.\n\nIt is possible to add the following constraints to the random assignments:\n\n- Person A and B should not draw each other (e.g. for couples)\n- Person A should not draw person B (e.g. if person B already received a gift\n  from person A the previous year, or if person A dislikes person B)\n\nWhile this is an interesting mathematical problem and can be solved with\nbipartite graphs and the hungarian algorithm, this library sticks to a simpler\napproach and tries to emulate the real name drawing from a basket. Up to 1000\nattempts are made at resolving the name assignments without conflict until the\nalgorithm fails.\n\n\n## Library\n\n### Usage\n\n```rust\nlet mut group = Group::new();\n\ngroup.add(\"Sheldon\".into());\ngroup.add(\"Amy\".into());\ngroup.add(\"Leonard\".into());\ngroup.add(\"Penny\".into());\ngroup.add(\"Rajesh\".into());\ngroup.add(\"Howard\".into());\ngroup.add(\"Bernadette\".into());\n\n// Exclude couples\ngroup.exclude_pair(\"Sheldon\".into(), \"Amy\".into());\ngroup.exclude_pair(\"Leonard\".into(), \"Penny\".into());\ngroup.exclude_pair(\"Howard\".into(), \"Bernadette\".into());\n\n// Sheldon can't keep secrets from his roommates\ngroup.exclude(\"Sheldon\".into(), \"Leonard\".into());\n\nmatch group.assign() {\n    Ok(assignments) =\u003e {\n        for (from, to) in assignments {\n            println!(\"{} =\u003e {}\", from, to);\n        }\n    },\n    Err(e) =\u003e println!(\"Error: {:?}\", e),\n}\n```\n\n\n### Logging\n\nRusty Santa logs the algorithm steps on the TRACE level:\n\n```\n$ RUST_LOG=rusty_santa=trace cargo run -p rusty-santa --example cli\n    Finished dev [unoptimized + debuginfo] target(s) in 0.0 secs\n     Running `target/debug/examples/cli`\nTRACE:rusty_santa: Drawing recipient for Howard\nTRACE:rusty_santa: Options: [\"Sheldon\", \"Penny\", \"Amy\", \"Rajesh\", \"Leonard\"]\nTRACE:rusty_santa: Picked Sheldon!\nTRACE:rusty_santa: Drawing recipient for Sheldon\nTRACE:rusty_santa: Options: [\"Howard\", \"Bernadette\", \"Penny\", \"Rajesh\"]\nTRACE:rusty_santa: Picked Howard!\nTRACE:rusty_santa: Drawing recipient for Bernadette\nTRACE:rusty_santa: Options: [\"Penny\", \"Amy\", \"Rajesh\", \"Leonard\"]\nTRACE:rusty_santa: Picked Penny!\nTRACE:rusty_santa: Drawing recipient for Penny\nTRACE:rusty_santa: Options: [\"Bernadette\", \"Amy\", \"Rajesh\"]\nTRACE:rusty_santa: Picked Amy!\nTRACE:rusty_santa: Drawing recipient for Amy\nTRACE:rusty_santa: Options: [\"Bernadette\", \"Rajesh\", \"Leonard\"]\nTRACE:rusty_santa: Picked Rajesh!\nTRACE:rusty_santa: Drawing recipient for Rajesh\nTRACE:rusty_santa: Options: [\"Bernadette\", \"Leonard\"]\nTRACE:rusty_santa: Picked Leonard!\nTRACE:rusty_santa: Drawing recipient for Leonard\nTRACE:rusty_santa: Options: [\"Bernadette\"]\nTRACE:rusty_santa: Picked Bernadette!\nHoward =\u003e Sheldon\nSheldon =\u003e Howard\nBernadette =\u003e Penny\nPenny =\u003e Amy\nAmy =\u003e Rajesh\nRajesh =\u003e Leonard\nLeonard =\u003e Bernadette\n```\n\n## Command Line Tool\n\nThere is a proof-of-concept command-line interface. You can install it with `cargo install rusty-santa-cli`.\n\n    $ rusty-santa-cli\n    Rusty Santa v0.1.0\n\n    Who's in?\n    (List one name per line and press enter, end the list with an empty line.)\n\n    Name: A\n    Name: B\n    Name: C\n    Name: D\n    Name: \n\n    Alright. Are there any pairs that should not give each other gifts?\n    If you're done, just press enter.\n    Name 1: A\n    Name 2: B\n    OK, excluding the pair A \u003c-\u003e B\n    Someone else?\n    Name 1: \n\n    And now, are there any pairs where person 1 should not give person 2 a gift?\n    If you're done, just press enter.\n    Name 1: A\n    Name 2: C\n    OK, excluding the pair A -\u003e C\n    Someone else?\n    Name 1: \n\n    Great! Now we'll draw the names.\n    I'll show a name, first. That person should come to the computer,\n    without other people seeing the screen.\n    Press enter to reveal the name, press enter again to hide it.\n\n    B, are you ready? Press enter to see the name.\n    ******\n\n    A, are you ready? Press enter to see the name.\n    You'll give a gift to D! (Press enter to hide the name)\n\n...and so on.\n\n\n## License\n\nLicensed under either of\n\n * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or\n   http://www.apache.org/licenses/LICENSE-2.0)\n * MIT license ([LICENSE-MIT](LICENSE-MIT) or\n   http://opensource.org/licenses/MIT) at your option.\n\n\n### Contributing\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall\nbe dual licensed as above, without any additional terms or conditions.\n\n\n\u003c!-- Badges --\u003e\n[crates-io-lib]: https://crates.io/crates/rusty-santa\n[crates-io-badge-lib]: https://img.shields.io/crates/v/rusty-santa.svg?maxAge=3600\n[crates-io-cli]: https://crates.io/crates/rusty-santa-cli\n[crates-io-badge-cli]: https://img.shields.io/crates/v/rusty-santa-cli.svg?maxAge=3600\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbrgn%2Frusty-santa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdbrgn%2Frusty-santa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbrgn%2Frusty-santa/lists"}