diff --git a/bin/check_idp_error_urls.sh b/bin/check_idp_error_urls.sh index 3b4e6cc..0d79fc4 100755 --- a/bin/check_idp_error_urls.sh +++ b/bin/check_idp_error_urls.sh @@ -160,7 +160,7 @@ display_help () { blank in the log file (which is why it is always the last field on any given output line). - ${ERROR_URL_LOG_FILENAME} + ${IDP_ERROR_URL_LOG_FILENAME} A log of each probe. Each line records the result of the probe of a single entity. A line in the log file has the following @@ -179,7 +179,7 @@ display_help () { previous output file. An entity that ends up in this output file was determined by the script to have an errorURL in metadata. - ${ENTITY_NAMES_FILENAME} + ${IDP_NAMES_FILENAME} The names associated with every entity referenced on the command line. A line in the log file has the following tab-delimited fields: @@ -221,8 +221,8 @@ md_tools.sh" # output filenames NO_IDP_ROLE_FILENAME="entities-no-idp-role.txt" NO_ERROR_URL_FILENAME="idps-no-error-url.txt" -ERROR_URL_LOG_FILENAME="idp-error-url-log.txt" -ENTITY_NAMES_FILENAME="idp-names.txt" +IDP_ERROR_URL_LOG_FILENAME="idp-error-url-log.txt" +IDP_NAMES_FILENAME="idp-names.txt" ERROR_LOG_FILENAME="error-log.txt" COMPATIBILITY_SCRIPT_FILENAME="compatibility.sh" @@ -439,16 +439,16 @@ init_out_files () { # output files NO_IDP_ROLE_FILE="$OUT_DIR/$NO_IDP_ROLE_FILENAME" NO_ERROR_URL_FILE="$OUT_DIR/$NO_ERROR_URL_FILENAME" - ERROR_URL_LOG_FILE="$OUT_DIR/$ERROR_URL_LOG_FILENAME" - ENTITY_NAMES_FILE="$OUT_DIR/$ENTITY_NAMES_FILENAME" + IDP_ERROR_URL_LOG_FILE="$OUT_DIR/$IDP_ERROR_URL_LOG_FILENAME" + IDP_NAMES_FILE="$OUT_DIR/$IDP_NAMES_FILENAME" ERROR_LOG_FILE="$OUT_DIR/$ERROR_LOG_FILENAME" COMPATIBILITY_SCRIPT_FILE="$OUT_DIR/$COMPATIBILITY_SCRIPT_FILENAME" # clean up from last time if necessary /bin/rm -f "$NO_IDP_ROLE_FILE" /bin/rm -f "$NO_ERROR_URL_FILE" - /bin/rm -f "$ERROR_URL_LOG_FILE" - /bin/rm -f "$ENTITY_NAMES_FILE" + /bin/rm -f "$IDP_ERROR_URL_LOG_FILE" + /bin/rm -f "$IDP_NAMES_FILE" /bin/rm -f "$ERROR_LOG_FILE" # output cross-script compatibility info @@ -459,8 +459,8 @@ init_out_files () { # output files NO_IDP_ROLE_FILE=$NO_IDP_ROLE_FILE NO_ERROR_URL_FILE=$NO_ERROR_URL_FILE - ERROR_URL_LOG_FILE=$ERROR_URL_LOG_FILE - ENTITY_NAMES_FILE=$ENTITY_NAMES_FILE + IDP_ERROR_URL_LOG_FILE=$IDP_ERROR_URL_LOG_FILE + IDP_NAMES_FILE=$IDP_NAMES_FILE # temporary output directory TMP_DIR="$TMP_DIR" COMPATIBILITY_SCRIPT @@ -473,7 +473,7 @@ print_entity_names_logfile () { local responseCode=$2 local names=$3 - printf "%s\t%s\t%s\n" "$statusCode" "$responseCode" "$names" >> "$ENTITY_NAMES_FILE" + printf "%s\t%s\t%s\n" "$statusCode" "$responseCode" "$names" >> "$IDP_NAMES_FILE" } print_no_idp_role_logfile () { @@ -499,8 +499,8 @@ print_error_url_logfile () { local logfile=$1 - printf "%s %s %s " "$status_code" "$output" "$errorURL" >> "$ERROR_URL_LOG_FILE" - printf "%s %s\n" "$entityID" "$registrarID" >> "$ERROR_URL_LOG_FILE" + printf "%s %s %s " "$status_code" "$output" "$errorURL" >> "$IDP_ERROR_URL_LOG_FILE" + printf "%s %s\n" "$entityID" "$registrarID" >> "$IDP_ERROR_URL_LOG_FILE" } ##################################################################### @@ -563,7 +563,7 @@ $verbose_mode && printf "$script_name using curl opts: %s\n" "$curl_opts" echo "ERROR: $script_name: unable to extract IdP names for entityID: $entityID" >&2 continue fi - echo "$names" >> "$ENTITY_NAMES_FILE" + echo "$names" >> "$IDP_NAMES_FILE" # extract the errorURL from the entity descriptor errorURL=$( echo "$entityDescriptor" \ @@ -574,7 +574,7 @@ $verbose_mode && printf "$script_name using curl opts: %s\n" "$curl_opts" # if there is no errorURL, short-circuit the while-loop if [ -z "$errorURL" ]; then print_no_error_url_logfile "$entityID" "$registrarID" - echo "INFO: $script_name: entity has no errorURL: $entityID" + echo "INFO: $script_name: IdP has no errorURL: $entityID" continue fi @@ -591,7 +591,7 @@ $verbose_mode && printf "$script_name using curl opts: %s\n" "$curl_opts" #print_entity_names_logfile "$status_code" "$response_code" "$names" printf "%s %s %s\n" "$status_code" "$output" "$errorURL" - print_error_url_logfile "$ERROR_URL_LOG_FILE" + print_error_url_logfile "$IDP_ERROR_URL_LOG_FILE" done exit 0 diff --git a/bin/list_local_idp_error_urls.sh b/bin/list_local_idp_error_urls.sh index 27b4234..c405dca 100755 --- a/bin/list_local_idp_error_urls.sh +++ b/bin/list_local_idp_error_urls.sh @@ -168,7 +168,7 @@ for source_filename in $COMMAND_PATHS_FILENAME $COMPATIBLE_MKTEMP_FILENAME $MD_T source "$source_file" >&2 exit_status=$? if [ $exit_status -ne 0 ]; then - echo "ERROR: ${script_name} failed to source script $source_file" >&2 + echo "ERROR: $script_name failed to source script $source_file" >&2 exit $exit_status fi done @@ -205,8 +205,8 @@ print_idp_summary () { heading="Number of IdPs with a good errorURL" value=0 - if [ -f "$ERROR_URL_LOG_FILE" ]; then - value=$( /bin/cat $ERROR_URL_LOG_FILE \ + if [ -f "$IDP_ERROR_URL_LOG_FILE" ]; then + value=$( /bin/cat $IDP_ERROR_URL_LOG_FILE \ | $_GREP " $registrarID\$" \ | $_GREP "^0 redirects:.;response:200" \ | /usr/bin/wc -l @@ -218,8 +218,8 @@ print_idp_summary () { heading="Number of IdPs with a bad errorURL" value=0 - if [ -f "$ERROR_URL_LOG_FILE" ]; then - value=$( /bin/cat $ERROR_URL_LOG_FILE \ + if [ -f "$IDP_ERROR_URL_LOG_FILE" ]; then + value=$( /bin/cat $IDP_ERROR_URL_LOG_FILE \ | $_GREP " $registrarID\$" \ | $_GREP -v "^0 redirects:.;response:200" \ | /usr/bin/wc -l @@ -270,7 +270,7 @@ print_idp_list () { printf "[\n" # print list of IdPs with an errorURL in metadata - entityIDs=$( /bin/cat "$ERROR_URL_LOG_FILE" \ + entityIDs=$( /bin/cat "$IDP_ERROR_URL_LOG_FILE" \ | $_GREP " $registrarID\$" \ | $_CUT -f4 -d" " ) @@ -284,12 +284,12 @@ print_idp_list () { fi # get the names for this IdP - names=$( /bin/cat "$ENTITY_NAMES_FILE" | $_GREP -m 1 "^$entityID\t" ) + names=$( /bin/cat "$IDP_NAMES_FILE" | $_GREP -m 1 "^$entityID\t" ) displayName=$( echo "$names" | $_CUT -f2 ) orgName=$( echo "$names" | $_CUT -f3 ) # get the errorURL for this IdP - log=$( /bin/cat "$ERROR_URL_LOG_FILE" | $_GREP -F -m 1 " $entityID " ) + log=$( /bin/cat "$IDP_ERROR_URL_LOG_FILE" | $_GREP -F -m 1 " $entityID " ) errorURL=$( echo "$log" | $_CUT -f3 -d" " ) # get the codes for this IdP @@ -315,7 +315,7 @@ print_idp_list () { fi # get the names for this IdP - names=$( /bin/cat "$ENTITY_NAMES_FILE" | $_GREP -m 1 "^$entityID\t" ) + names=$( /bin/cat "$IDP_NAMES_FILE" | $_GREP -m 1 "^$entityID\t" ) displayName=$( echo "$names" | $_CUT -f2 ) orgName=$( echo "$names" | $_CUT -f3 ) @@ -337,7 +337,7 @@ print_idp_list () { ####################################################################### # output files -idp_summary_file="$out_dir/local-idp-error_url-summary.json" +idp_summary_file="$out_dir/local-idp-error-url-summary.json" idp_list_file="$out_dir/local-idp-error-url-list.json" # clean up