Skip to content

Commit

Permalink
Fix security enabling by property
Browse files Browse the repository at this point in the history
  • Loading branch information
Alberto Brigandì committed May 23, 2016
1 parent 44d95a3 commit 961a0d4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ ENV IM_URL="" \
OPENSTACK_AUTH_FILE_PATH="" \
ONEDOCK_AUTH_FILE_PATH=""

ENV SECURITY_ENABLE="false" \
ENV SECURITY_ENABLE="" \
OIDC_ISSUERS="" \
OIDC_CLIENT_ID="" \
OIDC_CLIENT_SECRET=""
Expand Down
5 changes: 3 additions & 2 deletions docker/launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ if [[ $ONEDOCK_AUTH_FILE_PATH ]];
fi;

# CUSTOMIZE SECURITY PROPERTIES
if [[ $SECURITY_ENABLE ]];
then sed -i "s/^\(security\.enabled=\).*$/\1$(echo $SECURITY_ENABLE | sed -e 's/[\/&]/\\&/g')/" ${SECURITY_PROP_FILE};
if [ $SECURITY_ENABLE = "true"];
then sed -i "s/^\(security\.enabled=\).*$/\1$(echo 'true' | sed -e 's/[\/&]/\\&/g')/" ${SECURITY_PROP_FILE};
else sed -i "s/^\(security\.enabled=\).*$/\1$(echo 'false' | sed -e 's/[\/&]/\\&/g')/" ${SECURITY_PROP_FILE};
fi;

if [[ $OIDC_ISSUERS ]];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.mitre.openid.connect.client.service.impl.StaticClientConfigurationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;
Expand Down Expand Up @@ -49,6 +50,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
private boolean securityEnabled;

@Configuration
@ConditionalOnProperty(name = "security.enabled", havingValue = "true")
public static class OidcConfig {

@Value("${OIDC.issuers}")
Expand Down

0 comments on commit 961a0d4

Please sign in to comment.