Skip to content
This repository has been archived by the owner on Aug 29, 2018. It is now read-only.

Commit

Permalink
Merge pull request #6409 from abhgupta/abhgupta-dev
Browse files Browse the repository at this point in the history
Merged by openshift-bot
  • Loading branch information
OpenShift Bot authored Jul 28, 2016
2 parents aeb7a2b + a7feb39 commit e501551
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
7 changes: 6 additions & 1 deletion broker/conf/broker.conf
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,14 @@ APP_ADVERTISE_HTTPS="false"
# Set to true to block new user creation within OpenShift broker
# If set to true, only allows existing users to access OpenShift
# New users, even if authenticated, will not be provisioned in OpenShift broker
# and will get an AccessDeniedException
# and will get an error message
AUTH_USER_LOOKUP_ONLY="false"

# The error message that is displayed to users logging in with valid credentials
# but who do not have an account provisioned in the cluster already
AUTH_USER_LOOKUP_FAIL_MESSAGE="This cluster is configured for user lookup only. Please contact your system administrator for provisioning your user account."


# Team collaboration settings
MAX_MEMBERS_PER_RESOURCE="100"
MAX_TEAMS_PER_RESOURCE="5"
Expand Down
1 change: 1 addition & 0 deletions broker/config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
:limit_app_name_chars => conf.get("LIMIT_APP_NAME_CHARS", -1).to_i,
:app_advertise_https => conf.get_bool("APP_ADVERTISE_HTTPS", false),
:auth_user_lookup_only => conf.get_bool("AUTH_USER_LOOKUP_ONLY", false),
:auth_user_lookup_fail_msg => conf.get("AUTH_USER_LOOKUP_FAIL_MESSAGE", "This cluster is configured for user lookup only. Please contact your system administrator for provisioning your user account."),
}

config.auth = {
Expand Down
1 change: 1 addition & 0 deletions broker/config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
:limit_app_name_chars => conf.get("LIMIT_APP_NAME_CHARS", -1).to_i,
:app_advertise_https => conf.get_bool("APP_ADVERTISE_HTTPS", false),
:auth_user_lookup_only => conf.get_bool("AUTH_USER_LOOKUP_ONLY", false),
:auth_user_lookup_fail_msg => conf.get("AUTH_USER_LOOKUP_FAIL_MESSAGE", "This cluster is configured for user lookup only. Please contact your system administrator for provisioning your user account."),
}

config.auth = {
Expand Down
1 change: 1 addition & 0 deletions broker/config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
:limit_app_name_chars => conf.get("LIMIT_APP_NAME_CHARS", -1).to_i,
:app_advertise_https => conf.get_bool("APP_ADVERTISE_HTTPS", false),
:auth_user_lookup_only => conf.get_bool("AUTH_USER_LOOKUP_ONLY", false),
:auth_user_lookup_fail_msg => conf.get("AUTH_USER_LOOKUP_FAIL_MESSAGE", "This cluster is configured for user lookup only. Please contact your system administrator for provisioning your user account."),
}

config.auth = {
Expand Down
4 changes: 2 additions & 2 deletions controller/app/models/cloud_user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,9 @@ def self.find_or_create_by_identity(provider, login, create_attributes={}, &bloc
yield user, login if block_given?
[user, false]
rescue Mongoid::Errors::DocumentNotFound
# if new user creation is blocked, then return an exception
# if authentication is configured for lookup only, then return an exception
if Rails.application.config.openshift[:auth_user_lookup_only]
raise OpenShift::UserException.new("New user signups are not allowed on this cluster")
raise OpenShift::UserException.new(Rails.application.config.openshift[:auth_user_lookup_fail_msg])
end
user = new(create_attributes)
#user.current_identity = user.identities.build(provider: provider, uid: login)
Expand Down

0 comments on commit e501551

Please sign in to comment.