[neon/ubuntu-core] /: Use canonical as authority-id if the account is not verified

Kevin Ottens null at kde.org
Thu Apr 4 15:07:20 BST 2024


Git commit 18497ffda71ec3542224fead6c11bce3e8d88bb4 by Kevin Ottens.
Committed on 04/04/2024 at 14:07.
Pushed by ervin into branch 'master'.

Use canonical as authority-id if the account is not verified

M  +8    -1    finalize-json.sh

https://invent.kde.org/neon/ubuntu-core/-/commit/18497ffda71ec3542224fead6c11bce3e8d88bb4

diff --git a/finalize-json.sh b/finalize-json.sh
index b3e8765..a5e5dac 100755
--- a/finalize-json.sh
+++ b/finalize-json.sh
@@ -5,9 +5,16 @@ INPUT=$2
 OUTPUT=$3
 
 UBUNTU_ID=`snapcraft whoami | grep '^id:' | awk '{print $2;}'`
+ACCOUNT_VALIDATION=`snap known --remote account account-id=$UBUNTU_ID | grep '^validation:' | awk '{print $2;}'`
 TIMESTAMP=`date -Iseconds --utc`
+
+AUTHORITY_ID="canonical"
+if [ $ACCOUNT_VALIDATION = "verified" ]; then
+  AUTHORITY_ID=$UBUNTU_ID
+fi
+
 JQ_SCRIPT="
-  .[\"authority-id\"] = \"$UBUNTU_ID\" | 
+  .[\"authority-id\"] = \"$AUTHORITY_ID\" |
   .[\"brand-id\"] = \"$UBUNTU_ID\" |
   .[\"grade\"] = \"$GRADE\" |
   .[\"display-name\"] = (.[\"display-name\"] + \", $GRADE\") |


More information about the Neon-commits mailing list