Skip to content

Commit db58784

Browse files
committed
Added script to test Realm API using curl and logged each call in the provider.
1 parent 2b54bd5 commit db58784

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# !!! WORK IN PROGRESS !!!
2+
13
# Description
24
This plugin adds a new realm provider for managing hosts in Active Directory.
35

install.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
bundle install && gem build smart_proxy_realm_ad_plugin.gemspec && sudo gem install smart_proxy_realm_ad_plugin-0.1.gem

lib/smart_proxy_realm_ad/provider.rb

+2
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@ def find hostname
2424
end
2525

2626
def create realm, hostname, params
27+
logger.info "Proxy::AdRealm: create... #{realm}, #{hostname}, #{params}"
2728
end
2829

2930
def delete realm, hostname
31+
logger.info "Proxy::AdRealm: delete... #{realm}, #{hostname}"
3032
end
3133

3234
private

test/api_tests.sh

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/sh
2+
3+
# ping smart-proxy
4+
curl -H "Accept: application/json" http://localhost:8000/features
5+
6+
# create host
7+
curl -d 'hostname=server1.example.com' http://localhost:8000/realm/EXAMPLE.COM
8+
9+
# rebuild host
10+
curl -d 'hostname=server1.example.com&rebuild=true' http://localhost:8000/realm/EXAMPLE.COM
11+
12+
# delete host
13+
curl -XDELETE http://localhost:8000/realm/EXAMPLE.COM/server1.example.com

0 commit comments

Comments
 (0)