diff options
author | Michael Dürre <michael.duerre@highstreet-technologies.com> | 2024-03-22 12:01:26 +0100 |
---|---|---|
committer | Michael Dürre <michael.duerre@highstreet-technologies.com> | 2024-03-22 12:01:38 +0100 |
commit | a8709a236ce96f310002d7de37363ae492d850c2 (patch) | |
tree | 129f0dd2bd553331f617cd6daed5f30368b07cdf | |
parent | 77eac465e8bf46b40dee82f00db9af902947c4c2 (diff) |
fix oauth startup issues
add boot feature into repo. fix oauth config
Issue-ID: SDNC-1838
Change-Id: I638a2de35d7725d6e4136bf9f10e00102764acc2
Signed-off-by: Michael Dürre <michael.duerre@highstreet-technologies.com>
-rw-r--r-- | installation/sdnc/pom.xml | 3 | ||||
-rw-r--r-- | installation/sdnc/src/main/resources/oauth-aaa-app-config.xml | 19 | ||||
-rwxr-xr-x | installation/sdnc/src/main/scripts/startODL.sh | 14 |
3 files changed, 21 insertions, 15 deletions
diff --git a/installation/sdnc/pom.xml b/installation/sdnc/pom.xml index 18994cdc..63c20f49 100644 --- a/installation/sdnc/pom.xml +++ b/installation/sdnc/pom.xml @@ -40,7 +40,8 @@ mvn:org.onap.ccsdk.features.sdnr.northbound/sdnr-northbound-all/${ccsdk.features.version}/xml/features,\ mvn:org.onap.ccsdk.features.sdnr.wt/sdnr-wt-feature-aggregator/${ccsdk.features.version}/xml/features,\ mvn:org.onap.ccsdk.features.sdnr.wt/sdnr-wt-feature-aggregator-devicemanager/${ccsdk.features.version}/xml/features,\ - mvn:org.onap.ccsdk.features.sdnr.wt/sdnr-wt-feature-aggregator-devicemanager-base/${ccsdk.features.version}/xml/features + mvn:org.onap.ccsdk.features.sdnr.wt/sdnr-wt-feature-aggregator-devicemanager-base/${ccsdk.features.version}/xml/features,\ + mvn:org.onap.ccsdk.features.sdnr.wt/sdnr-wt-feature-aggregator-oauth/${ccsdk.features.version}/xml/features </sdnr.features.repo> <!-- SDNC Features Boot --> diff --git a/installation/sdnc/src/main/resources/oauth-aaa-app-config.xml b/installation/sdnc/src/main/resources/oauth-aaa-app-config.xml index 643ed4de..65e34db7 100644 --- a/installation/sdnc/src/main/resources/oauth-aaa-app-config.xml +++ b/installation/sdnc/src/main/resources/oauth-aaa-app-config.xml @@ -26,6 +26,7 @@ <main> <pair-key>tokenAuthRealm</pair-key> + <!--<pair-value>org.opendaylight.aaa.shiro.realm.TokenAuthRealm</pair-value>--> <pair-value>org.onap.ccsdk.features.sdnr.wt.oauthprovider.OAuth2Realm</pair-value> </main> @@ -35,16 +36,13 @@ </main> <!-- Used to support OAuth2 use case. --> <main> - <pair-key>authcBasic</pair-key> - <pair-value>org.opendaylight.aaa.shiro.filters.ODLHttpAuthenticationFilter</pair-value> - </main> - <main> <pair-key>anyroles</pair-key> - <pair-value>org.opendaylight.aaa.shiro.filters.AnyRoleHttpAuthenticationFilter</pair-value> + <pair-value>org.onap.ccsdk.features.sdnr.wt.oauthprovider.filters.AnyRoleHttpAuthenticationFilter</pair-value> </main> <main> <pair-key>authcBearer</pair-key> - <pair-value>org.opendaylight.aaa.shiro.filters.ODLHttpAuthenticationFilter2</pair-value> +<!-- <pair-value>org.apache.shiro.web.filter.authc.BearerHttpAuthenticationFilter</pair-value>--> + <pair-value>org.onap.ccsdk.features.sdnr.wt.oauthprovider.filters.BearerAndBasicHttpAuthenticationFilter</pair-value> </main> <!-- in order to track AAA challenge attempts --> @@ -60,7 +58,7 @@ <!-- Model based authorization scheme supporting RBAC for REST endpoints --> <main> <pair-key>dynamicAuthorization</pair-key> - <pair-value>org.opendaylight.aaa.shiro.realm.MDSALDynamicAuthorizationFilter</pair-value> + <pair-value>org.onap.ccsdk.features.sdnr.wt.oauthprovider.filters.CustomizedMDSALDynamicAuthorizationFilter</pair-value> </main> @@ -70,11 +68,11 @@ </urls> <urls> <pair-key>/**/v1/**</pair-key> - <pair-value>authcBearer, roles[admin]</pair-value> + <pair-value>authcBasic, roles[admin]</pair-value> </urls> <urls> <pair-key>/**/config/aaa*/**</pair-key> - <pair-value>authcBearer, roles[admin]</pair-value> + <pair-value>authcBasic, roles[admin]</pair-value> </urls> <urls> <pair-key>/oauth/**</pair-key> @@ -94,7 +92,6 @@ </urls> <urls> <pair-key>/**</pair-key> - <pair-value>authcBearer, anyroles["admin,provision"]</pair-value> + <pair-value>authcBearer, roles[admin]</pair-value> </urls> </shiro-configuration> - diff --git a/installation/sdnc/src/main/scripts/startODL.sh b/installation/sdnc/src/main/scripts/startODL.sh index eb27e0f8..7de8e508 100755 --- a/installation/sdnc/src/main/scripts/startODL.sh +++ b/installation/sdnc/src/main/scripts/startODL.sh @@ -90,11 +90,15 @@ initialize_sdnrdb() { printf "%s\n" "Execute: $INITCMD" n=0 until [ $n -ge 5 ] ; do - $INITCMD && break + $INITCMD + ret=$? + if [ $ret -eq 0 ] ; then + break; + fi n=$((n+1)) sleep 15 done - return $? + return $ret } install_sdnrwt_features() { @@ -340,6 +344,10 @@ if $SDNRINIT ; then init_result=$? printf "%s\n" "Result of init script: $init_result" if $SDNRWT ; then + if [ $init_result -ne 0 ]; then + echo "db not initialized. stopping container" + exit $init_result + fi printf "Proceed to initialize sdnr\n" else exit $init_result @@ -393,7 +401,7 @@ then if $SDNRWT ; then install_sdnrwt_features ; fi if $ENABLE_OAUTH ; then cp $SDNC_HOME/data/oauth-aaa-app-config.xml $(find $ODL_HOME/system/org/opendaylight/aaa/ -name *aaa-app-config.xml) - echo -e "\norg.ops4j.pax.web.session.cookie = none" >> $ODL_HOME/etc/org.ops4j.pax.web.cfg + echo -e "\norg.ops4j.pax.web.session.cookie.comment = disable" >> $ODL_HOME/etc/org.ops4j.pax.web.cfg install_sdnr_oauth_features fi |