forked from mirrors/kingfisher
changes in response to code review
This commit is contained in:
parent
0bdd68c900
commit
a912043eb9
3 changed files with 6 additions and 4 deletions
|
|
@ -103,8 +103,10 @@ pub async fn enumerate_repo_urls(
|
|||
// nothing
|
||||
}
|
||||
}
|
||||
|
||||
let projects_ep = builder.build()?; // now no borrows of a temporary
|
||||
|
||||
// Extract the builder to a separate variable to avoid borrowing a temporary,
|
||||
// allowing us to modify its fields before building the endpoint.
|
||||
let projects_ep = builder.build()?;
|
||||
let projects: Vec<SimpleProject> = projects_ep.query(&client)?;
|
||||
|
||||
for proj in projects {
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ pub async fn validate_jwt(token: &str) -> Result<(bool, String)> {
|
|||
let aud_strings = extract_aud_strings(&claims);
|
||||
|
||||
if issuer.trim().is_empty() && aud_strings.iter().all(|s| s.trim().is_empty()) {
|
||||
return Ok((false, "JWT missing issuer and audience".to_string()));
|
||||
return Ok((false, "JWT missing issuer and audience".into()));
|
||||
}
|
||||
if let Some(iss) = claims.iss.clone() {
|
||||
// parse header now (kid, alg)
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ fn scan_rules_has_no_validated_findings() -> Result<()> {
|
|||
|
||||
// Fail only on genuinely validated secrets
|
||||
assert_ne!(
|
||||
status.as_str(),
|
||||
&status,
|
||||
"active credential",
|
||||
"Validated finding detected in rule {rule_id}"
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue