Skip to content

Commit 432d0be

Browse files
committed
cleanup
1 parent e0e6d20 commit 432d0be

24 files changed

+108
-399
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ See How_to_Install_a_Smart-Proxy_Plugin for how to install Smart Proxy plugins
88

99
To enable this realm provider, edit `/etc/foreman-proxy/settings.d/realm.yml` and set:
1010

11+
:enabled: true
12+
1113
:use_provider: realm_ad
1214

1315
## Contributing

Vagrantfile

-43
This file was deleted.

bundler.d/realm_ad_plugin.rb

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
gem 'smart_proxy_realm_ad_plugin'

config/realm_ad.yml.example

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
# Authentication for Kerberos-based Realms
3+
:realm: EXAMPLE.COM
4+
5+
:keytab_path: /etc/foreman-proxy/realm_ad.keytab
6+
:principal: realm-proxy@EXAMPLE.COM
7+
8+
:domain_controller: dc.example.com
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
module Proxy::AdRealm
2+
class ConfigurationLoader
3+
def load_classes
4+
require 'smart_proxy_realm_ad/provider'
5+
end
6+
7+
def load_dependency_injection_wirings(container_instance, settings)
8+
container_instance.depedency : realm_provider_impl,
9+
lambda {
10+
::Proxy::AdRealm::Provider.new(
11+
settings[:realm],
12+
settings[:keytab_path],
13+
settings[:principal],
14+
settings[:domain_controller]
15+
)
16+
}
17+
end
18+
end
19+
end

lib/smart_proxy_realm_ad/plugin.rb

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module Proxy::AdRealm
2+
class Plugin < Proxy::Provider
3+
load_classes ::Proxy::AdRealm::ConfigurationLoader
4+
load_dependency_injection_wirings ::Proxy::AdRealm::ConfigurationLoader
5+
6+
validate_presence :realm, :keytab_path, :principal, :domain_controller
7+
8+
plugin :realm_ad, ::Proxy::VERSION
9+
end
10+
end

lib/smart_proxy_realm_ad/provider.rb

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
require 'proxy/kerberos'
2+
require 'radcli'
3+
4+
module Proxy::AdRealm
5+
class Provider
6+
include Proxy::Log
7+
include Proxy::Util
8+
include Proxy::Kerberos
9+
10+
def initialize(realm, keytab_path, principal, domain_controller)
11+
@realm = realm
12+
@keytab_path = keytab_path
13+
@principal = principal
14+
@domain_controller = domain_controller
15+
@domain = realm.downcase
16+
end
17+
18+
def check_realm realm
19+
raise Exception.new "Unknown realm #{realm}" unless realm.casecmp(@realm).zero?
20+
end
21+
22+
def find hostname
23+
true
24+
end
25+
26+
def create realm, hostname, params
27+
end
28+
29+
def delete realm, hostname
30+
end
31+
32+
private
33+
34+
def hostfqdn_hostname host_fqdn
35+
end
36+
37+
def do_host_create hostname, password
38+
end
39+
40+
def do_host_rebuild hostname, password
41+
end
42+
43+
def kinit_racdli_connect
44+
end
45+
46+
def radcli_connect
47+
end
48+
49+
def radcli_join
50+
end
51+
52+
def generate_password
53+
end
54+
55+
def racli_password
56+
end
57+
58+
def radcli_delete
59+
end
60+
61+
end
62+
end
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module Proxy
2-
module ADRealm
2+
module AdRealm
33
VERSION = '0.1'
44
end
5-
end
5+
end

lib/smart_proxy_realm_ad_plugin.rb

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
require 'smart_proxy_realm_ad/configuration_loader'
2+
require 'smart_proxy_realm_ad/plugin'
3+
4+
module Proxy::AdRealm; end

scripts/install_adds.ps1

-20
This file was deleted.

scripts/install_plugin.sh

-22
This file was deleted.

scripts/install_radcli.sh

-10
This file was deleted.

scripts/setup_smart_proxy.sh

-33
This file was deleted.

scripts/start_smart_proxy.sh

-13
This file was deleted.

src/LICENSE

Whitespace-only changes.

src/README.md

Whitespace-only changes.

src/Rakefile

-14
This file was deleted.

src/config/smart_proxy_realm_ad_plugin.yml

-4
This file was deleted.

src/lib/realm_ad_plugin_plugin.rb

-12
This file was deleted.

src/lib/smart_proxy_realm_ad_plugin/realm_ad_plugin_configuration.rb

-22
This file was deleted.

0 commit comments

Comments
 (0)