Repository: EmbarkStudios/cargo-deny (language: rust)

Issue:
Case-insensitive string comparison for allowed Git organizations
**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](https://github.com/EmbarkStudios/cargo-deny/blob/main/src/sources.rs#L111).


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

Fix patch:
diff --git a/src/sources.rs b/src/sources.rs
index 00bd2535..17e62a3d 100644
--- a/src/sources.rs
+++ b/src/sources.rs
@@ -104,11 +104,13 @@ pub fn check(ctx: crate::CheckCtx<'_, ValidConfig>, sink: impl Into<ErrorSink>)
             };
             get_org(url)
         }) {
+            // .to_lowercase() (ln. 113) enables case insensitivity, as GitHub and
+            // GitLab are case insensitive in regards to namespaces.
             if let Some(ind) = ctx
                 .cfg
                 .allowed_orgs
                 .iter()
-                .position(|(sorgt, sorgn)| orgt == *sorgt && sorgn.value.as_str() == orgname)
+                .position(|(sorgt, sorgn)| orgt == *sorgt && sorgn.value.as_str().to_lowercase() == orgname.to_lowercase())
             {
                 org_hits.as_mut_bitslice().set(ind, true);
                 diags::SourceAllowedByOrg {


Test patch: