soar_authentication_cas 0.1.1 → 0.1.2

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: 6402b4c666243cf12959e8b44a4dc85a47c8a13e
4
- data.tar.gz: a6c589239fc9e1a0054b75b812eb3d65fcf3e49e
3
+ metadata.gz: 3d951baeb388a267c103ffef21c0cb97ab807c63
4
+ data.tar.gz: e35f217f36236976dc51fa7e5da6e667f1b57623
5
5
  SHA512:
6
- metadata.gz: 9338f6c74b103043993bb48308de8298ed8938c2f48c76726125f674e0bb24da617c543b8f28608d537b0b8b3d9d1539cfdb2b07cf24a810669cefd15ae640de
7
- data.tar.gz: 875bd250ace2d992804046dab6bb7a21504dbe0d7b8290bb86adf17e1158ceae1a4c7db390a5f4e8c8f52533af41db3db78d3083cd92ab1ebfd892193ab9aece
6
+ metadata.gz: 72717e938d3e85f15dce11ea95937520c84fc91f57b6e69344f7d2a7806ab05aa7102809c61abd306cc74726f7e89bfe3b7838d889721fba0fb59cfaacf7f73e
7
+ data.tar.gz: 6d26bf1eae54bf4a41b4dcdb91a1f5ed28b4729e8e7228b18fd7e1c77dc917238f844f650e6c15828a266ca90030b0f8a6252d4823d64fb0991ebd1022d0c3dd
@@ -8,10 +8,24 @@ module SoarAuthenticationCas
8
8
 
9
9
  def self.configure(environment)
10
10
  return nil if environment.nil? or environment['RACK_ENV'].nil?
11
+ self.validate(environment)
11
12
  signon_prefix = cas_servers(environment)[environment['RACK_ENV']]
12
13
  are_we_in_development = ( environment['RACK_ENV'] == 'development' )
13
14
  { :prefix => signon_prefix,
14
15
  :browsers_only => are_we_in_development,
15
16
  :ignore_certificate => are_we_in_development }
16
17
  end
18
+
19
+ private
20
+
21
+ def self.validate(environment)
22
+ errors = []
23
+ errors << 'invalid authentication provider uri' if not environment['CAS_SERVER'] =~ URI::regexp
24
+ self.abort_on_validation_failures(errors) if not errors.empty?
25
+ end
26
+
27
+ def self.abort_on_validation_failures(errors)
28
+ errors << 'Failure initializing authentication provider' if not errors.empty?
29
+ raise URI::InvalidURIError.new(errors) if not errors.empty?
30
+ end
17
31
  end
@@ -1,3 +1,3 @@
1
1
  module SoarAuthenticationCas
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soar_authentication_cas
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
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-08-15 00:00:00.000000000 Z
11
+ date: 2016-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler