#!/usr/bin/env bash # # Author: Hari Sekhon # Date: 2020-08-16 18:13:02 +0100 (Sun, 16 Aug 2020) # # https://github.com/HariSekhon/DevOps-Bash-tools # # License: see accompanying LICENSE file # # https://www.linkedin.com/in/HariSekhon # # https://docs.gitlab.com/ee/api/users.html#list-ssh-keys set -euo pipefail [ -n "${DEBUG:-}" ] && set -x srcdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" usage(){ cat < 100 SSH keys I want to know what is going on first! echo "# Fetching SSH Public Key(s) from GitLab for currently authenticated account" >&2 echo "#" >&2 # authenticated query "$srcdir/gitlab_api.sh" "/user/keys" | jq -r '.[] | [.key, .title] | @tsv'