MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / verify_crates_io

Function verify_crates_io

scripts/publish.rs:580–625  ·  view source on GitHub ↗
(krate: &Crate)

Source from the content-addressed store, hash-verified

578 }
579
580 fn verify_crates_io(krate: &Crate) {
581 let name = &krate.name;
582 let Some(owners) = curl(&format!("https://crates.io/api/v1/crates/{name}/owners")) else {
583 panic!(
584 "
585failed to get owners for {name}
586
587If this crate does not exist on crates.io yet please visit
588
589 https://docs.wasmtime.dev/contributing-coding-guidelines.html#adding-crates
590
591and follow the instructions there
592",
593 name = name,
594 );
595 };
596
597 // This is the id of the `wasmtime-publish` user on crates.io
598 if !owners.contains("\"id\":73222,") {
599 panic!(
600 "
601crate {name} is not owned by wasmtime-publish, please visit:
602
603 https://docs.wasmtime.dev/contributing-coding-guidelines.html#adding-crates
604
605and follow the instructions there
606",
607 name = name,
608 );
609 }
610
611 // TODO: waiting for trusted publishing to be proven to work before
612 // activating this.
613 if false && owners.split("\"id\"").count() != 2 {
614 panic!(
615 "
616crate {name} is not exclusively owned by wasmtime-publish, please visit:
617
618 https://docs.wasmtime.dev/contributing-coding-guidelines.html#adding-crates
619
620and follow the instructions there
621",
622 name = name,
623 );
624 }
625 }
626}

Callers 1

verify_and_vendorFunction · 0.85

Calls 3

curlFunction · 0.85
splitMethod · 0.80
containsMethod · 0.45

Tested by

no test coverage detected