<commit_before>#!/bin/bash

set -x -e

credhub l 

TOKEN="$(credhub --token)"
echo "$CREDHUB_CA_CERT" > ca.pem

wget https://s3.amazonaws.com/credhub-cli-tarballs/credhub-linux-1.5.0-beta.46.tgz
tar xvf credhub-linux-1.5.0-beta.46.tgz

echo $CAS_TO_ROTATE | jq -r .[] | while read object; do
  ./credhub regenerate --name $object > /dev/null
  #Hackily set the value to include the prior certificate for gradual rotation
  ./credhub set --type certificate --name $object --certificate "$(./credhub g -n $object --versions 2 --output-json | jq -r .versions[0].value.certificate & ./credhub g -n $object --versions 2 --output-json | jq -r .versions[1].value.certificate)" --private "$(./credhub g -n $object --output-json | jq -r .value.private_key)"
done
<commit_msg>Switch order of CAs in stack<commit_after>#!/bin/bash

set -x -e

credhub l 

TOKEN="$(credhub --token)"
echo "$CREDHUB_CA_CERT" > ca.pem

wget https://s3.amazonaws.com/credhub-cli-tarballs/credhub-linux-1.5.0-beta.46.tgz
tar xvf credhub-linux-1.5.0-beta.46.tgz

echo $CAS_TO_ROTATE | jq -r .[] | while read object; do
  ./credhub regenerate --name $object > /dev/null
  #Hackily set the value to include the prior certificate for gradual rotation
  ./credhub set --type certificate --name $object --certificate "$(./credhub g -n $object --versions 2 --output-json | jq -r .versions[1].value.certificate & ./credhub g -n $object --versions 2 --output-json | jq -r .versions[0].value.certificate)" --private "$(./credhub g -n $object --output-json | jq -r .value.private_key)"
done

{'fraction_non_alphanumeric': 0.16418875242404654, 'fraction_numerical': 0.019392372333548805, 'mean_word_length': 3.2527472527472527, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5903283', 'n_tokens_mistral': 583, 'n_tokens_neox': 556, 'n_words': 161}