When using credentials from /etc/default/ngcp-api, we need to use the
"api_admin_system" realm, which gets enabled by passing the
«NGCP-UserAgent: NGCP::API::Client» header to the request. This though
only works for the matching endpoint (host and port) specified in that
file. Otherwise when we using the credentials from the legacy
$HOME/.ngcp-api file and to preserve backwards compatibility, we should
use the "api_admin_http" realm, which is the default, by not passing the
above header in the request.
To make this behavior more clear, we try to validate the free-form URL
passed by the user and error out if it does not match when using the new
credentials.
Change-Id: Ic80d2724a20ec951918c88d7f2994c85b5b63910
This unifies these tools from the ones in the ngcp-api-tools package.
We also remove the hardcoded credentials from the scripts, as a best
practice.
Change-Id: I749f008ef5c45c3cd770432fde56cca7f8624d19
The variable $CREDS is necessary for /usr/share/ngcp-panel-tools/ngcp-api.inc
so we need to pass it explicetly to prevent shellcheck warnings here.
Change-Id: Ic26425bab6b7f4b71aa267db3ec897245753b64d