Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update crates #647

Merged
merged 5 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 52 additions & 62 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 0 additions & 16 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -131,22 +131,6 @@ features = [
"worktree-mutation",
]

# Pin gix-transport to this version, people who don't use --locked will get 0.41.3
# which is either itself broken, or else one the following versions it depends
# on has introduced a bug
# Removing h2 v0.4.3
# Removing http v1.1.0
# Removing http-body v1.0.0
# Removing http-body-util v0.1.1
# Removing hyper v1.2.0
# Removing hyper-util v0.1.3
# Removing pin-project v1.1.5
# Removing pin-project-internal v1.1.5
# Removing reqwest v0.12.1
# Removing tower v0.4.13
# Removing tower-layer v0.3.2
gix-transport = "<=0.41.2"

[dev-dependencies]
# Folder copying
fs_extra = "1.3"
Expand Down
22 changes: 14 additions & 8 deletions src/sources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,20 @@ 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().to_lowercase() == orgname.to_lowercase())
{
let lowered = (!orgname.is_ascii()).then(|| orgname.to_lowercase());

if let Some(ind) = ctx.cfg.allowed_orgs.iter().position(|(sorgt, sorgn)| {
let s = sorgn.value.as_str();
if orgt != *sorgt || s.len() != orgname.len() {
return false;
}

if let Some(orgname_lower) = &lowered {
orgname_lower == &s.to_lowercase()
} else {
s.eq_ignore_ascii_case(orgname)
}
}) {
org_hits.as_mut_bitslice().set(ind, true);
diags::SourceAllowedByOrg {
src_label: sl.get_or_insert_with(label),
Expand Down
2 changes: 1 addition & 1 deletion tests/advisories.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ fn load() -> TestCtx {
advisories::DbSet::load(
"tests/advisory-db".into(),
vec![],
advisories::Fetch::Disallow(time::Duration::days(100)),
advisories::Fetch::Disallow(time::Duration::days(10000)),
)
.unwrap()
};
Expand Down
Loading