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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5a9e34dc1df2bb40e0f13192092404a898b78dab
4
- data.tar.gz: cd650e7a3d48f056b7a6c36c840567755a005682
3
+ metadata.gz: a33dc515b79a055e58c4cd8322db826b7e8ea527
4
+ data.tar.gz: b8efb7557335ff3438c1c3ac61a434c397743ad1
5
5
  SHA512:
6
- metadata.gz: 99a59a59df06ec46707fbb5b372266cc4eb3384faaa4a08eb1020d0da9b7ee7eb00eb19ebf32af1f45724bdf8dbb79ca87f31f6fc341a117e8954e4f04ddce38
7
- data.tar.gz: 4b96154a76d95a9b97f236b0674af44d34a5d96ec20efa976e537dabe96dcbf670a74ca875bbf460152c4dc4968dde375817a3b7e3ff41f923123b6fe979508d
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
- requested = request
66
- begin
67
- requested = JSON.parse(request) if not request.is_a?(Hash)
68
- rescue => ex
69
- return fail("Invalid request", build_result(false, "Invalid request", @idm))
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 = {}
@@ -1,3 +1,3 @@
1
1
  module SoarPl
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
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
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-15 00:00:00.000000000 Z
11
+ date: 2016-02-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler