osso 0.0.3.7 → 0.0.3.8
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/Gemfile.lock +1 -1
- data/db/schema.rb +3 -12
- data/lib/osso/db/migrate/20200714223226_add_identity_provider_service_enum.rb +1 -1
- data/lib/osso/db/migrate/20200722230116_add_identity_provider_status_enum_and_use_on_identity_providers.rb +15 -0
- data/lib/osso/graphql/types.rb +1 -0
- data/lib/osso/graphql/types/identity_provider.rb +1 -5
- data/lib/osso/graphql/types/identity_provider_status.rb +14 -0
- data/lib/osso/models/identity_provider.rb +8 -0
- data/lib/osso/version.rb +1 -1
- data/spec/graphql/mutations/configure_identity_provider_spec.rb +3 -3
- data/spec/graphql/query/enterprise_account_spec.rb +1 -1
- data/spec/graphql/query/enterprise_accounts_spec.rb +1 -1
- data/spec/graphql/query/identity_provider_spec.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 73de8a2c5af9b7d62c94a5ed34c094455dc9b49b7345eb252308f7048e1164c0
|
4
|
+
data.tar.gz: c37913b5f3a857245d588ad03155ece0c5aca99c22c4c56069f50d442cb74db5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3047a07787aa764d105e77580846d60a943d4bd859baed5c861aebd8face6fb461342f3cccc01cc58e33d66310ba0d852185605fea09eb54d21c126aa149230c
|
7
|
+
data.tar.gz: f61b3e5aa31946a69512762601d08ecc021be26a56df0b182fc826d53e7be0836ea019c90ad09fc6b927dc3b37ee8efbc01e6145c0c4af4ff97198b9cd89828c
|
data/Gemfile.lock
CHANGED
data/db/schema.rb
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
#
|
11
11
|
# It's strongly recommended that you check this file into your version control system.
|
12
12
|
|
13
|
-
ActiveRecord::Schema.define(version:
|
13
|
+
ActiveRecord::Schema.define(version: 2020_07_22_230116) do
|
14
14
|
|
15
15
|
# These are extensions that must be enabled in order to support this database
|
16
16
|
enable_extension "pgcrypto"
|
@@ -51,17 +51,8 @@ ActiveRecord::Schema.define(version: 2020_07_15_205801) do
|
|
51
51
|
t.index ["oauth_client_id"], name: "index_enterprise_accounts_on_oauth_client_id"
|
52
52
|
end
|
53
53
|
|
54
|
-
|
55
|
-
|
56
|
-
t.string "domain", null: false
|
57
|
-
t.string "sso_url"
|
58
|
-
t.text "sso_cert"
|
59
|
-
t.uuid "enterprise_account_id"
|
60
|
-
t.uuid "oauth_client_id"
|
61
|
-
t.index ["domain"], name: "index_identity_providers_on_domain"
|
62
|
-
t.index ["enterprise_account_id"], name: "index_identity_providers_on_enterprise_account_id"
|
63
|
-
t.index ["oauth_client_id"], name: "index_identity_providers_on_oauth_client_id"
|
64
|
-
end
|
54
|
+
# Could not dump table "identity_providers" because of following StandardError
|
55
|
+
# Unknown type 'identity_provider_status' for column 'status'
|
65
56
|
|
66
57
|
create_table "oauth_access_grants", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
|
67
58
|
t.uuid "resource_owner_id", null: false
|
@@ -4,7 +4,7 @@ class AddIdentityProviderServiceEnum < ActiveRecord::Migration[6.0]
|
|
4
4
|
execute <<-SQL
|
5
5
|
CREATE TYPE identity_provider_service AS ENUM ('OKTA', 'AZURE');
|
6
6
|
SQL
|
7
|
-
|
7
|
+
change_column :identity_providers, :service, :identity_provider_service
|
8
8
|
end
|
9
9
|
|
10
10
|
def down
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class AddIdentityProviderStatusEnumAndUseOnIdentityProviders < ActiveRecord::Migration[6.0]
|
2
|
+
def up
|
3
|
+
execute <<~SQL
|
4
|
+
CREATE TYPE identity_provider_status AS ENUM ('PENDING', 'CONFIGURED', 'ACTIVE', 'ERROR');
|
5
|
+
SQL
|
6
|
+
add_column :identity_providers, :status, :identity_provider_status, default: 'PENDING'
|
7
|
+
end
|
8
|
+
|
9
|
+
def down
|
10
|
+
remove_column :identity_providers, :status
|
11
|
+
execute <<~SQL
|
12
|
+
DROP TYPE identity_provider_status;
|
13
|
+
SQL
|
14
|
+
end
|
15
|
+
end
|
data/lib/osso/graphql/types.rb
CHANGED
@@ -9,6 +9,7 @@ require_relative 'types/base_object'
|
|
9
9
|
require_relative 'types/base_enum'
|
10
10
|
require_relative 'types/base_input_object'
|
11
11
|
require_relative 'types/identity_provider_service'
|
12
|
+
require_relative 'types/identity_provider_status'
|
12
13
|
require_relative 'types/identity_provider'
|
13
14
|
require_relative 'types/enterprise_account'
|
14
15
|
require_relative 'types/oauth_client'
|
@@ -17,13 +17,9 @@ module Osso
|
|
17
17
|
field :acs_url, String, null: false
|
18
18
|
field :sso_url, String, null: true
|
19
19
|
field :sso_cert, String, null: true
|
20
|
-
field :
|
20
|
+
field :status, Types::IdentityProviderStatus, null: false
|
21
21
|
field :documentation_pdf_url, String, null: true
|
22
22
|
|
23
|
-
def configured
|
24
|
-
!!(@object.sso_url && @object.sso_cert)
|
25
|
-
end
|
26
|
-
|
27
23
|
def documentation_pdf_url
|
28
24
|
ENV['BASE_URL'] + '/identity_provider/documentation/' + @object.id
|
29
25
|
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Osso
|
4
|
+
module GraphQL
|
5
|
+
module Types
|
6
|
+
class IdentityProviderStatus < BaseEnum
|
7
|
+
value('Pending', value: 'PENDING')
|
8
|
+
value('Configured', value: 'CONFIGURED')
|
9
|
+
value('Active', value: 'ACTIVE')
|
10
|
+
value('Error', value: 'ERROR')
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -8,6 +8,8 @@ module Osso
|
|
8
8
|
belongs_to :enterprise_account
|
9
9
|
belongs_to :oauth_client
|
10
10
|
has_many :users
|
11
|
+
before_save :set_status
|
12
|
+
|
11
13
|
|
12
14
|
def name
|
13
15
|
service.titlecase
|
@@ -43,6 +45,12 @@ module Osso
|
|
43
45
|
end
|
44
46
|
|
45
47
|
alias acs_url assertion_consumer_service_url
|
48
|
+
|
49
|
+
def set_status
|
50
|
+
return if status != 'PENDING'
|
51
|
+
|
52
|
+
self.status = 'CONFIGURED' if sso_url && sso_cert
|
53
|
+
end
|
46
54
|
end
|
47
55
|
end
|
48
56
|
end
|
data/lib/osso/version.rb
CHANGED
@@ -23,7 +23,7 @@ describe Osso::GraphQL::Schema do
|
|
23
23
|
identityProvider {
|
24
24
|
id
|
25
25
|
domain
|
26
|
-
|
26
|
+
status
|
27
27
|
enterpriseAccountId
|
28
28
|
service
|
29
29
|
acsUrl
|
@@ -46,8 +46,8 @@ describe Osso::GraphQL::Schema do
|
|
46
46
|
describe 'for an admin user' do
|
47
47
|
let(:current_scope) { :admin }
|
48
48
|
it 'configures an identity provider' do
|
49
|
-
expect(subject.dig('data', 'configureIdentityProvider', 'identityProvider', '
|
50
|
-
to
|
49
|
+
expect(subject.dig('data', 'configureIdentityProvider', 'identityProvider', 'status')).
|
50
|
+
to eq('configured')
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
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.
|
4
|
+
version: 0.0.3.8
|
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-07-
|
11
|
+
date: 2020-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -250,6 +250,7 @@ files:
|
|
250
250
|
- lib/osso/db/migrate/20200714223226_add_identity_provider_service_enum.rb
|
251
251
|
- lib/osso/db/migrate/20200715154211_rename_idp_fields_on_identity_provider_to_sso.rb
|
252
252
|
- lib/osso/db/migrate/20200715205801_add_name_to_enterprise_account.rb
|
253
|
+
- lib/osso/db/migrate/20200722230116_add_identity_provider_status_enum_and_use_on_identity_providers.rb
|
253
254
|
- lib/osso/graphql/.DS_Store
|
254
255
|
- lib/osso/graphql/mutation.rb
|
255
256
|
- lib/osso/graphql/mutations.rb
|
@@ -271,6 +272,7 @@ files:
|
|
271
272
|
- lib/osso/graphql/types/enterprise_account.rb
|
272
273
|
- lib/osso/graphql/types/identity_provider.rb
|
273
274
|
- lib/osso/graphql/types/identity_provider_service.rb
|
275
|
+
- lib/osso/graphql/types/identity_provider_status.rb
|
274
276
|
- lib/osso/graphql/types/oauth_client.rb
|
275
277
|
- lib/osso/graphql/types/user.rb
|
276
278
|
- lib/osso/helpers/auth.rb
|