Skip to content
This repository has been archived by the owner on Mar 11, 2021. It is now read-only.

Commit

Permalink
Changed F8_ env var prefix to AUTH_
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeykazakov committed Jul 15, 2017
1 parent 6dab939 commit 7833ae6
Show file tree
Hide file tree
Showing 16 changed files with 77 additions and 77 deletions.
4 changes: 2 additions & 2 deletions .make/docker.mk
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ endif
ifeq ($(strip $(shell docker inspect --format '{{ .NetworkSettings.IPAddress }}' make_postgres_integration_test_1 2>/dev/null)),)
$(error Failed to find PostgreSQL container. Try running "make integration-test-env-prepare")
endif
$(eval F8_POSTGRES_HOST := $(shell docker inspect --format '{{ .NetworkSettings.IPAddress }}' make_postgres_integration_test_1 2>/dev/null))
docker exec -t $(DOCKER_RUN_INTERACTIVE_SWITCH) "$(DOCKER_CONTAINER_NAME)" bash -ec 'export F8_POSTGRES_HOST=$(F8_POSTGRES_HOST); make $(makecommand)'
$(eval AUTH_POSTGRES_HOST := $(shell docker inspect --format '{{ .NetworkSettings.IPAddress }}' make_postgres_integration_test_1 2>/dev/null))
docker exec -t $(DOCKER_RUN_INTERACTIVE_SWITCH) "$(DOCKER_CONTAINER_NAME)" bash -ec 'export AUTH_POSTGRES_HOST=$(AUTH_POSTGRES_HOST); make $(makecommand)'

# This is a wildcard target to let you call any make target from the normal makefile
# but it will run inside the docker container. This target will only get executed if
Expand Down
18 changes: 9 additions & 9 deletions .make/test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ GO_TEST_VERBOSITY_FLAG ?= -v

# By default use the "localhost" or specify manually during make invocation:
#
# F8_POSTGRES_HOST=somehost make test-integration
# AUTH_POSTGRES_HOST=somehost make test-integration
#
F8_POSTGRES_HOST ?= localhost
AUTH_POSTGRES_HOST ?= localhost

# Output directory for coverage information
COV_DIR = $(TMP_PATH)/coverage
Expand Down Expand Up @@ -144,7 +144,7 @@ test-unit: prebuild-check clean-coverage-unit $(COV_PATH_UNIT)
test-unit-no-coverage: prebuild-check $(SOURCES)
$(call log-info,"Running test: $@")
$(eval TEST_PACKAGES:=$(shell go list ./... | grep -v $(ALL_PKGS_EXCLUDE_PATTERN)))
F8_DEVELOPER_MODE_ENABLED=1 F8_RESOURCE_UNIT_TEST=1 go test $(GO_TEST_VERBOSITY_FLAG) $(TEST_PACKAGES)
AUTH_DEVELOPER_MODE_ENABLED=1 AUTH_RESOURCE_UNIT_TEST=1 go test $(GO_TEST_VERBOSITY_FLAG) $(TEST_PACKAGES)

.PHONY: test-integration
## Runs the integration tests and produces coverage files for each package.
Expand All @@ -157,12 +157,12 @@ test-integration: prebuild-check clean-coverage-integration migrate-database $(C
test-integration-no-coverage: prebuild-check migrate-database $(SOURCES)
$(call log-info,"Running test: $@")
$(eval TEST_PACKAGES:=$(shell go list ./... | grep -v $(ALL_PKGS_EXCLUDE_PATTERN)))
F8_DEVELOPER_MODE_ENABLED=1 F8_RESOURCE_DATABASE=1 F8_RESOURCE_UNIT_TEST=0 go test $(GO_TEST_VERBOSITY_FLAG) $(TEST_PACKAGES)
AUTH_DEVELOPER_MODE_ENABLED=1 AUTH_RESOURCE_DATABASE=1 AUTH_RESOURCE_UNIT_TEST=0 go test $(GO_TEST_VERBOSITY_FLAG) $(TEST_PACKAGES)

test-integration-benchmark: prebuild-check migrate-database $(SOURCES)
$(call log-info,"Running benchmarks: $@")
$(eval TEST_PACKAGES:=$(shell go list ./... | grep -v $(ALL_PKGS_EXCLUDE_PATTERN)))
F8_DEVELOPER_MODE_ENABLED=1 F8_LOG_LEVEL=error F8_RESOURCE_DATABASE=1 F8_RESOURCE_UNIT_TEST=0 go test -run=^$$ -bench=. -cpu 1,2,4 -test.benchmem $(GO_TEST_VERBOSITY_FLAG) $(TEST_PACKAGES)
AUTH_DEVELOPER_MODE_ENABLED=1 AUTH_LOG_LEVEL=error AUTH_RESOURCE_DATABASE=1 AUTH_RESOURCE_UNIT_TEST=0 go test -run=^$$ -bench=. -cpu 1,2,4 -test.benchmem $(GO_TEST_VERBOSITY_FLAG) $(TEST_PACKAGES)

.PHONY: test-remote
## Runs the remote tests and produces coverage files for each package.
Expand All @@ -173,13 +173,13 @@ test-remote: prebuild-check clean-coverage-remote $(COV_PATH_REMOTE)
test-remote-no-coverage: prebuild-check $(SOURCES)
$(call log-info,"Running test: $@")
$(eval TEST_PACKAGES:=$(shell go list ./... | grep -v $(ALL_PKGS_EXCLUDE_PATTERN)))
F8_DEVELOPER_MODE_ENABLED=1 F8_RESOURCE_REMOTE=1 F8_RESOURCE_UNIT_TEST=0 go test $(GO_TEST_VERBOSITY_FLAG) $(TEST_PACKAGES)
AUTH_DEVELOPER_MODE_ENABLED=1 AUTH_RESOURCE_REMOTE=1 AUTH_RESOURCE_UNIT_TEST=0 go test $(GO_TEST_VERBOSITY_FLAG) $(TEST_PACKAGES)

.PHONY: test-migration
## Runs the migration tests and should be executed before running the integration tests
## in order to have a clean database
test-migration: prebuild-check
F8_RESOURCE_DATABASE=1 go test $(GO_TEST_VERBOSITY_FLAG) github.com/fabric8-services/fabric8-auth/migration
AUTH_RESOURCE_DATABASE=1 go test $(GO_TEST_VERBOSITY_FLAG) github.com/fabric8-services/fabric8-auth/migration

# Downloads docker-compose to tmp/docker-compose if it does not already exist.
define download-docker-compose
Expand Down Expand Up @@ -416,7 +416,7 @@ $(eval ENV_VAR := $(5))
$(eval ALL_PKGS_COMMA_SEPARATED := $(6))
@mkdir -p $(COV_DIR)/$(PACKAGE_NAME);
$(eval COV_OUT_FILE := $(COV_DIR)/$(PACKAGE_NAME)/coverage.$(TEST_NAME).mode-$(COVERAGE_MODE))
@$(ENV_VAR) F8_DEVELOPER_MODE_ENABLED=1 F8_POSTGRES_HOST=$(F8_POSTGRES_HOST) \
@$(ENV_VAR) AUTH_DEVELOPER_MODE_ENABLED=1 AUTH_POSTGRES_HOST=$(AUTH_POSTGRES_HOST) \
go test $(PACKAGE_NAME) \
$(GO_TEST_VERBOSITY_FLAG) \
-coverprofile $(COV_OUT_FILE) \
Expand Down Expand Up @@ -476,7 +476,7 @@ $(COV_PATH_INTEGRATION): $(SOURCES) $(GOCOVMERGE_BIN)
@-rm -f $(ERRORS_FILE)
$(eval TEST_PACKAGES:=$(shell go list ./... | grep -v $(ALL_PKGS_EXCLUDE_PATTERN)))
$(eval ALL_PKGS_COMMA_SEPARATED:=$(shell echo $(TEST_PACKAGES) | tr ' ' ,))
$(foreach package, $(TEST_PACKAGES), $(call test-package,$(TEST_NAME),$(package),$(COV_PATH_INTEGRATION),$(ERRORS_FILE),F8_RESOURCE_DATABASE=1 F8_RESOURCE_UNIT_TEST=0,$(ALL_PKGS_COMMA_SEPARATED)))
$(foreach package, $(TEST_PACKAGES), $(call test-package,$(TEST_NAME),$(package),$(COV_PATH_INTEGRATION),$(ERRORS_FILE),AUTH_RESOURCE_DATABASE=1 AUTH_RESOURCE_UNIT_TEST=0,$(ALL_PKGS_COMMA_SEPARATED)))
$(call check-test-results,$(ERRORS_FILE))

# NOTE: We don't have prebuild-check as a dependency here because it would cause
Expand Down
16 changes: 8 additions & 8 deletions Dockerfile.deploy
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,30 @@ FROM centos:7
LABEL maintainer "Devtools <[email protected]>"
LABEL author "Konrad Kleine <[email protected]>"
ENV LANG=en_US.utf8
ENV F8_INSTALL_PREFIX=/usr/local/auth
ENV AUTH_INSTALL_PREFIX=/usr/local/auth

# Create a non-root user and a group with the same name: "auth"
ENV F8_USER_NAME=auth
RUN useradd --no-create-home -s /bin/bash ${F8_USER_NAME}
ENV AUTH_USER_NAME=auth
RUN useradd --no-create-home -s /bin/bash ${AUTH_USER_NAME}

COPY bin/auth ${F8_INSTALL_PREFIX}/bin/auth
COPY config.yaml ${F8_INSTALL_PREFIX}/etc/config.yaml
COPY bin/auth ${AUTH_INSTALL_PREFIX}/bin/auth
COPY config.yaml ${AUTH_INSTALL_PREFIX}/etc/config.yaml

# Install little pcp pmcd server for metrics collection
# would prefer only pmcd, and not the /bin/pm*tools etc.
COPY pcp.repo /etc/yum.repos.d/pcp.repo
RUN yum install -y pcp && yum clean all && \
mkdir -p /etc/pcp /var/run/pcp /var/lib/pcp /var/log/pcp && \
chown -R ${F8_USER_NAME} /etc/pcp /var/run/pcp /var/lib/pcp /var/log/pcp && \
chown -R ${AUTH_USER_NAME} /etc/pcp /var/run/pcp /var/lib/pcp /var/log/pcp && \
chmod -R ug+rw /etc/pcp /var/run/pcp /var/lib/pcp /var/log/pcp
COPY ./auth+pmcd.sh /auth+pmcd.sh
EXPOSE 44321


# From here onwards, any RUN, CMD, or ENTRYPOINT will be run under the following user
USER ${F8_USER_NAME}
USER ${AUTH_USER_NAME}

WORKDIR ${F8_INSTALL_PREFIX}
WORKDIR ${AUTH_INSTALL_PREFIX}
ENTRYPOINT [ "/auth+pmcd.sh" ]

EXPOSE 8089
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ regenerate: clean-generated generate
.PHONY: dev
dev: prebuild-check deps generate $(FRESH_BIN)
docker-compose up -d db
F8_DEVELOPER_MODE_ENABLED=true $(FRESH_BIN)
AUTH_DEVELOPER_MODE_ENABLED=true $(FRESH_BIN)

include ./.make/test.mk

Expand Down
4 changes: 2 additions & 2 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,9 @@ github.secret : 2fe6736e90a9283036a37059d75ac0c82f4f5288
Although this is a YAML file, we highly suggest to stick to this rather lenghty notation instead of nesting structs.

To override configuration values using environment variables, use the prefix
`F8_` and replace the dots in the variables names with underscores.
`AUTH_` and replace the dots in the variables names with underscores.

For example to override `postgres.password`, set the environment variable `F8_POSTGRES_PASSWORD` to the value of you liking.
For example to override `postgres.password`, set the environment variable `AUTH_POSTGRES_PASSWORD` to the value of you liking.

NOTE: Environment variables override the default values and the ones you've set in your config file.

Expand Down
2 changes: 1 addition & 1 deletion config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ token.publickey : |
ZwIDAQAB
-----END PUBLIC KEY-----
#auth.notapproved.redirect : https://manage.openshift.com/openshiftio
#notapproved.redirect : https://manage.openshift.com/openshiftio

# ----------------------------
# Keycloak OAuth2.0 configuration
Expand Down
14 changes: 7 additions & 7 deletions configuration/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const (
varKeycloakEndpointLogout = "keycloak.endpoint.logout"
varTokenPublicKey = "token.publickey"
varTokenPrivateKey = "token.privatekey"
varAuthNotApprovedRedirect = "auth.notapproved.redirect"
varNotApprovedRedirect = "notapproved.redirect"
varHeaderMaxLength = "header.maxlength"
varCacheControlUsers = "cachecontrol.users"
varCacheControlCollaborators = "cachecontrol.collaborators"
Expand Down Expand Up @@ -109,7 +109,7 @@ func NewConfigurationData(configFilePath string) (*ConfigurationData, error) {

func getConfigFilePath() string {
// This was either passed as a env var Or, set inside main.go from --config
envConfigPath, ok := os.LookupEnv("F8_AUTH_CONFIG_FILE_PATH")
envConfigPath, ok := os.LookupEnv("AUTH_CONFIG_FILE_PATH")
if !ok {
return ""
}
Expand Down Expand Up @@ -304,10 +304,10 @@ func (c *ConfigurationData) GetTokenPublicKey() []byte {
return []byte(c.v.GetString(varTokenPublicKey))
}

// GetAuthNotApprovedRedirect returns the URL to redirect to if the user is not approved
// GetNotApprovedRedirect returns the URL to redirect to if the user is not approved
// May return empty string which means an unauthorized error should be returned instead of redirecting the user
func (c *ConfigurationData) GetAuthNotApprovedRedirect() string {
return c.v.GetString(varAuthNotApprovedRedirect)
func (c *ConfigurationData) GetNotApprovedRedirect() string {
return c.v.GetString(varNotApprovedRedirect)
}

// GetKeycloakSecret returns the keycloak client secret (as set via config file or environment variable)
Expand Down Expand Up @@ -530,7 +530,7 @@ func (c *ConfigurationData) IsLogJSON() bool {
}

// GetValidRedirectURLs returns the RegEx of valid redirect URLs for auth requests
// If the F8_REDIRECT_VALID env var is not set then in Dev Mode all redirects allowed - *
// If the AUTH_REDIRECT_VALID env var is not set then in Dev Mode all redirects allowed - *
// In prod mode the default regex will be returned
func (c *ConfigurationData) GetValidRedirectURLs(req *goa.RequestData) (string, error) {
if c.v.IsSet(varValidRedirectURLs) {
Expand Down Expand Up @@ -632,7 +632,7 @@ vwIDAQAB
defaultCheStarterURL = "che-server"

// DefaultValidRedirectURLs is a regex to be used to whitelist redirect URL for auth
// If the F8_REDIRECT_VALID env var is not set then in Dev Mode all redirects allowed - *
// If the AUTH_REDIRECT_VALID env var is not set then in Dev Mode all redirects allowed - *
// In prod mode the following regex will be used by default:
DefaultValidRedirectURLs = "^(https|http)://([^/]+[.])?(?i:openshift[.]io)(/.*)?$" // *.openshift.io/*
devModeValidRedirectURLs = ".*"
Expand Down
30 changes: 15 additions & 15 deletions configuration/configuration_blackbox_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ func resetConfiguration(configPath string) {

func TestGetKeycloakEndpointSetByUrlEnvVaribaleOK(t *testing.T) {
resource.Require(t, resource.UnitTest)
env := os.Getenv("F8_KEYCLOAK_URL")
env := os.Getenv("AUTH_KEYCLOAK_URL")
defer func() {
os.Setenv("F8_KEYCLOAK_URL", env)
os.Setenv("AUTH_KEYCLOAK_URL", env)
resetConfiguration(defaultValuesConfigFilePath)
}()

os.Setenv("F8_KEYCLOAK_URL", "http://xyz.io")
os.Setenv("AUTH_KEYCLOAK_URL", "http://xyz.io")
resetConfiguration(defaultValuesConfigFilePath)

url, err := config.GetKeycloakEndpointAuth(reqLong)
Expand Down Expand Up @@ -101,7 +101,7 @@ func TestGetKeycloakEndpointAdminDevModeOK(t *testing.T) {

func TestGetKeycloakEndpointAdminSetByEnvVaribaleOK(t *testing.T) {
resource.Require(t, resource.UnitTest)
checkGetKeycloakEndpointSetByEnvVaribaleOK(t, "F8_KEYCLOAK_ENDPOINT_ADMIN", config.GetKeycloakEndpointAdmin)
checkGetKeycloakEndpointSetByEnvVaribaleOK(t, "AUTH_KEYCLOAK_ENDPOINT_ADMIN", config.GetKeycloakEndpointAdmin)
}

func TestGetKeycloakEndpointAuthzResourcesetDevModeOK(t *testing.T) {
Expand All @@ -112,7 +112,7 @@ func TestGetKeycloakEndpointAuthzResourcesetDevModeOK(t *testing.T) {

func TestGetKeycloakEndpointAuthzResourcesetSetByEnvVaribaleOK(t *testing.T) {
resource.Require(t, resource.UnitTest)
checkGetKeycloakEndpointSetByEnvVaribaleOK(t, "F8_KEYCLOAK_ENDPOINT_AUTHZ_RESOURCESET", config.GetKeycloakEndpointAuthzResourceset)
checkGetKeycloakEndpointSetByEnvVaribaleOK(t, "AUTH_KEYCLOAK_ENDPOINT_AUTHZ_RESOURCESET", config.GetKeycloakEndpointAuthzResourceset)
}

func TestGetKeycloakEndpointClientsDevModeOK(t *testing.T) {
Expand All @@ -123,7 +123,7 @@ func TestGetKeycloakEndpointClientsDevModeOK(t *testing.T) {

func TestGetKeycloakEndpoinClientsSetByEnvVaribaleOK(t *testing.T) {
resource.Require(t, resource.UnitTest)
checkGetKeycloakEndpointSetByEnvVaribaleOK(t, "F8_KEYCLOAK_ENDPOINT_CLIENTS", config.GetKeycloakEndpointClients)
checkGetKeycloakEndpointSetByEnvVaribaleOK(t, "AUTH_KEYCLOAK_ENDPOINT_CLIENTS", config.GetKeycloakEndpointClients)
}

func TestGetKeycloakEndpointAuthDevModeOK(t *testing.T) {
Expand All @@ -134,7 +134,7 @@ func TestGetKeycloakEndpointAuthDevModeOK(t *testing.T) {

func TestGetKeycloakEndpointAuthSetByEnvVaribaleOK(t *testing.T) {
resource.Require(t, resource.UnitTest)
checkGetKeycloakEndpointSetByEnvVaribaleOK(t, "F8_KEYCLOAK_ENDPOINT_AUTH", config.GetKeycloakEndpointAuth)
checkGetKeycloakEndpointSetByEnvVaribaleOK(t, "AUTH_KEYCLOAK_ENDPOINT_AUTH", config.GetKeycloakEndpointAuth)
}

func TestGetKeycloakEndpointLogoutDevModeOK(t *testing.T) {
Expand All @@ -145,7 +145,7 @@ func TestGetKeycloakEndpointLogoutDevModeOK(t *testing.T) {

func TestGetKeycloakEndpointLogoutSetByEnvVaribaleOK(t *testing.T) {
resource.Require(t, resource.UnitTest)
checkGetKeycloakEndpointSetByEnvVaribaleOK(t, "F8_KEYCLOAK_ENDPOINT_LOGOUT", config.GetKeycloakEndpointLogout)
checkGetKeycloakEndpointSetByEnvVaribaleOK(t, "AUTH_KEYCLOAK_ENDPOINT_LOGOUT", config.GetKeycloakEndpointLogout)
}

func TestGetKeycloakEndpointTokenOK(t *testing.T) {
Expand All @@ -156,7 +156,7 @@ func TestGetKeycloakEndpointTokenOK(t *testing.T) {

func TestGetKeycloakEndpointTokenSetByEnvVaribaleOK(t *testing.T) {
resource.Require(t, resource.UnitTest)
checkGetKeycloakEndpointSetByEnvVaribaleOK(t, "F8_KEYCLOAK_ENDPOINT_TOKEN", config.GetKeycloakEndpointToken)
checkGetKeycloakEndpointSetByEnvVaribaleOK(t, "AUTH_KEYCLOAK_ENDPOINT_TOKEN", config.GetKeycloakEndpointToken)
}

func TestGetKeycloakEndpointUserInfoOK(t *testing.T) {
Expand All @@ -167,7 +167,7 @@ func TestGetKeycloakEndpointUserInfoOK(t *testing.T) {

func TestGetKeycloakEndpointUserInfoSetByEnvVaribaleOK(t *testing.T) {
resource.Require(t, resource.UnitTest)
checkGetKeycloakEndpointSetByEnvVaribaleOK(t, "F8_KEYCLOAK_ENDPOINT_USERINFO", config.GetKeycloakEndpointUserInfo)
checkGetKeycloakEndpointSetByEnvVaribaleOK(t, "AUTH_KEYCLOAK_ENDPOINT_USERINFO", config.GetKeycloakEndpointUserInfo)
}

func TestGetKeycloakEndpointEntitlementOK(t *testing.T) {
Expand All @@ -178,7 +178,7 @@ func TestGetKeycloakEndpointEntitlementOK(t *testing.T) {

func TestGetKeycloakEndpointEntitlementSetByEnvVaribaleOK(t *testing.T) {
resource.Require(t, resource.UnitTest)
checkGetKeycloakEndpointSetByEnvVaribaleOK(t, "F8_KEYCLOAK_ENDPOINT_ENTITLEMENT", config.GetKeycloakEndpointEntitlement)
checkGetKeycloakEndpointSetByEnvVaribaleOK(t, "AUTH_KEYCLOAK_ENDPOINT_ENTITLEMENT", config.GetKeycloakEndpointEntitlement)
}

func TestGetKeycloakEndpointBrokerOK(t *testing.T) {
Expand All @@ -189,7 +189,7 @@ func TestGetKeycloakEndpointBrokerOK(t *testing.T) {

func TestGetKeycloakEndpointBrokerSetByEnvVaribaleOK(t *testing.T) {
resource.Require(t, resource.UnitTest)
checkGetKeycloakEndpointSetByEnvVaribaleOK(t, "F8_KEYCLOAK_ENDPOINT_BROKER", config.GetKeycloakEndpointBroker)
checkGetKeycloakEndpointSetByEnvVaribaleOK(t, "AUTH_KEYCLOAK_ENDPOINT_BROKER", config.GetKeycloakEndpointBroker)
}

func TestGetKeycloakUserInfoEndpointOK(t *testing.T) {
Expand All @@ -200,7 +200,7 @@ func TestGetKeycloakUserInfoEndpointOK(t *testing.T) {

func TestGetKeycloakUserInfoEndpointOKrSetByEnvVaribaleOK(t *testing.T) {
resource.Require(t, resource.UnitTest)
checkGetKeycloakEndpointSetByEnvVaribaleOK(t, "F8_KEYCLOAK_ENDPOINT_ACCOUNT", config.GetKeycloakAccountEndpoint)
checkGetKeycloakEndpointSetByEnvVaribaleOK(t, "AUTH_KEYCLOAK_ENDPOINT_ACCOUNT", config.GetKeycloakAccountEndpoint)
}

func checkGetKeycloakEndpointOK(t *testing.T, expectedEndpoint string, getEndpoint func(req *goa.RequestData) (string, error)) {
Expand Down Expand Up @@ -269,7 +269,7 @@ func TestGetMaxHeaderSizeUsingDefaults(t *testing.T) {

func TestGetMaxHeaderSizeSetByEnvVaribaleOK(t *testing.T) {
resource.Require(t, resource.UnitTest)
envName := "F8_HEADER_MAXLENGTH"
envName := "AUTH_HEADER_MAXLENGTH"
envValue := time.Now().Unix()
env := os.Getenv(envName)
defer func() {
Expand All @@ -286,7 +286,7 @@ func TestGetMaxHeaderSizeSetByEnvVaribaleOK(t *testing.T) {
}

func generateEnvKey(yamlKey string) string {
return "F8_" + strings.ToUpper(strings.Replace(yamlKey, ".", "_", -1))
return "AUTH_" + strings.ToUpper(strings.Replace(yamlKey, ".", "_", -1))
}

func checkGetKeycloakEndpointSetByEnvVaribaleOK(t *testing.T, envName string, getEndpoint func(req *goa.RequestData) (string, error)) {
Expand Down
8 changes: 4 additions & 4 deletions configuration/configuration_whitebox_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func TestGetKeycloakURLForTooShortHostFails(t *testing.T) {
func TestKeycloakRealmInDevModeCanBeOverridden(t *testing.T) {
resource.Require(t, resource.UnitTest)

key := "F8_KEYCLOAK_REALM"
key := "AUTH_KEYCLOAK_REALM"
realEnvValue := os.Getenv(key)

os.Unsetenv(key)
Expand All @@ -108,7 +108,7 @@ func TestKeycloakRealmInDevModeCanBeOverridden(t *testing.T) {
func TestGetLogLevelOK(t *testing.T) {
resource.Require(t, resource.UnitTest)

key := "F8_LOG_LEVEL"
key := "AUTH_LOG_LEVEL"
realEnvValue := os.Getenv(key)

os.Unsetenv(key)
Expand All @@ -128,7 +128,7 @@ func TestGetLogLevelOK(t *testing.T) {
func TestGetTransactionTimeoutOK(t *testing.T) {
resource.Require(t, resource.UnitTest)

key := "F8_POSTGRES_TRANSACTION_TIMEOUT"
key := "AUTH_POSTGRES_TRANSACTION_TIMEOUT"
realEnvValue := os.Getenv(key)

os.Unsetenv(key)
Expand All @@ -148,7 +148,7 @@ func TestGetTransactionTimeoutOK(t *testing.T) {
func TestValidRedirectURLsInDevModeCanBeOverridden(t *testing.T) {
resource.Require(t, resource.UnitTest)

key := "F8_REDIRECT_VALID"
key := "AUTH_REDIRECT_VALID"
realEnvValue := os.Getenv(key)

os.Unsetenv(key)
Expand Down
4 changes: 2 additions & 2 deletions controller/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type loginConfiguration interface {
GetKeycloakTestUser2Secret() string
GetValidRedirectURLs(*goa.RequestData) (string, error)
GetHeaderMaxLength() int64
GetAuthNotApprovedRedirect() string
GetNotApprovedRedirect() string
}

// LoginController implements the login resource.
Expand Down Expand Up @@ -109,7 +109,7 @@ func (c *LoginController) Authorize(ctx *app.AuthorizeLoginContext) error {
}

ctx.ResponseData.Header().Set("Cache-Control", "no-cache")
return c.auth.Perform(ctx, oauth, brokerEndpoint, entitlementEndpoint, profileEndpoint, whitelist, c.configuration.GetAuthNotApprovedRedirect())
return c.auth.Perform(ctx, oauth, brokerEndpoint, entitlementEndpoint, profileEndpoint, whitelist, c.configuration.GetNotApprovedRedirect())
}

// Refresh obtain a new access token using the refresh token.
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ services:
image: fabric8-services/fabric8-auth:latest
command: -config /usr/local/alm/etc/config.yaml
environment:
F8_POSTGRES_HOST: db
AUTH_POSTGRES_HOST: db
ports:
- "8089:8089"
networks:
Expand Down
4 changes: 2 additions & 2 deletions jenkins/windows/make.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
:: Run "set F8_DEBUG=1" before calling this script to enable debug output.
:: Run "set AUTH_DEBUG=1" before calling this script to enable debug output.
:: This basically just outputs every command before executing it.
@if not defined F8_DEBUG echo off
@if not defined AUTH_DEBUG echo off

:: This is a script to help have a CI system on a Windows host with no
:: other requirement other than to have a CMD.
Expand Down
Loading

0 comments on commit 7833ae6

Please sign in to comment.