summaryrefslogtreecommitdiffstats
path: root/auth
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
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')
-rw-r--r--auth/docker/cass.props.init11
-rwxr-xr-x[-rw-r--r--]auth/sample/bin/client.sh38
2 files changed, 36 insertions, 13 deletions
diff --git a/auth/docker/cass.props.init b/auth/docker/cass.props.init
index fc9bab43..75127424 100644
--- a/auth/docker/cass.props.init
+++ b/auth/docker/cass.props.init
@@ -1,3 +1,12 @@
#!/bin/bash
-CASS_HOST=cass.aaf.osaaf.org:<Cass IP>
+# Use for assigning to /etc/hosts, when DNS doesn't have Cassandra FQDN
+CASS_HOST=cass.aaf.osaaf.org:<IP of running Cass>
+
+####
+# Detailed Cassandra Environmental Variables
+####
+# CASSANDRA_CLUSTER=<unsert means default, host from CASS_HOST above, or "localhost">
+# CASSANDRA_USER=<unset means default (cassandra)>
+# CASSANDRA_PASSWORD=<unset means default (cassandra)>
+# CASSANDRA_PORT=<unset means default (9042)>
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 \