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 #6402 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 22, 2016
2 parents 9960c8c + 07007e3 commit a4adf17
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions broker/conf/broker.conf
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,12 @@ CART_DOWNLOAD_CONN_TIMEOUT="2"
# Set to "true" to make application default to use https in advertised URL
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
AUTH_USER_LOOKUP_ONLY="false"

# 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 @@ -121,6 +121,7 @@
:use_predictable_gear_uuids => conf.get_bool("USE_PREDICTABLE_GEAR_UUIDS", false),
: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),
}

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 @@ -110,6 +110,7 @@
:use_predictable_gear_uuids => conf.get_bool("USE_PREDICTABLE_GEAR_UUIDS", false),
: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),
}

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 @@ -119,6 +119,7 @@
:use_predictable_gear_uuids => conf.get_bool("USE_PREDICTABLE_GEAR_UUIDS", false),
: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),
}

config.auth = {
Expand Down
4 changes: 4 additions & 0 deletions controller/app/models/cloud_user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ 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 Rails.application.config.openshift[:auth_user_lookup_only]
raise OpenShift::UserException.new("New user signups are not allowed on this cluster")
end
user = new(create_attributes)
#user.current_identity = user.identities.build(provider: provider, uid: login)
#user.login = user.current_identity.id
Expand Down

0 comments on commit a4adf17

Please sign in to comment.