osso 0.0.3.20 → 0.0.3.25

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
  SHA256:
3
- metadata.gz: 1dc22e6537d35ba1c6a42ba2c329aa4fdd3d311b07734bc40e708048599aec6b
4
- data.tar.gz: 0bcad162c393cc2f37087ecdf68f22df760d78e669af60e4fdd23ece1fd4778c
3
+ metadata.gz: 5929e7b3d9c9151162c5fcbf9f4e5986482c11c6a0daf6437948a3653d9bee8e
4
+ data.tar.gz: edc5f42f4a657afa5131cf08d722d9b8e3eddf2763d79f3156d81184f7273c45
5
5
  SHA512:
6
- metadata.gz: 5a0b1a2444ab27bcf9b47afe8bcfac939a3e574bda9c423ffb02b1d657d9c737291adac011a2a4b3d003676932d81b2c4c11931302eb92b367dd6b1839ddc58b
7
- data.tar.gz: d3f1a44eb09376a2abd4dee264a2efcf8bd57cd28d24854d32e578fbb85baf0837014ae54fe4cd4c5586718c51804a5923635df6cb1a384fe7a153c4546d0051
6
+ metadata.gz: 4fe47c5b3f22256aed4f12780db5337303c1168b8e399fc32eaa68fabcb91b8373cf25578e5d96e0f6bc58709575f471f1a7ade871c48a20dfc485798f321630
7
+ data.tar.gz: d2aad38f2842dfc3b0dfccd65ff3de11f644481a5cdd7bbf469cc0c55f9ed85f55f4dc4b0c08fda2684fbd8a690ea9d5b10629368defa4825fc1e04a80621f3a
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- osso (0.0.3.20)
4
+ osso (0.0.3.25)
5
5
  activesupport (>= 6.0.3.2)
6
6
  graphql
7
7
  jwt
@@ -13,7 +13,7 @@ module Osso
13
13
 
14
14
  def resolve(id:)
15
15
  oauth_client = Osso::Models::OauthClient.find(id)
16
- oauth_client.generate_secrets
16
+ oauth_client.regenerate_secrets!
17
17
 
18
18
  return response_data(oauth_client: oauth_client) if oauth_client.save
19
19
 
@@ -12,10 +12,6 @@ module Osso
12
12
 
13
13
  def name
14
14
  service.titlecase
15
- # raise(
16
- # NoMethodError,
17
- # '#name must be defined on each provider specific subclass',
18
- # )
19
15
  end
20
16
 
21
17
  def saml_options
@@ -29,7 +25,7 @@ module Osso
29
25
 
30
26
  def assertion_consumer_service_url
31
27
  [
32
- ENV.fetch('BASE_URL'),
28
+ root_url,
33
29
  'auth',
34
30
  'saml',
35
31
  id,
@@ -44,6 +40,12 @@ module Osso
44
40
 
45
41
  self.status = 'CONFIGURED' if sso_url && sso_cert
46
42
  end
43
+
44
+ def root_url
45
+ return "https://#{ENV['HEROKU_APP_NAME']}.herokuapp.com" if ENV['HEROKU_APP_NAME']
46
+
47
+ ENV.fetch('BASE_URL')
48
+ end
47
49
  end
48
50
  end
49
51
  end
@@ -26,6 +26,11 @@ module Osso
26
26
  self.identifier ||= SecureRandom.hex(16)
27
27
  self.secret ||= SecureRandom.hex(32)
28
28
  end
29
+
30
+ def regenerate_secrets!
31
+ self.identifier = SecureRandom.hex(16)
32
+ self.secret = SecureRandom.hex(32)
33
+ end
29
34
  end
30
35
  end
31
36
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Osso
4
- VERSION = '0.0.3.20'
4
+ VERSION = '0.0.3.25'
5
5
  end
@@ -6,13 +6,21 @@ describe Osso::Models::IdentityProvider do
6
6
  subject { create(:okta_identity_provider) }
7
7
 
8
8
  describe '#assertion_consumer_service_url' do
9
- it 'returns the expected URI' do
9
+ it 'returns the expected URI for BASE_URL' do
10
10
  ENV['BASE_URL'] = 'https://example.com'
11
11
 
12
12
  expect(subject.assertion_consumer_service_url).to eq(
13
13
  "https://example.com/auth/saml/#{subject.id}/callback",
14
14
  )
15
15
  end
16
+
17
+ it 'returns the expected URI for HEROKU_APP_NAME' do
18
+ ENV['HEROKU_APP_NAME'] = 'test'
19
+
20
+ expect(subject.assertion_consumer_service_url).to eq(
21
+ "https://test.herokuapp.com/auth/saml/#{subject.id}/callback",
22
+ )
23
+ end
16
24
  end
17
25
 
18
26
  describe '#saml_options' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: osso
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3.20
4
+ version: 0.0.3.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Bauch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-27 00:00:00.000000000 Z
11
+ date: 2020-08-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport