summaryrefslogtreecommitdiffstats
path: root/auth/sample/bin/client.sh
diff options
context:
space:
mode:
authorInstrumental <jonathan.gathman@att.com>2018-10-06 20:32:59 -0500
committerInstrumental <jonathan.gathman@att.com>2018-10-06 21:37:15 -0500
commit49525303bc07064d60b3dde3056b2e9e8a379435 (patch)
tree2779f89f45e31b14799daaecaf856d56a448e6cd /auth/sample/bin/client.sh
parent196000bb838818d9e3cc3d5c08614c1898388135 (diff)
Refactor Client Config
Refactored the client to handle multiple keystores without compromising keys, etc. After testing, now valiates just fine Issue-ID: AAF-424, AAF-540 Change-Id: I3b99014dd4b73ae22c359d35658da3bb13745ef9 Signed-off-by: Instrumental <jonathan.gathman@att.com>
Diffstat (limited to 'auth/sample/bin/client.sh')
-rwxr-xr-x[-rw-r--r--]auth/sample/bin/client.sh38
1 files changed, 26 insertions, 12 deletions
diff --git a/auth/sample/bin/client.sh b/auth/sample/bin/client.sh
index ded8c409..99ed2793 100644..100755
--- a/auth/sample/bin/client.sh
+++ b/auth/sample/bin/client.sh
@@ -16,15 +16,24 @@ for (( i=( ${#FQIA_E[@]} -1 ); i>0; i-- )); do
done
NS=${NS}${FQIA_E[0]}
CONFIG="/opt/app/aaf_config"
-LOCAL="/opt/app/osaaf/local"
+OSAAF="/opt/app/osaaf"
+LOCAL="$OSAAF/local"
DOT_AAF="$HOME/.aaf"
SSO="$DOT_AAF/sso.props"
+# Check for local dir
+if [ ! -d $LOCAL ]; then
+ mkdir -p $LOCAL
+ for D in bin logs; do
+ rsync -avzh --exclude=.gitignore $CONFIG/$D/* /opt/app/osaaf/$D
+ done
+fi
+
# Setup Bash, first time only
if [ ! -e "$HOME/.bash_aliases" ] || [ -z "$(grep aaf_config $HOME/.bash_aliases)" ]; then
- echo "alias cadi='$CONFIG/bin/agent.sh EMPTY cadi \$*'" >>$HOME/.bash_aliases
- echo "alias agent='$CONFIG/bin/agent.sh EMPTY \$*'" >>$HOME/.bash_aliases
- chmod a+x $CONFIG/bin/agent.sh
+ echo "alias cadi='$OSAAF/bin/agent.sh EMPTY cadi \$*'" >>$HOME/.bash_aliases
+ echo "alias agent='$OSAAF/bin/agent.sh EMPTY \$*'" >>$HOME/.bash_aliases
+ chmod a+x $OSAAF/bin/agent.sh
. $HOME/.bash_aliases
fi
@@ -34,6 +43,7 @@ function sso_encrypt() {
}
+# Create Deployer Info, located at /root/.aaf
if [ ! -e "$DOT_AAF/keyfile" ]; then
mkdir -p $DOT_AAF
$JAVA -cp $CONFIG/bin/aaf-cadi-aaf-*-full.jar org.onap.aaf.cadi.CmdLine keygen $DOT_AAF/keyfile
@@ -54,17 +64,21 @@ fi
# Only initialize once, automatically...
if [ ! -e $LOCAL/${NS}.props ]; then
- mkdir -p $LOCAL
- for D in bin logs; do
- rsync -avzh --exclude=.gitignore $CONFIG/$D/* /opt/app/osaaf/$D
- done
-
# setup Configs
$JAVA -jar $CONFIG/bin/aaf-cadi-aaf-*-full.jar config $APP_FQI \
- cadi_etc_dir=$LOCAL cadi_prop_files=$SSO
+ aaf_url=https://AAF_LOCATE_URL/AAF_NS.locate:${AAF_INTERFACE_VERSION} \
+ cadi_etc_dir=$LOCAL
+ cat $LOCAL/$NS.props
+
+ # Read Certificate info (by deployer)
+ $JAVA -jar $CONFIG/bin/aaf-cadi-aaf-*-full.jar read ${APP_FQI} ${APP_FQDN} \
+ cadi_prop_files=${SSO} \
+ cadi_etc_dir=$LOCAL
- # Place Certificates
- $JAVA -jar $CONFIG/bin/aaf-cadi-aaf-*-full.jar place ${APP_FQI} ${APP_FQDN}
+ # Place Certificates (by deployer)
+ $JAVA -jar $CONFIG/bin/aaf-cadi-aaf-*-full.jar place ${APP_FQI} ${APP_FQDN} \
+ cadi_prop_files=${SSO} \
+ cadi_etc_dir=$LOCAL
# Validate
$JAVA -jar $CONFIG/bin/aaf-cadi-aaf-*-full.jar validate \