openshift-origin-auth-mongo 0.8.9 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/{lib/openshift-origin-auth-mongo/app → app}/controllers/account_controller.rb +2 -2
- data/{lib/openshift-origin-auth-mongo/app → app}/models/rest_account.rb +0 -0
- data/bin/oo-register-user +1 -1
- data/{lib/openshift-origin-auth-mongo/config/initializers/openshift-origin-auth-mongo-defaults.conf → conf/openshift-origin-auth-mongo.conf.example} +0 -5
- data/config/initializers/openshift-origin-auth-mongo.rb +61 -0
- data/{lib/openshift-origin-auth-mongo/config → config}/routes.rb +0 -0
- data/lib/mongo_auth_engine.rb +7 -0
- data/lib/{openshift-origin-auth-mongo/lib/openshift → openshift}/mongo_auth_service.rb +3 -3
- data/lib/openshift-origin-auth-mongo.rb +2 -2
- data/openshift-origin-auth-mongo.gemspec +10 -7
- data/rubygem-openshift-origin-auth-mongo.spec +102 -110
- data/test/dummy/Gemfile +1 -1
- data/test/dummy/script/rails +1 -1
- metadata +26 -15
- data/lib/openshift-origin-auth-mongo/config/initializers/openshift-origin-auth-mongo.rb +0 -62
- data/lib/openshift-origin-auth-mongo/engine/engine.rb +0 -12
@@ -12,7 +12,7 @@ class AccountController < BaseController
|
|
12
12
|
Rails.logger.debug "username = #{username}, password = #{password}"
|
13
13
|
|
14
14
|
if(username.nil? || password.nil? || username.strip.empty? || password.strip.empty?)
|
15
|
-
log_action('nil', 'nil', username, "ADD_USER",
|
15
|
+
log_action('nil', 'nil', username, "ADD_USER", true, "Username or password not specified or empty")
|
16
16
|
@reply = RestReply.new(:unprocessable_entity)
|
17
17
|
@reply.messages.push(Message.new(:error, "Invalid username or password", 1001, "username"))
|
18
18
|
respond_with @reply, :status => @reply.status
|
@@ -20,7 +20,7 @@ class AccountController < BaseController
|
|
20
20
|
end
|
21
21
|
|
22
22
|
if auth_service.user_exists?(username)
|
23
|
-
log_action('nil', 'nil', username, "ADD_USER",
|
23
|
+
log_action('nil', 'nil', username, "ADD_USER", true, "User '#{username}' already registered")
|
24
24
|
@reply = RestReply.new(:unprocessable_entity)
|
25
25
|
@reply.messages.push(Message.new(:error, "Error: User '#{username}' already registered.", 1002, "id"))
|
26
26
|
respond_with @reply, :status => @reply.status
|
File without changes
|
data/bin/oo-register-user
CHANGED
@@ -1,8 +1,3 @@
|
|
1
|
-
AUTH_SALT="ClWqe5zKtEW4CJEMyjzQ"
|
2
|
-
AUTH_PRIVKEYFILE="/var/www/openshift/broker/config/server_priv.pem"
|
3
|
-
AUTH_PRIVKEYPASS=""
|
4
|
-
AUTH_PUBKEYFILE="/var/www/openshift/broker/config/server_pub.pem"
|
5
|
-
|
6
1
|
MONGO_REPLICA_SETS=false
|
7
2
|
# Replica set example: "<host-1>:<port-1> <host-2>:<port-2> ..."
|
8
3
|
MONGO_HOST_PORT="localhost:27017"
|
@@ -0,0 +1,61 @@
|
|
1
|
+
require 'openshift-origin-common'
|
2
|
+
|
3
|
+
Broker::Application.configure do
|
4
|
+
conf_file = File.join(OpenShift::Config::PLUGINS_DIR, File.basename(__FILE__, '.rb') + '.conf')
|
5
|
+
if Rails.env.development?
|
6
|
+
dev_conf_file = File.join(OpenShift::Config::PLUGINS_DIR, File.basename(__FILE__, '.rb') + '-dev.conf')
|
7
|
+
if File.exist? dev_conf_file
|
8
|
+
conf_file = dev_conf_file
|
9
|
+
else
|
10
|
+
Rails.logger.info "Development configuration for #{File.basename(__FILE__, '.rb')} not found. Using production configuration."
|
11
|
+
end
|
12
|
+
end
|
13
|
+
conf = OpenShift::Config.new(conf_file)
|
14
|
+
|
15
|
+
# Grab this now because we need it for the MONGO_HOST_PORT parsing.
|
16
|
+
replica_sets = conf.get_bool("MONGO_REPLICA_SETS", "true")
|
17
|
+
hp = conf.get("MONGO_HOST_PORT", "localhost:27017")
|
18
|
+
|
19
|
+
# Depending on the value of the MONGO_REPLICA_SETS setting, MONGO_HOST_PORT
|
20
|
+
# must follow one of two formats, as described below.
|
21
|
+
|
22
|
+
if !hp
|
23
|
+
raise "Broker is missing Mongo configuration."
|
24
|
+
elsif replica_sets
|
25
|
+
# The string should be of the following form:
|
26
|
+
#
|
27
|
+
# host-1:port-1 host-2:port-2 ...
|
28
|
+
#
|
29
|
+
# We need to parse into an array of arrays:
|
30
|
+
#
|
31
|
+
# [[<host-1>, <port-1>], [<host-2>, <port-2>], ...]
|
32
|
+
#
|
33
|
+
# where each host is a string and each port is an integer.
|
34
|
+
|
35
|
+
host_port = hp.split.map do |x|
|
36
|
+
(h,p) = x.split(":")
|
37
|
+
[h, p.to_i]
|
38
|
+
end
|
39
|
+
else
|
40
|
+
|
41
|
+
# The string should be of the following form:
|
42
|
+
#
|
43
|
+
# host:port
|
44
|
+
#
|
45
|
+
# We need to parse into an array:
|
46
|
+
#
|
47
|
+
# [host,port]
|
48
|
+
#
|
49
|
+
# where host is a string and port is an integer.
|
50
|
+
|
51
|
+
(h,p) = hp.split(":")
|
52
|
+
host_port = [h, p.to_i]
|
53
|
+
end
|
54
|
+
|
55
|
+
config.auth[:mongo_replica_sets] = replica_sets
|
56
|
+
config.auth[:mongo_host_port] = host_port
|
57
|
+
config.auth[:mongo_user] = conf.get("MONGO_USER", "openshift")
|
58
|
+
config.auth[:mongo_password] = conf.get("MONGO_PASSWORD", "mooo")
|
59
|
+
config.auth[:mongo_db] = conf.get("MONGO_DB", "openshift_broker_dev")
|
60
|
+
config.auth[:mongo_collection] = conf.get("MONGO_COLLECTION", "auth_user")
|
61
|
+
end
|
File without changes
|
@@ -46,9 +46,9 @@ module OpenShift
|
|
46
46
|
end
|
47
47
|
|
48
48
|
def authenticate(request, login, password)
|
49
|
-
|
50
|
-
|
51
|
-
validate_broker_key(
|
49
|
+
if request.headers['User-Agent'] == "OpenShift"
|
50
|
+
# password == iv, login == key
|
51
|
+
return validate_broker_key(password, login)
|
52
52
|
else
|
53
53
|
raise OpenShift::AccessDeniedException if login.nil? || login.empty? || password.nil? || password.empty?
|
54
54
|
encoded_password = Digest::MD5.hexdigest(Digest::MD5.hexdigest(password) + @salt)
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module OpenShift
|
2
2
|
module MongoAuthServiceModule
|
3
|
-
require '
|
3
|
+
require 'mongo_auth_engine' if defined?(Rails) && Rails::VERSION::MAJOR == 3
|
4
4
|
end
|
5
5
|
end
|
6
6
|
|
7
|
-
require "openshift
|
7
|
+
require "openshift/mongo_auth_service.rb"
|
8
8
|
OpenShift::AuthService.provider=OpenShift::MongoAuthService
|
@@ -1,23 +1,26 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
+
config_dir = File.join(File.join("config", "**"), "*")
|
3
|
+
app_dir = File.join(File.join("app", "**"), "*")
|
2
4
|
$:.push File.expand_path("../lib", __FILE__)
|
3
5
|
lib_dir = File.join(File.join("lib", "**"), "*")
|
4
6
|
test_dir = File.join(File.join("test", "**"), "*")
|
5
7
|
bin_dir = File.join("bin","*")
|
8
|
+
conf_dir = File.join(File.join("conf", "**"), "*")
|
6
9
|
spec_file = "rubygem-openshift-origin-auth-mongo.spec"
|
7
10
|
|
8
11
|
Gem::Specification.new do |s|
|
9
12
|
s.name = "openshift-origin-auth-mongo"
|
10
|
-
s.version = `rpm -q --qf "%{version}\n" --specfile #{spec_file}`.split[0]
|
11
|
-
s.license = `rpm -q --qf "%{license}\n" --specfile #{spec_file}`.split[0]
|
13
|
+
s.version = `rpm -q --define 'rhel 7' --qf "%{version}\n" --specfile #{spec_file}`.split[0]
|
14
|
+
s.license = `rpm -q --define 'rhel 7' --qf "%{license}\n" --specfile #{spec_file}`.split[0]
|
12
15
|
s.authors = ["Krishna Raman"]
|
13
16
|
s.email = ["kraman@gmail.com"]
|
14
|
-
s.homepage = `rpm -q --qf "%{url}\n" --specfile #{spec_file}`.split[0]
|
15
|
-
s.summary = `rpm -q --qf "%{description}\n" --specfile #{spec_file}`.split[0]
|
16
|
-
s.description = `rpm -q --qf "%{description}\n" --specfile #{spec_file}`.split[0]
|
17
|
+
s.homepage = `rpm -q --define 'rhel 7' --qf "%{url}\n" --specfile #{spec_file}`.split[0]
|
18
|
+
s.summary = `rpm -q --define 'rhel 7' --qf "%{description}\n" --specfile #{spec_file}`.split[0]
|
19
|
+
s.description = `rpm -q --define 'rhel 7' --qf "%{description}\n" --specfile #{spec_file}`.split[0]
|
17
20
|
|
18
21
|
s.rubyforge_project = "openshift-origin-auth-mongo"
|
19
22
|
|
20
|
-
s.files = Dir[lib_dir] + Dir[bin_dir]
|
23
|
+
s.files = Dir[lib_dir] + Dir[bin_dir] + Dir[conf_dir] + Dir[config_dir] + Dir[app_dir]
|
21
24
|
s.test_files = Dir[test_dir]
|
22
25
|
s.executables = Dir[bin_dir].map {|binary| File.basename(binary)}
|
23
26
|
s.files += %w(README.md Rakefile Gemfile rubygem-openshift-origin-auth-mongo.spec openshift-origin-auth-mongo.gemspec LICENSE COPYRIGHT)
|
@@ -25,7 +28,7 @@ Gem::Specification.new do |s|
|
|
25
28
|
|
26
29
|
s.add_dependency('openshift-origin-controller')
|
27
30
|
s.add_dependency('json')
|
28
|
-
s.add_development_dependency('rake')
|
31
|
+
s.add_development_dependency('rake', '>= 0.8.7', '<= 0.9.2.2')
|
29
32
|
s.add_development_dependency('bundler')
|
30
33
|
s.add_development_dependency('mocha')
|
31
34
|
end
|
@@ -1,146 +1,138 @@
|
|
1
|
-
%
|
2
|
-
%global
|
3
|
-
%global
|
4
|
-
%
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
1
|
+
%if 0%{?fedora}%{?rhel} <= 6
|
2
|
+
%global scl ruby193
|
3
|
+
%global scl_prefix ruby193-
|
4
|
+
%endif
|
5
|
+
%{!?scl:%global pkg_name %{name}}
|
6
|
+
%{?scl:%scl_package rubygem-%{gem_name}}
|
7
|
+
%global gem_name openshift-origin-auth-mongo
|
8
|
+
%global rubyabi 1.9.1
|
9
|
+
|
10
|
+
Summary: OpenShift plugin for mongo auth service
|
11
|
+
Name: rubygem-%{gem_name}
|
12
|
+
Version: 1.1.1
|
9
13
|
Release: 1%{?dist}
|
10
14
|
Group: Development/Languages
|
11
15
|
License: ASL 2.0
|
12
16
|
URL: http://openshift.redhat.com
|
13
|
-
Source0: rubygem-%{
|
17
|
+
Source0: rubygem-%{gem_name}-%{version}.tar.gz
|
14
18
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
15
|
-
Requires: ruby(abi) =
|
16
|
-
Requires:
|
19
|
+
Requires: %{?scl:%scl_prefix}ruby(abi) = %{rubyabi}
|
20
|
+
Requires: %{?scl:%scl_prefix}ruby
|
21
|
+
Requires: %{?scl:%scl_prefix}rubygems
|
22
|
+
Requires: %{?scl:%scl_prefix}rubygem(activeresource)
|
23
|
+
Requires: %{?scl:%scl_prefix}rubygem(json)
|
24
|
+
Requires: %{?scl:%scl_prefix}rubygem(mocha)
|
17
25
|
Requires: rubygem(openshift-origin-common)
|
18
|
-
Requires: rubygem(json)
|
19
|
-
Requires: rubygem(mocha)
|
20
26
|
Requires: openshift-origin-broker
|
21
|
-
Requires:
|
22
|
-
Requires:
|
23
|
-
|
24
|
-
|
25
|
-
BuildRequires:
|
26
|
-
BuildRequires:
|
27
|
+
Requires: selinux-policy-targeted
|
28
|
+
Requires: policycoreutils-python
|
29
|
+
Requires: openssl
|
30
|
+
%if 0%{?fedora}%{?rhel} <= 6
|
31
|
+
BuildRequires: ruby193-build
|
32
|
+
BuildRequires: scl-utils-build
|
33
|
+
%endif
|
34
|
+
BuildRequires: %{?scl:%scl_prefix}ruby(abi) = %{rubyabi}
|
35
|
+
BuildRequires: %{?scl:%scl_prefix}ruby
|
36
|
+
BuildRequires: %{?scl:%scl_prefix}rubygems
|
37
|
+
BuildRequires: %{?scl:%scl_prefix}rubygems-devel
|
27
38
|
BuildArch: noarch
|
28
|
-
Provides: rubygem(%{
|
29
|
-
|
30
|
-
%package -n ruby-%{gemname}
|
31
|
-
Summary: OpenShift Origin plugin for mongo auth service
|
32
|
-
Requires: rubygem(%{gemname}) = %version
|
33
|
-
Provides: ruby(%{gemname}) = %version
|
39
|
+
Provides: rubygem(%{gem_name}) = %version
|
40
|
+
Obsoletes: rubygem-swingshift-mongo-plugin
|
34
41
|
|
35
42
|
%description
|
36
43
|
Provides a mongo auth service based plugin
|
37
44
|
|
38
|
-
%
|
39
|
-
|
45
|
+
%package doc
|
46
|
+
Summary: OpenShift plugin for mongo auth service ri documentation
|
47
|
+
|
48
|
+
%description doc
|
49
|
+
OpenShift plugin for mongo auth service ri documentation
|
40
50
|
|
41
51
|
%prep
|
42
52
|
%setup -q
|
43
53
|
|
44
54
|
%build
|
55
|
+
%{?scl:scl enable %scl - << \EOF}
|
56
|
+
mkdir -p .%{gem_dir}
|
57
|
+
# Create the gem as gem install only works on a gem file
|
58
|
+
gem build %{gem_name}.gemspec
|
59
|
+
|
60
|
+
export CONFIGURE_ARGS="--with-cflags='%{optflags}'"
|
61
|
+
# gem install compiles any C extensions and installs into a directory
|
62
|
+
# We set that to be a local directory so that we can move it into the
|
63
|
+
# buildroot in %%install
|
64
|
+
gem install -V \
|
65
|
+
--local \
|
66
|
+
--install-dir .%{gem_dir} \
|
67
|
+
--bindir ./%{_bindir} \
|
68
|
+
--force \
|
69
|
+
--rdoc \
|
70
|
+
%{gem_name}-%{version}.gem
|
71
|
+
%{?scl:EOF}
|
45
72
|
|
46
73
|
%install
|
47
|
-
|
48
|
-
|
49
|
-
mkdir -p %{buildroot}%{ruby_sitelib}
|
50
|
-
mkdir -p %{buildroot}%{_bindir}
|
74
|
+
mkdir -p %{buildroot}%{gem_dir}
|
75
|
+
cp -a .%{gem_dir}/* %{buildroot}%{gem_dir}/
|
51
76
|
|
52
|
-
#
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
# Move the gem binaries to the standard filesystem location
|
57
|
-
mv %{buildroot}%{gemdir}/bin/* %{buildroot}%{_bindir}
|
58
|
-
rm -rf %{buildroot}%{gemdir}/bin
|
59
|
-
|
60
|
-
# Symlink into the ruby site library directories
|
61
|
-
ln -s %{geminstdir}/lib/%{gemname} %{buildroot}%{ruby_sitelib}
|
62
|
-
ln -s %{geminstdir}/lib/%{gemname}.rb %{buildroot}%{ruby_sitelib}
|
77
|
+
# If there were programs installed:
|
78
|
+
mkdir -p %{buildroot}/usr/bin
|
79
|
+
cp -a ./%{_bindir}/* %{buildroot}/usr/bin
|
63
80
|
|
64
81
|
mkdir -p %{buildroot}/etc/openshift/plugins.d
|
65
|
-
cp
|
82
|
+
cp %{buildroot}/%{gem_instdir}/conf/openshift-origin-auth-mongo.conf.example %{buildroot}/etc/openshift/plugins.d/
|
83
|
+
|
66
84
|
|
67
85
|
%clean
|
68
86
|
rm -rf %{buildroot}
|
69
87
|
|
70
|
-
%post
|
71
|
-
/usr/bin/openssl genrsa -out /var/www/openshift/broker/config/server_priv.pem 2048
|
72
|
-
/usr/bin/openssl rsa -in /var/www/openshift/broker/config/server_priv.pem -pubout > /var/www/openshift/broker/config/server_pub.pem
|
73
|
-
|
74
88
|
%files
|
75
89
|
%defattr(-,root,root,-)
|
76
|
-
%
|
77
|
-
%
|
78
|
-
%{
|
79
|
-
%{
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
%
|
84
|
-
|
85
|
-
%files -n ruby-%{gemname}
|
86
|
-
%{ruby_sitelib}/%{gemname}
|
87
|
-
%{ruby_sitelib}/%{gemname}.rb
|
90
|
+
%doc LICENSE COPYRIGHT Gemfile
|
91
|
+
%exclude %{gem_cache}
|
92
|
+
%{gem_instdir}
|
93
|
+
%{gem_spec}
|
94
|
+
/usr/bin/*
|
95
|
+
/etc/openshift/plugins.d/openshift-origin-auth-mongo.conf.example
|
96
|
+
|
97
|
+
%files doc
|
98
|
+
%doc %{gem_docdir}
|
88
99
|
|
89
100
|
%changelog
|
101
|
+
* Fri Jan 11 2013 Troy Dawson <tdawson@redhat.com> 1.1.1-1
|
102
|
+
- updated gemspecs so they work with scl rpm spec files. (tdawson@redhat.com)
|
103
|
+
- more changes for US3078 (abhgupta@redhat.com)
|
104
|
+
- fix elif typos (dmcphers@redhat.com)
|
105
|
+
- add oo-ruby (dmcphers@redhat.com)
|
106
|
+
- more ruby1.9 changes (dmcphers@redhat.com)
|
107
|
+
- add config to gemspec (dmcphers@redhat.com)
|
108
|
+
- Moving plugins to Rails 3.2.8 engine (kraman@gmail.com)
|
109
|
+
- getting specs up to 1.9 sclized (dmcphers@redhat.com)
|
110
|
+
- specifying rake gem version range (abhgupta@redhat.com)
|
111
|
+
- Bug 871436 - moving the default path for AUTH_PRIVKEYFILE and AUTH_PUBKEYFILE
|
112
|
+
under /etc (bleanhar@redhat.com)
|
113
|
+
- fix an ss reference (dmcphers@redhat.com)
|
114
|
+
- Moving broker config to /etc/openshift/broker.conf Rails app and all oo-*
|
115
|
+
scripts will load production environment unless the
|
116
|
+
/etc/openshift/development marker is present Added param to specify default
|
117
|
+
when looking up a config value in OpenShift::Config Moved all defaults into
|
118
|
+
plugin initializers instead of separate defaults file No longer require
|
119
|
+
loading 'openshift-origin-common/config' if 'openshift-origin-common' is
|
120
|
+
loaded openshift-origin-common selinux module is merged into F16 selinux
|
121
|
+
policy. Removing from broker %%postrun (kraman@gmail.com)
|
122
|
+
- BZ847976 - Fixing Jenkins integration (bleanhar@redhat.com)
|
123
|
+
- Fixed broker/node setup scripts to install cgroup services. Fixed
|
124
|
+
mcollective-qpid plugin so it installs during origin package build. Updated
|
125
|
+
cgroups init script to work with both systemd and init.d Updated oo-trap-user
|
126
|
+
script Renamed oo-cgroups to openshift-cgroups (service and init.d) and
|
127
|
+
created oo-admin-ctl-cgroups Pulled in oo-get-mcs-level and abstract/util
|
128
|
+
from origin-selinux branch Fixed invalid file path in rubygem-openshift-
|
129
|
+
origin-auth-mongo spec Fixed invlaid use fo Mcollective::Config in
|
130
|
+
mcollective-qpid-plugin (kraman@gmail.com)
|
131
|
+
|
90
132
|
* Thu Oct 11 2012 Brenton Leanhardt <bleanhar@redhat.com> 0.8.9-1
|
91
133
|
- fix for mongo auth plugin spec file (abhgupta@redhat.com)
|
92
134
|
- Centralize plug-in configuration (miciah.masters@gmail.com)
|
93
135
|
- Removing old build scripts Moving broker/node setup utilities into util
|
94
136
|
packages Fix Auth service module name conflicts (kraman@gmail.com)
|
95
137
|
- Merge pull request #613 from kraman/master (openshift+bot@redhat.com)
|
96
|
-
- Module name and gem path fixes for auth plugins (kraman@gmail.com)
|
97
|
-
|
98
|
-
* Mon Oct 08 2012 Dan McPherson <dmcphers@redhat.com> 0.8.8-1
|
99
|
-
-
|
100
|
-
|
101
|
-
* Fri Oct 05 2012 Krishna Raman <kraman@gmail.com> 0.8.7-1
|
102
|
-
- new package built with tito
|
103
|
-
|
104
|
-
* Mon Aug 20 2012 Brenton Leanhardt <bleanhar@redhat.com> 0.8.6-1
|
105
|
-
- gemspec refactorings based on Fedora packaging feedback (bleanhar@redhat.com)
|
106
|
-
- Providing a better error message for invalid broker iv/token
|
107
|
-
(kraman@gmail.com)
|
108
|
-
- fix for cartridge-jenkins_build.feature cucumber test (abhgupta@redhat.com)
|
109
|
-
- Bug 836055 - Bypass authentication by making a direct request to broker with
|
110
|
-
broker_auth_key (kraman@gmail.com)
|
111
|
-
- MCollective updates - Added mcollective-qpid plugin - Added mcollective-
|
112
|
-
msg-broker plugin - Added mcollective agent and facter plugins - Added
|
113
|
-
option to support ignoring node profile - Added systemu dependency for
|
114
|
-
mcollective-client (kraman@gmail.com)
|
115
|
-
- Updated gem info for rails 3.0.13 (admiller@redhat.com)
|
116
|
-
|
117
|
-
* Wed May 30 2012 Krishna Raman <kraman@gmail.com> 0.8.5-1
|
118
|
-
- Fix for Bugz 825366, 825340. SELinux changes to allow access to
|
119
|
-
user_action.log file. Logging authentication failures and user creation for
|
120
|
-
OpenShift Origin (abhgupta@redhat.com)
|
121
|
-
- Raise auth exception when no user/password is provided by web browser. Bug
|
122
|
-
815971 (kraman@gmail.com)
|
123
|
-
- Adding livecd build scripts Adding a text only minimal version of livecd
|
124
|
-
Added ability to access livecd dns from outside VM (kraman@gmail.com)
|
125
|
-
- Merge pull request #19 from kraman/dev/kraman/bug/815971
|
126
|
-
(dmcphers@redhat.com)
|
127
|
-
- Fix bug in mongo auth service where auth failure is returning nil instead of
|
128
|
-
Exception (kraman@gmail.com)
|
129
|
-
- Adding a seperate message for errors returned by cartridge when trying to add
|
130
|
-
them. Fixing CLIENT_RESULT error in node Removing tmp editor file
|
131
|
-
(kraman@gmail.com)
|
132
|
-
- Added tests (kraman@gmail.com)
|
133
|
-
- BugZ# 817957. Adding rest api for creating a user in the mongo auth service.
|
134
|
-
Rest API will be accessabel only from local host and will require login/pass
|
135
|
-
of an existing user. (kraman@gmail.com)
|
136
|
-
- moving broker auth key and iv encoding/decoding both into the plugin
|
137
|
-
(abhgupta@redhat.com)
|
138
|
-
|
139
|
-
* Thu Apr 26 2012 Krishna Raman <kraman@gmail.com> 0.8.4-1
|
140
|
-
- Added README for OpenShift Origin-mongo plugin (rpenta@redhat.com)
|
141
|
-
- cleaning up spec files (dmcphers@redhat.com)
|
142
|
-
- decoding the broker auth key before returning from login in the auth plugin
|
143
|
-
(abhgupta@redhat.com)
|
144
|
-
|
145
|
-
* Sat Apr 21 2012 Krishna Raman <kraman@gmail.com> 0.8.3-1
|
146
|
-
- new package built with tito
|
138
|
+
- Module name and gem path fixes for auth plugins (kraman@gmail.com)
|
data/test/dummy/Gemfile
CHANGED
data/test/dummy/script/rails
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openshift-origin-auth-mongo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
|
-
-
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version:
|
7
|
+
- 1
|
8
|
+
- 1
|
9
|
+
- 1
|
10
|
+
version: 1.1.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Krishna Raman
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2013-01-11 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -54,10 +54,21 @@ dependencies:
|
|
54
54
|
requirements:
|
55
55
|
- - ">="
|
56
56
|
- !ruby/object:Gem::Version
|
57
|
-
hash:
|
57
|
+
hash: 49
|
58
58
|
segments:
|
59
59
|
- 0
|
60
|
-
|
60
|
+
- 8
|
61
|
+
- 7
|
62
|
+
version: 0.8.7
|
63
|
+
- - <=
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
hash: 11
|
66
|
+
segments:
|
67
|
+
- 0
|
68
|
+
- 9
|
69
|
+
- 2
|
70
|
+
- 2
|
71
|
+
version: 0.9.2.2
|
61
72
|
type: :development
|
62
73
|
version_requirements: *id003
|
63
74
|
- !ruby/object:Gem::Dependency
|
@@ -98,15 +109,15 @@ extensions: []
|
|
98
109
|
extra_rdoc_files: []
|
99
110
|
|
100
111
|
files:
|
101
|
-
- lib/
|
102
|
-
- lib/openshift
|
103
|
-
- lib/openshift-origin-auth-mongo/app/controllers/account_controller.rb
|
104
|
-
- lib/openshift-origin-auth-mongo/config/routes.rb
|
105
|
-
- lib/openshift-origin-auth-mongo/config/initializers/openshift-origin-auth-mongo-defaults.conf
|
106
|
-
- lib/openshift-origin-auth-mongo/config/initializers/openshift-origin-auth-mongo.rb
|
107
|
-
- lib/openshift-origin-auth-mongo/lib/openshift/mongo_auth_service.rb
|
112
|
+
- lib/mongo_auth_engine.rb
|
113
|
+
- lib/openshift/mongo_auth_service.rb
|
108
114
|
- lib/openshift-origin-auth-mongo.rb
|
109
115
|
- bin/oo-register-user
|
116
|
+
- conf/openshift-origin-auth-mongo.conf.example
|
117
|
+
- config/routes.rb
|
118
|
+
- config/initializers/openshift-origin-auth-mongo.rb
|
119
|
+
- app/models/rest_account.rb
|
120
|
+
- app/controllers/account_controller.rb
|
110
121
|
- test/functional/account_controller_test.rb
|
111
122
|
- test/dummy/app/views/layouts/application.html.erb
|
112
123
|
- test/dummy/app/controllers/application_controller.rb
|
@@ -1,62 +0,0 @@
|
|
1
|
-
require 'openshift-origin-common/config'
|
2
|
-
|
3
|
-
Broker::Application.configure do
|
4
|
-
conf = OpenShift::Config.new(File.join(OpenShift::Config::PLUGINS_DIR, File.basename(__FILE__, '.rb') + '.conf'))
|
5
|
-
defaults = OpenShift::Config.new(File.join(File.dirname(__FILE__), File.basename(__FILE__, '.rb') + '-defaults.conf'))
|
6
|
-
|
7
|
-
# Grab this now because we need it for the MONGO_HOST_PORT parsing.
|
8
|
-
replica_sets = conf.get_bool("MONGO_REPLICA_SETS") || defaults.get_bool("MONGO_REPLICA_SETS")
|
9
|
-
|
10
|
-
hp = conf.get("MONGO_HOST_PORT") || defaults.get("MONGO_HOST_PORT")
|
11
|
-
|
12
|
-
# Depending on the value of the MONGO_REPLICA_SETS setting, MONGO_HOST_PORT
|
13
|
-
# must follow one of two formats, as described below.
|
14
|
-
|
15
|
-
if !hp
|
16
|
-
raise "Broker is missing Mongo configuration."
|
17
|
-
elif replica_sets
|
18
|
-
# The string should be of the following form:
|
19
|
-
#
|
20
|
-
# host-1:port-1 host-2:port-2 ...
|
21
|
-
#
|
22
|
-
# We need to parse into an array of arrays:
|
23
|
-
#
|
24
|
-
# [[<host-1>, <port-1>], [<host-2>, <port-2>], ...]
|
25
|
-
#
|
26
|
-
# where each host is a string and each port is an integer.
|
27
|
-
|
28
|
-
host_port = hp.split.map do |x|
|
29
|
-
(h,p) = x.split(":")
|
30
|
-
[h, p.to_i]
|
31
|
-
end
|
32
|
-
else
|
33
|
-
|
34
|
-
# The string should be of the following form:
|
35
|
-
#
|
36
|
-
# host:port
|
37
|
-
#
|
38
|
-
# We need to parse into an array:
|
39
|
-
#
|
40
|
-
# [host,port]
|
41
|
-
#
|
42
|
-
# where host is a string and port is an integer.
|
43
|
-
|
44
|
-
(h,p) = hp.split(":")
|
45
|
-
host_port = [h, p.to_i]
|
46
|
-
end
|
47
|
-
|
48
|
-
config.auth = {
|
49
|
-
:salt => conf.get("AUTH_SALT") || defaults.get("AUTH_SALT"),
|
50
|
-
:privkeyfile => conf.get("AUTH_PRIVKEYFILE") || defaults.get("AUTH_PRIVKEYFILE"),
|
51
|
-
:privkeypass => conf.get("AUTH_PRIVKEYPASS") || defaults.get("AUTH_PRIVKEYPASS"),
|
52
|
-
:pubkeyfile => conf.get("AUTH_PUBKEYFILE") || defaults.get("AUTH_PUBKEYFILE"),
|
53
|
-
|
54
|
-
:mongo_replica_sets => replica_sets,
|
55
|
-
:mongo_host_port => host_port,
|
56
|
-
|
57
|
-
:mongo_user => conf.get("MONGO_USER") || defaults.get("MONGO_USER"),
|
58
|
-
:mongo_password => conf.get("MONGO_PASSWORD") || defaults.get("MONGO_PASSWORD"),
|
59
|
-
:mongo_db => conf.get("MONGO_DB") || defaults.get("MONGO_DB"),
|
60
|
-
:mongo_collection => conf.get("MONGO_COLLECTION") || defaults.get("MONGO_COLLECTION")
|
61
|
-
}
|
62
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
require 'openshift-origin-controller'
|
2
|
-
require 'rails'
|
3
|
-
|
4
|
-
module OpenShift
|
5
|
-
class MongoAuthServiceEngine < Rails::Engine
|
6
|
-
paths.app.controllers << "lib/openshift-origin-auth-mongo/app/controllers"
|
7
|
-
paths.lib << "lib/openshift-origin-auth-mongo/lib"
|
8
|
-
paths.config << "lib/openshift-origin-auth-mongo/config"
|
9
|
-
paths.app.models << "lib/openshift-origin-auth-mongo/app/models"
|
10
|
-
config.autoload_paths += %W(#{config.root}/lib)
|
11
|
-
end
|
12
|
-
end
|