soar_authentication_cas 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/lib/soar_authentication_cas.rb +14 -0
- data/lib/soar_authentication_cas/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: 3d951baeb388a267c103ffef21c0cb97ab807c63
|
4
|
+
data.tar.gz: e35f217f36236976dc51fa7e5da6e667f1b57623
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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.
|
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-
|
11
|
+
date: 2016-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|