-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
check if key used to sign a signing-key.public.asc was revoked/expired
- ignore expired in case of --auto-trust true - ask if user wants to take a closer look if expired and --auto-trust false => i.e. if user does not respond within 20 seconds we assume it is OK - ask if user wants to trust signing-key.public.asc if key signing it was revoked after the signature was created - error and ignore the signing-key.public.asc if the key signing it was revoked before the signature was created
- Loading branch information
Showing
4 changed files
with
167 additions
and
15 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# __ __ | ||
# / /____ ___ ____ ___ ___ _/ / This script is provided to you by https://github.com/tegonal/scripts | ||
# / __/ -_) _ `/ _ \/ _ \/ _ `/ / It is licensed under Apache License 2.0 | ||
# \__/\__/\_, /\___/_//_/\_,_/_/ Please report bugs and contribute back your improvements | ||
# /___/ | ||
# Version: v4.0.0 | ||
# | ||
####### Description ############# | ||
# | ||
# utility functions for dealing with git | ||
# | ||
####### Usage ################### | ||
# | ||
# #!/usr/bin/env bash | ||
# set -euo pipefail | ||
# shopt -s inherit_errexit | ||
# | ||
# projectDir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]:-$0}")" >/dev/null && pwd 2>/dev/null)/.." | ||
# | ||
# # Assumes tegonal's scripts were fetched with gt - adjust location accordingly | ||
# dir_of_tegonal_scripts="$projectDir/lib/tegonal-scripts/src" | ||
# source "$dir_of_tegonal_scripts/setup.sh" "$dir_of_tegonal_scripts" | ||
# | ||
# sourceOnce "$dir_of_tegonal_scripts/utility/date-utils.sh" | ||
# | ||
# # converts the unix timestamp to a date in format Y-m-dTH:M:S | ||
# timestampToDateTime 1662981524 # outputs 2022-09-12T13:18:44 | ||
# | ||
# dateToTimestamp "2024-03-01" # outputs 1709247600 | ||
# dateToTimestamp "2022-09-12T13:18:44" # outputs 1662981524 | ||
# | ||
################################### | ||
set -euo pipefail | ||
shopt -s inherit_errexit | ||
unset CDPATH | ||
|
||
if ! [[ -v dir_of_tegonal_scripts ]]; then | ||
dir_of_tegonal_scripts="$(cd -- "$(dirname -- "${BASH_SOURCE[0]:-$0}")" >/dev/null && pwd 2>/dev/null)/.." | ||
source "$dir_of_tegonal_scripts/setup.sh" "$dir_of_tegonal_scripts" | ||
fi | ||
sourceOnce "$dir_of_tegonal_scripts/utility/parse-fn-args.sh" | ||
|
||
function timestampToDateTime() { | ||
local timestamp | ||
# shellcheck disable=SC2034 # is passed by name to parseFnArgs | ||
local -ra params=(timestamp) | ||
parseFnArgs params "$@" | ||
date -d "@$timestamp" +"%Y-%m-%dT%H:%M:%S" | ||
} | ||
|
||
function dateToTimestamp() { | ||
local dateAsString | ||
# shellcheck disable=SC2034 # is passed by name to parseFnArgs | ||
local -ra params=(dateAsString) | ||
parseFnArgs params "$@" | ||
date -d "$dateAsString" +%s | ||
} |
This file contains 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
This file contains 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