Regenerate secrets to publish charms

Add utility for generating a new secret.

Change-Id: If1c379ba88a8ab012bee1fc70265966f59c17dea
This commit is contained in:
Guillaume Boutry 2024-01-12 14:05:29 +01:00
parent cd5418a0a3
commit 81be68e168
No known key found for this signature in database
GPG Key ID: E95E3326872E55DE
3 changed files with 117 additions and 62 deletions

3
.gitignore vendored
View File

@ -9,3 +9,6 @@ __pycache__/
*.py[cod] *.py[cod]
**.swp **.swp
.stestr/ .stestr/
*.auth
*.pub
*.token

53
generate_token.sh Executable file
View File

@ -0,0 +1,53 @@
#!/bin/bash
# This script generates a token that can publish the charms to charmhub.
# The token is specific to every charms inside this repository, and has to be
# generated every time a new charm is added to the repository (or when it is
# expired).
if ! command -v charmcraft &> /dev/null
then
echo "charmcraft could not be found"
echo "Install it with: snap install charmcraft --classic"
exit 1
fi
if ! command -v zuul-client &> /dev/null
then
echo "zuul-client could not be found"
echo "Install it with: pip install zuul-client"
exit 1
fi
opt_charm=""
for charm in $(cat charms/*/{metadata,charmcraft}.yaml | grep -e "^name: " | awk '{print $2}'); do
opt_charm="$opt_charm --charm=$charm"
done
set -x
charmcraft login --export=sunbeam-charms.auth \
$opt_charm \
--permission=package-manage-metadata \
--permission=package-manage-releases \
--permission=package-manage-revisions \
--permission=package-view-metadata \
--permission=package-view-releases \
--permission=package-view-revisions \
--ttl=7776000
# Fetch project public key
[ ! -f "sunbeam-charms.pub" ] && curl https://zuul.opendev.org/api/tenant/openstack/key/opendev.org/openstack/sunbeam-charms.pub -o sunbeam-charms.pub
zuul-client --zuul-url https://zuul.opendev.org encrypt \
--public-key sunbeam-charms.pub \
--tenant openstack \
--project opendev.org/openstack/sunbeam-charms \
--secret-name charmhub_token \
--field-name value \
--infile sunbeam-charms.auth \
--outfile sunbeam-charms.charmhub.token
generated="\ # Generated on $(date --iso-8601=seconds --utc) with 90 days ttl"
sed '1d' < sunbeam-charms.charmhub.token | sed "4 i $generated" > zuul.d/secrets.yaml

View File

@ -1,66 +1,65 @@
- secret: - secret:
name: charmhub_token name: charmhub_token
data: data:
# Generated on 06-Dec-2023 with 90 days ttl # Generated on 2024-01-12T13:04:48+00:00 with 90 days ttl
value: !encrypted/pkcs1-oaep value: !encrypted/pkcs1-oaep
- jhfqdXPfF4Ta32M+niY9sTcr3oiRROr90OKDF4GeqhPfGqnAkQUG7nSSuyDX51Uf+bLKh - fojARxWlJPEVDv9FIq1kH9njVwjTQen/dgEQEUnsGtZ3Kuueta74+q8yDEI+VYkp2CoEh
zVImXVofiYGbJJag6NYxy5DGE+gQh/uYd3eJM2/h9u9Er01OOYSXLW6z/RZBMgLirMPrN q2AugV4EgeOy9SMwZbnTmEBXrs/NBetK1K9QcfYagFkaOvd0BAQwu5vqkFYtJUFt7NF6O
+PVEIT9mzbNhJxKP4es97QbXp+ySVnFdOqHxT86XEIK+YY9bEB7jiow01/7qOD0c9FiQj gfnvYJEAdUbijCpf9qlIECkGKy2B6EExE3mdTAWfiWO0PasTzghsyzrZHw2cecwHxQtgY
bw0+OrUxK7fUlZ7E1TbF0BJP3pE5euvHOvnvzy4x7u3gHJaafpgPF2CxtZ9mvt0t6DQe7 35AyuOepixJXl8ZZe+M4rptcUCwkNgHSLjIrnVkPN/slPPjD5QMWAlMchk4MJ3PdhfFH5
umW/njfPpjxU9LAgQ6G/K7cNz7QOAGBr0p3+fAscGCh+Pl8EgwE6QrnY0NJXDWiOItJdN e1msBZI11eogC75Qsd3ihK8rPvVlrGx5Wtm3RTqXbUOdTowa8ODhIIT5S9QyzZAGgChX5
2Ah4PQJaLY+ly6gJIbPApE4xlbmAlYNah2isB+uBi6q/sH0wUjSEfCpeQmAlhkc0YJtqn kxhu47P6Juj4dOh/hy+bRjQxXa0rp/sGO2s+A/G0doS0DwQxJXhewPIXU03dyljmTYxpD
uOqE9n2KKaMcb/E2xtHNqOBTTLv54B1J3NUtZMhysxZApSSBECUUg1tWZOWtSk3nHv2Bx +D4msfpR898ToU1QzJ5HUGRS/IjxLz0g3xVplcMuc3trQ7F2L4xFqS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