Skip to content

Commit

Permalink
Merge pull request #1857 from nordic-institute/XRDDEV-2512
Browse files Browse the repository at this point in the history
fix: Management service API key creation fails silently during Central Server installation/upgrade
  • Loading branch information
mikkbachmann committed Nov 17, 2023
2 parents 1f90e9f + de238d4 commit 5a3da20
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ else
PGDATABASE="$db_database" PGUSER="$db_user" PGPASSWORD="$db_password" psql -h "$db_host" -p "$db_port" -qtA -c \
"INSERT INTO apikey(id, encodedkey) VALUES ((SELECT NEXTVAL('hibernate_sequence')), '$encoded_token');
INSERT INTO apikey_roles(apikey_id,role) VALUES ((SELECT id FROM apikey WHERE encodedkey = '$encoded_token'), 'XROAD_MANAGEMENT_SERVICE');"
if [ $? -ne 0 ] ; then
echo "Failed to finish configuring new API KEY"
exit 1
fi
crudini --set /etc/xroad/conf.d/local.ini "$1" api-token "$token"
echo "New API KEY successfully configured"
fi

0 comments on commit 5a3da20

Please sign in to comment.