Repository navigation
fix(scripts/cert): harden csr_generator.sh and install_cert.sh - #30
Merged
Merged
Conversation
Prevent silent overwrite of key and CSR files, fix invalid argument exit code to 1 on stderr, update install_cert.sh shebang to bash with pipefail, support route updates via oc apply, and ensure leading slash on route subdir path. Closes #25
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused changes correctly address the documented certificate safety and OpenShift route update issues.
Pull request overview
Hardens certificate generation and installation scripts against accidental overwrites and route renewal failures.
Changes:
- Adds explicit overwrite controls and correct argument-error handling.
- Makes certificate installation Bash-safe and route updates idempotent.
- Normalizes OpenShift route paths.
File summaries
| File | Description |
|---|---|
scripts/cert/csr_generator.sh |
Adds force/confirmation safeguards and proper error exits. |
scripts/cert/install_cert.sh |
Fixes shell configuration, route updates, and path formatting. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Harden certificate helper scripts in
scripts/cert/:csr_generator.sh:${DOMAIN}.keyor${DOMAIN}.csr: if either file already exists, abort with exit code 1 and error on stderr unless forced with-f/--force, or interactively confirmed, or using an existing key.display_help.-f, --forceflag to options and help output.install_cert.sh:#!/bin/bashand set-euo pipefail.oc create route edgeto generate client-side manifest with--dry-run=client -o yaml | oc apply -f -to preventAlreadyExistsfailure.SUBDIRhas a leading/prefix before passing to--path.Closes #25