soar_pl 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/soar_pl/authorization_policy.rb +11 -9
- data/lib/soar_pl/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a33dc515b79a055e58c4cd8322db826b7e8ea527
|
4
|
+
data.tar.gz: b8efb7557335ff3438c1c3ac61a434c397743ad1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d864b0032344dcbdb3651c52708c76ed4765279867af052eef98d30f94a19e4615ee5f89c31a6df2764729b14194c7fa6477c240acbfa7805225453336fa835
|
7
|
+
data.tar.gz: 36fc2a86fd22f232ec34dc1b10c23335a8b5fd58a1bb179b43095d7c01af4225863ccb74a4979d83b12c4e305d05ea1de2ab4c54bf19ec9537b1a1dfdb5c1b65
|
@@ -62,16 +62,18 @@ module SoarPl
|
|
62
62
|
|
63
63
|
def authorize(subject_identifier, requestor_identifier, resource_identifier, request)
|
64
64
|
#byebug
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
65
|
+
if request
|
66
|
+
requested = request
|
67
|
+
begin
|
68
|
+
requested = JSON.parse(request) if not request.is_a?(Hash)
|
69
|
+
rescue => ex
|
70
|
+
return fail("Invalid request", build_result(false, "Invalid request", @idm))
|
71
|
+
end
|
70
72
|
end
|
71
|
-
return fail_invalid("resource identifier") if not valid_non_empty_string?(resource_identifier)
|
72
|
-
return fail("Invalid request", build_result(false, "Invalid request", @idm)) if requested and not requested.is_a?(Hash)
|
73
|
-
return fail_invalid("requestor identifier") if not valid_non_empty_string?(requestor_identifier)
|
74
|
-
return fail_invalid("subject identifier") if not valid_non_empty_string?(subject_identifier)
|
73
|
+
return fail_invalid("resource identifier") if resource_identifier and (not valid_non_empty_string?(resource_identifier))
|
74
|
+
return fail("Invalid request", build_result(false, "Invalid request", @idm)) if requested and (not requested.is_a?(Hash))
|
75
|
+
return fail_invalid("requestor identifier") if requestor_identifier and (not valid_non_empty_string?(requestor_identifier))
|
76
|
+
return fail_invalid("subject identifier") if subject_identifier and (not valid_non_empty_string?(subject_identifier))
|
75
77
|
|
76
78
|
subject_roles = []
|
77
79
|
attributes = {}
|
data/lib/soar_pl/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: soar_pl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ernst van Graan
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|