EmbarkStudios / cargo-deny

❌ Cargo plugin for linting your dependencies 🦀
http://embark.rs
Apache License 2.0
1.62k stars 80 forks source link

Case-insensitive string comparison for allowed Git organizations #629

Closed mlegner closed 3 months ago

mlegner commented 4 months ago

Problem description

GitHub and GitLab namespaces (user names, organizations) are case-insensitive. So both github.com/MLeGNer and github.com/mlegner point to the exact same thing. The comparison for allowed organizations in cargo-deny, however, is case-sensitive. This means that the organization needs to be listed with all capitalizations that are used.

For direct dependencies one can control the capitalization, but for indirect ones this is not possible.

Suggested solution

Perform the check for allowed organizations in a case-insensitive way. AFAICT, this means changing the code here.

pmnlla commented 3 months ago

Should be a fairly easy fix, no? Just convert each namespace to lowercase or uppercase before comparison.