openshift-origin-auth-remote-user 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYRIGHT +1 -0
- data/Gemfile +3 -0
- data/LICENSE +11 -0
- data/README-KERB +66 -0
- data/README-LDAP +25 -0
- data/README.md +3 -0
- data/Rakefile +11 -0
- data/conf/openshift-origin-auth-remote-user-basic.conf.sample +37 -0
- data/conf/openshift-origin-auth-remote-user-kerberos.conf.sample +41 -0
- data/conf/openshift-origin-auth-remote-user-ldap.conf.sample +46 -0
- data/conf/openshift-origin-auth-remote-user.conf.example +1 -0
- data/config/initializers/openshift-origin-auth-remote-user.rb +16 -0
- data/config/routes.rb +9 -0
- data/lib/openshift-origin-auth-remote-user.rb +8 -0
- data/lib/openshift/remote_user_auth_service.rb +40 -0
- data/lib/remote_user_auth_engine.rb +7 -0
- data/openshift-origin-auth-remote-user.gemspec +33 -0
- data/rubygem-openshift-origin-auth-remote-user.spec +110 -0
- data/test/dummy/Gemfile +32 -0
- data/test/dummy/README +256 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/controllers/application_controller.rb +3 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +42 -0
- data/test/dummy/config/boot.rb +6 -0
- data/test/dummy/config/database.yml +5 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/test.rb +53 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/inflections.rb +10 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/routes.rb +58 -0
- data/test/dummy/db/seeds.rb +7 -0
- data/test/dummy/doc/README_FOR_APP +2 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +26 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/public/images/rails.png +0 -0
- data/test/dummy/public/index.html +239 -0
- data/test/dummy/public/javascripts/application.js +2 -0
- data/test/dummy/public/javascripts/controls.js +965 -0
- data/test/dummy/public/javascripts/dragdrop.js +974 -0
- data/test/dummy/public/javascripts/effects.js +1123 -0
- data/test/dummy/public/javascripts/prototype.js +6001 -0
- data/test/dummy/public/javascripts/rails.js +191 -0
- data/test/dummy/public/robots.txt +5 -0
- data/test/dummy/script/rails +6 -0
- data/test/dummy/test/performance/browsing_test.rb +9 -0
- data/test/dummy/test/test_helper.rb +13 -0
- data/test/functional/authenticate_test.rb +23 -0
- data/test/test_helper.rb +15 -0
- data/test/unit/broker_auth_test.rb +28 -0
- metadata +244 -0
data/COPYRIGHT
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
Copyright 2012 Red Hat, Inc. and/or its affiliates.
|
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
2
|
+
you may not use this file except in compliance with the License.
|
3
|
+
You may obtain a copy of the License at
|
4
|
+
|
5
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
6
|
+
|
7
|
+
Unless required by applicable law or agreed to in writing, software
|
8
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
9
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
10
|
+
See the License for the specific language governing permissions and
|
11
|
+
limitations under the License.
|
data/README-KERB
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
#The Broker side of the configuration requires the mod_auth_kerb package to be
|
2
|
+
#installed.
|
3
|
+
|
4
|
+
#Apart from that you must also have a kerberos kdc setup. The service host
|
5
|
+
#needs to have a service principle added for the OpenShift broker proxy (httpd)
|
6
|
+
#server. Once a service principle is created, you'll want to add it to the kdc
|
7
|
+
#keytab file. Once added to the kdc keytab file, you'll want to extract the
|
8
|
+
#keytab file to the OpenShift broker proxy and point to this extracted keytab
|
9
|
+
#file in the OpenShift broker proxy httpd configuration file.
|
10
|
+
|
11
|
+
Steps to perform on the kdc:
|
12
|
+
1) #install the krb packages
|
13
|
+
yum install krb5-workstation krb5-server krb5-libs
|
14
|
+
|
15
|
+
2) #create the principle db
|
16
|
+
kdb5_util create -s
|
17
|
+
|
18
|
+
3) #add the service principle
|
19
|
+
kadmin.local -q "addprinc HTTP/www.example.com"
|
20
|
+
|
21
|
+
4) #add a user principle
|
22
|
+
kadmin
|
23
|
+
kadmin: addprinc user@EXAMPLE.COM
|
24
|
+
|
25
|
+
5) #add the service principle to the kdc keytab
|
26
|
+
kadmin
|
27
|
+
kadmin: ktadd HTTP/www.example.com
|
28
|
+
|
29
|
+
6) #configure the OpenShift broker proxy krb5 client, you can use something similar to the following:
|
30
|
+
[logging]
|
31
|
+
default = FILE:/var/log/krb5libs.log
|
32
|
+
kdc = FILE:/var/log/krb5kdc.log
|
33
|
+
admin_server = FILE:/var/log/kadmind.log
|
34
|
+
|
35
|
+
[libdefaults]
|
36
|
+
default_realm = EXAMPLE.COM
|
37
|
+
dns_lookup_realm = false
|
38
|
+
dns_lookup_kdc = false
|
39
|
+
ticket_lifetime = 24h
|
40
|
+
forwardable = yes
|
41
|
+
allow_weak_crypto = yes
|
42
|
+
default_keytab_name = FILE:/var/www/openshift/broker/http/conf.d/http.keytab
|
43
|
+
|
44
|
+
[realms]
|
45
|
+
EXAMPLE.COM = {
|
46
|
+
kdc = kerberos.example.com
|
47
|
+
admin_server = kerberos.example.com
|
48
|
+
default_domain = EXAMPLE.COM
|
49
|
+
}
|
50
|
+
|
51
|
+
[domain_realm]
|
52
|
+
example.com = EXAMPLE.COM
|
53
|
+
.example.com = EXAMPLE.COM
|
54
|
+
|
55
|
+
7) #make sure you can run kinit HTTP/www.example.com successfully. If you can, it's time to extract the keytab file for the service principle on the OpenShift broker.
|
56
|
+
kadmin
|
57
|
+
kadmin: ktadd -k /var/www/openshift/broker/httpd/conf.d/http.keytab HTTP/www.example.com
|
58
|
+
|
59
|
+
8) #change the ownership of the keytab so it's readable by the httpd process
|
60
|
+
chown apache.apache /var/www/openshift/broker/httpd/conf.d/http.keytab
|
61
|
+
|
62
|
+
9) #use the provided openshift-origin-auth-remote-user-kerberos.conf.sample file (change if necessary to reflect your service principle service name), rename the sample file (take off the .sample extension)
|
63
|
+
mv openshift-origin-auth-remote-user-kerberos.conf.sample openshift-origin-auth-remote-user-kerberos.conf
|
64
|
+
|
65
|
+
10) #restart the OpenShift broker service
|
66
|
+
service openshift-broker restart
|
data/README-LDAP
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
#You can setup an ldap server by doing the following:
|
2
|
+
|
3
|
+
#install openldap
|
4
|
+
yum install openldap*
|
5
|
+
|
6
|
+
#stop the ldap service if it's running
|
7
|
+
service slapd stop
|
8
|
+
|
9
|
+
#import the user ldiff
|
10
|
+
slapadd -l ldap-user-sample.ldiff
|
11
|
+
|
12
|
+
#change the ownership of /var/lib/ldap
|
13
|
+
chown -R ldap.ldap /var/lib/ldap
|
14
|
+
|
15
|
+
#start the ldap service
|
16
|
+
service slapd start
|
17
|
+
|
18
|
+
|
19
|
+
#Now that the ldap service is running, rename the sample httpd configuration file:
|
20
|
+
mv openshift-origin-auth-remote-user-ldap.sample openshift-origin-auth-remote-user-ldap.conf
|
21
|
+
|
22
|
+
#Change the AuthLDAPURL hostname to reflect the actual hostname or IP address of your ldap server
|
23
|
+
#Restart the OpenShift Broker
|
24
|
+
|
25
|
+
service openshift-broker restart
|
data/README.md
ADDED
@@ -0,0 +1,3 @@
|
|
1
|
+
Notice of Export Control Law
|
2
|
+
|
3
|
+
This software distribution includes cryptographic software that is subject to the U.S. Export Administration Regulations (the "*EAR*") and other U.S. and foreign laws and may not be exported, re-exported or transferred (a) to any country listed in Country Group E:1 in Supplement No. 1 to part 740 of the EAR (currently, Cuba, Iran, North Korea, Sudan & Syria); (b) to any prohibited destination or to any end user who has been prohibited from participating in U.S. export transactions by any federal agency of the U.S. government; or (c) for use in connection with the design, development or production of nuclear, chemical or biological weapons, or rocket systems, space launch vehicles, or sounding rockets, or unmanned air vehicle systems.You may not download this software or technical information if you are located in one of these countries or otherwise subject to these restrictions. You may not provide this software or technical information to individuals or entities located in one of these countries or otherwise subject to these restrictions. You are also responsible for compliance with foreign law requirements applicable to the import, export and use of this software and technical information.
|
data/Rakefile
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
#require "bundler/gem_tasks"
|
2
|
+
require 'rake'
|
3
|
+
require 'rake/testtask'
|
4
|
+
|
5
|
+
Rake::TestTask.new(:test) do |t|
|
6
|
+
sh "/usr/bin/mongo localhost/openshift_origin_broker_test --eval 'db.addUser(\"openshift\", \"mooo\")'"
|
7
|
+
t.libs << 'test'
|
8
|
+
t.warning = false
|
9
|
+
t.verbose = true
|
10
|
+
t.test_files = FileList['test/**/*_test.rb']
|
11
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
LoadModule auth_basic_module modules/mod_auth_basic.so
|
2
|
+
LoadModule authn_file_module modules/mod_authn_file.so
|
3
|
+
LoadModule authz_user_module modules/mod_authz_user.so
|
4
|
+
|
5
|
+
<Location /broker>
|
6
|
+
AuthName "OpenShift"
|
7
|
+
AuthType Basic
|
8
|
+
AuthUserFile /etc/openshift/htpasswd
|
9
|
+
require valid-user
|
10
|
+
|
11
|
+
# The node->broker auth is handled in the Ruby code
|
12
|
+
BrowserMatchNoCase ^OpenShift passthrough
|
13
|
+
Allow from env=passthrough
|
14
|
+
|
15
|
+
# Console traffic will hit the local port. mod_proxy will set this header automatically.
|
16
|
+
SetEnvIf X-Forwarded-For "^$" local_traffic=1
|
17
|
+
# Turn the Console output header into the Apache environment variable for the broker remote-user plugin
|
18
|
+
SetEnvIf X-Remote-User "(..*)" REMOTE_USER=$1
|
19
|
+
Allow from env=local_traffic
|
20
|
+
|
21
|
+
Order Deny,Allow
|
22
|
+
Deny from all
|
23
|
+
Satisfy any
|
24
|
+
</Location>
|
25
|
+
|
26
|
+
# The following APIs do not require auth:
|
27
|
+
<Location /broker/rest/application_templates*>
|
28
|
+
Allow from all
|
29
|
+
</Location>
|
30
|
+
|
31
|
+
<Location /broker/rest/cartridges*>
|
32
|
+
Allow from all
|
33
|
+
</Location>
|
34
|
+
|
35
|
+
<Location /broker/rest/api*>
|
36
|
+
Allow from all
|
37
|
+
</Location>
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# Provided by the mod_auth_kerb package
|
2
|
+
LoadModule auth_basic_module modules/mod_auth_basic.so
|
3
|
+
LoadModule authz_user_module modules/mod_authz_user.so
|
4
|
+
LoadModule auth_kerb_module modules/mod_auth_kerb.so
|
5
|
+
<Location /broker>
|
6
|
+
AuthName "OpenShift"
|
7
|
+
AuthType Kerberos
|
8
|
+
KrbMethodNegotiate On
|
9
|
+
KrbMethodK5Passwd On
|
10
|
+
KrbServiceName HTTP/www.example.com
|
11
|
+
KrbAuthRealms EXAMPLE.COM
|
12
|
+
Krb5KeyTab /var/www/openshift/broker/httpd/conf.d/http.keytab
|
13
|
+
require valid-user
|
14
|
+
|
15
|
+
# The node->broker auth is handled in the Ruby code
|
16
|
+
BrowserMatchNoCase ^OpenShift passthrough
|
17
|
+
Allow from env=passthrough
|
18
|
+
|
19
|
+
# Console traffic will hit the local port. mod_proxy will set this header automatically.
|
20
|
+
SetEnvIf X-Forwarded-For "^$" local_traffic=1
|
21
|
+
# Turn the Console output header into the Apache environment variable for the broker remote-user plugin
|
22
|
+
SetEnvIf X-Remote-User "(..*)" REMOTE_USER=$1
|
23
|
+
Allow from env=local_traffic
|
24
|
+
|
25
|
+
Order Deny,Allow
|
26
|
+
Deny from all
|
27
|
+
Satisfy any
|
28
|
+
</Location>
|
29
|
+
|
30
|
+
# The following APIs do not require auth:
|
31
|
+
<Location /broker/rest/application_templates*>
|
32
|
+
Allow from all
|
33
|
+
</Location>
|
34
|
+
|
35
|
+
<Location /broker/rest/cartridges*>
|
36
|
+
Allow from all
|
37
|
+
</Location>
|
38
|
+
|
39
|
+
<Location /broker/rest/api*>
|
40
|
+
Allow from all
|
41
|
+
</Location>
|
@@ -0,0 +1,46 @@
|
|
1
|
+
LoadModule auth_basic_module modules/mod_auth_basic.so
|
2
|
+
LoadModule authz_user_module modules/mod_authz_user.so
|
3
|
+
LoadModule ldap_module modules/mod_ldap.so
|
4
|
+
LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
|
5
|
+
|
6
|
+
# By default the LDAPCacheTTL directive is set to 600 seconds. If you want to
|
7
|
+
# effectively disable LDAP caching in mod_ldap, set the directive to 0. There
|
8
|
+
# is a performance trade-off, but disabling the cache will make things like
|
9
|
+
# password changes effective immediately.
|
10
|
+
# http://httpd.apache.org/docs/2.4/mod/mod_ldap.html
|
11
|
+
# LDAPCacheTTL 0
|
12
|
+
|
13
|
+
<Location /broker>
|
14
|
+
AuthName "OpenShift"
|
15
|
+
AuthType Basic
|
16
|
+
AuthBasicProvider ldap
|
17
|
+
AuthLDAPURL "ldap://ldap.example.com:389/ou=People,dc=my-domain,dc=com?uid?sub?(objectClass=*)"
|
18
|
+
require valid-user
|
19
|
+
|
20
|
+
# The node->broker auth is handled in the Ruby code
|
21
|
+
BrowserMatchNoCase ^OpenShift passthrough
|
22
|
+
Allow from env=passthrough
|
23
|
+
|
24
|
+
# Console traffic will hit the local port. mod_proxy will set this header automatically.
|
25
|
+
SetEnvIf X-Forwarded-For "^$" local_traffic=1
|
26
|
+
# Turn the Console output header into the Apache environment variable for the broker remote-user plugin
|
27
|
+
SetEnvIf X-Remote-User "(..*)" REMOTE_USER=$1
|
28
|
+
Allow from env=local_traffic
|
29
|
+
|
30
|
+
Order Deny,Allow
|
31
|
+
Deny from all
|
32
|
+
Satisfy any
|
33
|
+
</Location>
|
34
|
+
|
35
|
+
# The following APIs do not require auth:
|
36
|
+
<Location /broker/rest/application_templates*>
|
37
|
+
Allow from all
|
38
|
+
</Location>
|
39
|
+
|
40
|
+
<Location /broker/rest/cartridges*>
|
41
|
+
Allow from all
|
42
|
+
</Location>
|
43
|
+
|
44
|
+
<Location /broker/rest/api*>
|
45
|
+
Allow from all
|
46
|
+
</Location>
|
@@ -0,0 +1 @@
|
|
1
|
+
TRUSTED_HEADER="REMOTE_USER"
|
@@ -0,0 +1,16 @@
|
|
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
|
+
config.auth[:trusted_header] = conf.get("TRUSTED_HEADER", "REMOTE_USER")
|
16
|
+
end
|
data/config/routes.rb
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
module OpenShift
|
2
|
+
module RemoteUserAuthServiceModule
|
3
|
+
require 'remote_user_auth_engine' if defined?(Rails) && Rails::VERSION::MAJOR == 3
|
4
|
+
end
|
5
|
+
end
|
6
|
+
|
7
|
+
require "openshift/remote_user_auth_service.rb"
|
8
|
+
OpenShift::AuthService.provider=OpenShift::RemoteUserAuthService
|
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'openshift-origin-controller'
|
3
|
+
require 'date'
|
4
|
+
|
5
|
+
module OpenShift
|
6
|
+
class RemoteUserAuthService < OpenShift::AuthService
|
7
|
+
|
8
|
+
def initialize
|
9
|
+
super
|
10
|
+
|
11
|
+
@trusted_header = @auth_info[:trusted_header]
|
12
|
+
end
|
13
|
+
|
14
|
+
# The base_controller will actually pass in a password but it can't be
|
15
|
+
# trusted. REMOTE_USER must only be set if the web server has verified the
|
16
|
+
# password.
|
17
|
+
def authenticate(request, login=nil, password=nil)
|
18
|
+
if request.headers['User-Agent'] == "OpenShift"
|
19
|
+
# password == iv, login == key
|
20
|
+
return validate_broker_key(password, login)
|
21
|
+
else
|
22
|
+
authenticated_user = request.env[@trusted_header]
|
23
|
+
raise OpenShift::AccessDeniedException if authenticated_user.nil?
|
24
|
+
return {:username => authenticated_user, :auth_method => :login}
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
# This is only called by the legacy controller and should be removed as
|
29
|
+
# soon as all clients have been ported.
|
30
|
+
def login(request, params, cookies)
|
31
|
+
if params['broker_auth_key'] && params['broker_auth_iv']
|
32
|
+
return validate_broker_key(params['broker_auth_iv'], params['broker_auth_key'])
|
33
|
+
else
|
34
|
+
username = request.env[@trusted_header]
|
35
|
+
Rails.logger.debug("Found" + username)
|
36
|
+
return authenticate(request, username)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
config_dir = File.join(File.join("config", "**"), "*")
|
3
|
+
$:.push File.expand_path("../lib", __FILE__)
|
4
|
+
lib_dir = File.join(File.join("lib", "**"), "*")
|
5
|
+
test_dir = File.join(File.join("test", "**"), "*")
|
6
|
+
bin_dir = File.join("bin","*")
|
7
|
+
conf_dir = File.join(File.join("conf", "**"), "*")
|
8
|
+
spec_file = "rubygem-openshift-origin-auth-remote-user.spec"
|
9
|
+
|
10
|
+
Gem::Specification.new do |s|
|
11
|
+
s.name = "openshift-origin-auth-remote-user"
|
12
|
+
s.version = `rpm -q --define 'rhel 7' --qf "%{version}\n" --specfile #{spec_file}`.split[0]
|
13
|
+
s.license = `rpm -q --define 'rhel 7' --qf "%{license}\n" --specfile #{spec_file}`.split[0]
|
14
|
+
s.authors = ["Brenton Leanhardt"]
|
15
|
+
s.email = ["bleanhar@redhat.com"]
|
16
|
+
s.homepage = `rpm -q --define 'rhel 7' --qf "%{url}\n" --specfile #{spec_file}`.split[0]
|
17
|
+
s.summary = `rpm -q --define 'rhel 7' --qf "%{description}\n" --specfile #{spec_file}`.split[0]
|
18
|
+
s.description = `rpm -q --define 'rhel 7' --qf "%{description}\n" --specfile #{spec_file}`.split[0]
|
19
|
+
|
20
|
+
s.rubyforge_project = "openshift-origin-auth-remote-user"
|
21
|
+
|
22
|
+
s.files = Dir[lib_dir] + Dir[bin_dir] + Dir[conf_dir] + Dir[config_dir]
|
23
|
+
s.test_files = Dir[test_dir]
|
24
|
+
s.executables = Dir[bin_dir].map {|binary| File.basename(binary)}
|
25
|
+
s.files += %w(README.md Rakefile Gemfile rubygem-openshift-origin-auth-remote-user.spec openshift-origin-auth-remote-user.gemspec LICENSE COPYRIGHT README-LDAP README-KERB)
|
26
|
+
s.require_paths = ["lib"]
|
27
|
+
|
28
|
+
s.add_dependency('openshift-origin-controller')
|
29
|
+
s.add_dependency('json')
|
30
|
+
s.add_development_dependency('rake', '>= 0.8.7', '<= 0.9.2.2')
|
31
|
+
s.add_development_dependency('bundler')
|
32
|
+
s.add_development_dependency('mocha')
|
33
|
+
end
|
@@ -0,0 +1,110 @@
|
|
1
|
+
%define brokerdir %{_var}/www/openshift/broker
|
2
|
+
|
3
|
+
%if 0%{?fedora}%{?rhel} <= 6
|
4
|
+
%global scl ruby193
|
5
|
+
%global scl_prefix ruby193-
|
6
|
+
%endif
|
7
|
+
%{!?scl:%global pkg_name %{name}}
|
8
|
+
%{?scl:%scl_package rubygem-%{gem_name}}
|
9
|
+
%global gem_name openshift-origin-auth-remote-user
|
10
|
+
%global rubyabi 1.9.1
|
11
|
+
|
12
|
+
Summary: OpenShift plugin for remote-user authentication
|
13
|
+
Name: rubygem-%{gem_name}
|
14
|
+
Version: 1.2.3
|
15
|
+
Release: 1%{?dist}
|
16
|
+
Group: Development/Languages
|
17
|
+
License: ASL 2.0
|
18
|
+
URL: http://openshift.redhat.com
|
19
|
+
Source0: rubygem-%{gem_name}-%{version}.tar.gz
|
20
|
+
Requires: %{?scl:%scl_prefix}ruby(abi) = %{rubyabi}
|
21
|
+
Requires: %{?scl:%scl_prefix}ruby
|
22
|
+
Requires: %{?scl:%scl_prefix}rubygems
|
23
|
+
Requires: rubygem(openshift-origin-common)
|
24
|
+
Requires: %{?scl:%scl_prefix}rubygem(json)
|
25
|
+
Requires: openshift-broker
|
26
|
+
|
27
|
+
%if 0%{?fedora}%{?rhel} <= 6
|
28
|
+
BuildRequires: ruby193-build
|
29
|
+
BuildRequires: scl-utils-build
|
30
|
+
%endif
|
31
|
+
BuildRequires: %{?scl:%scl_prefix}ruby(abi) = %{rubyabi}
|
32
|
+
BuildRequires: %{?scl:%scl_prefix}ruby
|
33
|
+
BuildRequires: %{?scl:%scl_prefix}rubygems
|
34
|
+
BuildRequires: %{?scl:%scl_prefix}rubygems-devel
|
35
|
+
BuildArch: noarch
|
36
|
+
Provides: rubygem(%{gem_name}) = %version
|
37
|
+
|
38
|
+
%description
|
39
|
+
Provides a remote-user auth service based plugin
|
40
|
+
|
41
|
+
%prep
|
42
|
+
%setup -q
|
43
|
+
|
44
|
+
%build
|
45
|
+
%{?scl:scl enable %scl - << \EOF}
|
46
|
+
mkdir -p ./%{gem_dir}
|
47
|
+
# Create the gem as gem install only works on a gem file
|
48
|
+
gem build %{gem_name}.gemspec
|
49
|
+
export CONFIGURE_ARGS="--with-cflags='%{optflags}'"
|
50
|
+
# gem install compiles any C extensions and installs into a directory
|
51
|
+
# We set that to be a local directory so that we can move it into the
|
52
|
+
# buildroot in %%install
|
53
|
+
gem install -V \
|
54
|
+
--local \
|
55
|
+
--install-dir ./%{gem_dir} \
|
56
|
+
--bindir ./%{_bindir} \
|
57
|
+
--force \
|
58
|
+
--rdoc \
|
59
|
+
%{gem_name}-%{version}.gem
|
60
|
+
%{?scl:EOF}
|
61
|
+
|
62
|
+
%install
|
63
|
+
mkdir -p %{buildroot}%{gem_dir}
|
64
|
+
cp -a ./%{gem_dir}/* %{buildroot}%{gem_dir}/
|
65
|
+
|
66
|
+
# Add documents/examples
|
67
|
+
mkdir -p %{buildroot}%{_docdir}/%{name}-%{version}/
|
68
|
+
cp -r doc/* %{buildroot}%{_docdir}/%{name}-%{version}/
|
69
|
+
|
70
|
+
mkdir -p %{buildroot}%{brokerdir}/httpd/conf.d
|
71
|
+
install -m 755 conf/%{gem_name}-basic.conf.sample %{buildroot}%{brokerdir}/httpd/conf.d
|
72
|
+
install -m 755 conf/%{gem_name}-ldap.conf.sample %{buildroot}%{brokerdir}/httpd/conf.d
|
73
|
+
install -m 755 conf/%{gem_name}-kerberos.conf.sample %{buildroot}%{brokerdir}/httpd/conf.d
|
74
|
+
|
75
|
+
mkdir -p %{buildroot}/etc/openshift/plugins.d
|
76
|
+
cp conf/openshift-origin-auth-remote-user.conf.example %{buildroot}/etc/openshift/plugins.d/openshift-origin-auth-remote-user.conf.example
|
77
|
+
|
78
|
+
%clean
|
79
|
+
rm -rf %{buildroot}
|
80
|
+
|
81
|
+
%files
|
82
|
+
%defattr(-,root,root,-)
|
83
|
+
%doc %{gem_docdir}
|
84
|
+
%doc %{_docdir}/%{name}-%{version}
|
85
|
+
%{gem_instdir}
|
86
|
+
%{gem_spec}
|
87
|
+
%{gem_cache}
|
88
|
+
%{brokerdir}/httpd/conf.d/%{gem_name}-basic.conf.sample
|
89
|
+
%{brokerdir}/httpd/conf.d/%{gem_name}-ldap.conf.sample
|
90
|
+
%{brokerdir}/httpd/conf.d/%{gem_name}-kerberos.conf.sample
|
91
|
+
/etc/openshift/plugins.d/openshift-origin-auth-remote-user.conf.example
|
92
|
+
|
93
|
+
%changelog
|
94
|
+
* Wed Dec 05 2012 Adam Miller <admiller@redhat.com> 1.2.3-1
|
95
|
+
- updated gemspecs so they work with scl rpm spec files. (tdawson@redhat.com)
|
96
|
+
|
97
|
+
* Thu Nov 29 2012 Adam Miller <admiller@redhat.com> 1.2.2-1
|
98
|
+
- add oo-ruby (dmcphers@redhat.com)
|
99
|
+
|
100
|
+
* Sat Nov 17 2012 Adam Miller <admiller@redhat.com> 1.2.1-1
|
101
|
+
- bump_minor_versions for sprint 21 (admiller@redhat.com)
|
102
|
+
|
103
|
+
* Wed Nov 14 2012 Adam Miller <admiller@redhat.com> 1.1.2-1
|
104
|
+
- add config to gemspec (dmcphers@redhat.com)
|
105
|
+
- Moving plugins to Rails 3.2.8 engine (kraman@gmail.com)
|
106
|
+
- getting specs up to 1.9 sclized (dmcphers@redhat.com)
|
107
|
+
- specifying rake gem version range (abhgupta@redhat.com)
|
108
|
+
|
109
|
+
* Thu Nov 01 2012 Adam Miller <admiller@redhat.com> 1.1.1-1
|
110
|
+
- bump_minor_versions for sprint 20 (admiller@redhat.com)
|