Skip to content

Commit a1176e7

Browse files
uvizhedapplion
andauthored
Add insecure-dep test task to Makefile and CI (#8464)
#8106 I added `insecure-deps` target to Makefile and a new step into `check-code` section of test-suite CI workflow that uses the former. That bash multiliner is not ideal, I'd prefer a cargo plugin instead but none exists. I also changed Cargo.toml to test that the new CI check works. Once we see a pipeline fails, I revert the change. Co-Authored-By: Alexander Uvizhev <uvizhe@gmail.com> Co-Authored-By: chonghe <44791194+chong-he@users.noreply.github.com> Co-Authored-By: dapplion <35266934+dapplion@users.noreply.github.com>
1 parent 8948159 commit a1176e7

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

.github/workflows/test-suite.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,8 @@ jobs:
319319
bins: cargo-audit,cargo-deny
320320
- name: Check formatting with cargo fmt
321321
run: make cargo-fmt
322+
- name: Check dependencies for unencrypted HTTP links
323+
run: make insecure-deps
322324
- name: Lint code for quality and style with Clippy
323325
run: make lint-full
324326
- name: Certify Cargo.lock freshness

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,12 @@ vendor:
343343
udeps:
344344
cargo +$(PINNED_NIGHTLY) udeps --tests --all-targets --release --features "$(TEST_FEATURES)"
345345

346+
# Checks Cargo.toml files for unencrypted HTTP links
347+
insecure-deps:
348+
@ BAD_LINKS=$$(find . -name Cargo.toml | xargs grep -n "http://" || true); \
349+
if [ -z "$$BAD_LINKS" ]; then echo "No insecure HTTP links found"; \
350+
else echo "$$BAD_LINKS"; echo "Using plain HTTP in Cargo.toml files is forbidden"; exit 1; fi
351+
346352
# Performs a `cargo` clean and cleans the `ef_tests` directory.
347353
clean:
348354
cargo clean

0 commit comments

Comments
 (0)