Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ fn validate_ref (ref_name: &String, req: &HttpRequest) -> Result<(),ApiError>
}
req.has_token_prefix(ref_parts[1])
},
_ => Err(ApiError::BadRequest(format!("Invalid ref_name {}", ref_name))),
_ => Ok(()), // Err(ApiError::BadRequest(format!("Invalid ref_name {}", ref_name))),
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think rather than completely removing the check, it would be better to add a configuration option to disable it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or maybe make it non-fatal, but still logged?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think allowing any refs at all is a good idea. Clients can then e.g. replace appstream/x86_64 or other internal "trusted" refs. Allowing some prefix seems better.

}
}

Expand Down
4 changes: 4 additions & 0 deletions src/jobs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,10 @@ impl PublishJobInstance {
.arg(&src_repo_arg)
.arg(&repoconfig.path);

for build_ref in build_refs.iter() {
cmd.arg(&build_ref.ref_name);
}

job_log_and_info(self.job_id, conn,
&format!("Importing build to repo {}", repoconfig.name));
do_command(cmd)?;
Expand Down