ehsso 0.1.1 → 0.1.2
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.
- checksums.yaml +4 -4
- data/app/models/person.rb +9 -9
- data/lib/ehsso/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c3e47fde436c74f25ffcda42ee528aec4390bad
|
4
|
+
data.tar.gz: 77d43af5c6ee632e331464196d689752d62be8ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2c20aea3eb75cc8936be04a6426d9219ff9a8a60c624b5a0fc569dc6757d83abfa4395a7552f1101a7d90cd12e56659e5c4441560be87688ebeb6fd09157346
|
7
|
+
data.tar.gz: c4d1e4b4ec242792695691dc5195106c537ca716ec741d766514a6e47a7ef7e387e530bc9f066e91e3816bc5e39ed8f9636d485bfeca9a90138739c2b096be7e
|
data/app/models/person.rb
CHANGED
@@ -54,18 +54,11 @@ module Ehsso
|
|
54
54
|
end
|
55
55
|
|
56
56
|
def fetch
|
57
|
-
|
58
|
-
userpwd = Ehsso.configuration.username_and_password
|
59
|
-
response = Typhoeus.post(url, body: payload(action: 'people.modules.roles'), userpwd: userpwd)
|
60
|
-
handle_response(response)
|
57
|
+
handle_service_call(action: 'people.modules.roles')
|
61
58
|
end
|
62
59
|
|
63
|
-
|
64
60
|
def fetch_or_create
|
65
|
-
|
66
|
-
userpwd = Ehsso.configuration.username_and_password
|
67
|
-
response = Typhoeus.post(url, body: payload(action: 'people_with_guest_registration_if_missing.modules.roles'), userpwd: userpwd)
|
68
|
-
handle_response(response)
|
61
|
+
handle_service_call(action: 'people_with_guest_registration_if_missing.modules.roles')
|
69
62
|
end
|
70
63
|
|
71
64
|
private
|
@@ -90,6 +83,13 @@ module Ehsso
|
|
90
83
|
}
|
91
84
|
end
|
92
85
|
|
86
|
+
def handle_service_call(args={})
|
87
|
+
url = [Ehsso.configuration.base_url, 'people'].join('/')
|
88
|
+
userpwd = Ehsso.configuration.username_and_password
|
89
|
+
response = Typhoeus.post(url, body: payload(action: args[:action]), userpwd: userpwd)
|
90
|
+
handle_response(response)
|
91
|
+
end
|
92
|
+
|
93
93
|
def handle_response(response)
|
94
94
|
if response.code == 200
|
95
95
|
begin
|
data/lib/ehsso/version.rb
CHANGED