- Implemented tests for RouterConfig, RoutingOptions, StaticInstanceConfig, and RouterConfigOptions to ensure default values are set correctly. - Added tests for RouterConfigProvider to validate configurations and ensure defaults are returned when no file is specified. - Created tests for ConfigValidationResult to check success and error scenarios. - Developed tests for ServiceCollectionExtensions to verify service registration for RouterConfig. - Introduced UdpTransportTests to validate serialization, connection, request-response, and error handling in UDP transport. - Added scripts for signing authority gaps and hashing DevPortal SDK snippets.
29 lines
959 B
Bash
29 lines
959 B
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
# Deterministic hashing helper for DevPortal SDK snippet packs and offline bundle artefacts.
|
|
# Usage:
|
|
# SNIPPET_DIR=src/DevPortal/StellaOps.DevPortal.Site/snippets \
|
|
# OUT_SHA=src/DevPortal/StellaOps.DevPortal.Site/SHA256SUMS.devportal-stubs \
|
|
# tools/devportal/hash-snippets.sh
|
|
|
|
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
|
SNIPPET_DIR="${SNIPPET_DIR:-$ROOT/src/DevPortal/StellaOps.DevPortal.Site/snippets}"
|
|
OUT_SHA="${OUT_SHA:-$ROOT/src/DevPortal/StellaOps.DevPortal.Site/SHA256SUMS.devportal-stubs}"
|
|
|
|
if [[ ! -d "$SNIPPET_DIR" ]]; then
|
|
echo "Snippet dir not found: $SNIPPET_DIR" >&2
|
|
exit 1
|
|
fi
|
|
|
|
mkdir -p "$(dirname "$OUT_SHA")"
|
|
: > "$OUT_SHA"
|
|
|
|
cd "$SNIPPET_DIR"
|
|
find . -type f -print0 | sort -z | while IFS= read -r -d '' f; do
|
|
sha=$(sha256sum "$f" | cut -d' ' -f1)
|
|
printf "%s %s\n" "$sha" "${SNIPPET_DIR#$ROOT/}/$f" >> "$OUT_SHA"
|
|
echo "hashed $f"
|
|
done
|
|
|
|
echo "Hashes written to $OUT_SHA"
|