osso 0.0.3.3 → 0.0.3.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.buildkite/pipeline.yml +4 -1
- data/.gitignore +1 -1
- data/.rubocop.yml +1 -2
- data/Gemfile.lock +3 -1
- data/bin/console +4 -3
- data/config/database.yml +2 -2
- data/{lib/osso/db → db}/schema.rb +7 -15
- data/lib/osso.rb +2 -0
- data/lib/osso/db/migrate/20200328143305_create_identity_providers.rb +12 -0
- data/lib/osso/db/migrate/20200411184535_add_provider_id_to_users.rb +2 -2
- data/lib/osso/db/migrate/20200411192645_create_enterprise_accounts.rb +1 -1
- data/lib/osso/db/migrate/20200502135008_add_oauth_client_id_to_enterprise_accounts_and_identity_providers.rb +6 -0
- data/lib/osso/db/migrate/20200714223226_add_identity_provider_service_enum.rb +17 -0
- data/lib/osso/db/migrate/20200715154211_rename_idp_fields_on_identity_provider_to_sso.rb +6 -0
- data/lib/osso/db/migrate/20200715205801_add_name_to_enterprise_account.rb +5 -0
- data/lib/osso/db/migrate/20200722230116_add_identity_provider_status_enum_and_use_on_identity_providers.rb +15 -0
- data/lib/osso/graphql/mutation.rb +16 -0
- data/lib/osso/graphql/mutations.rb +12 -0
- data/lib/osso/graphql/mutations/base_mutation.rb +41 -0
- data/lib/osso/graphql/mutations/configure_identity_provider.rb +36 -0
- data/lib/osso/graphql/mutations/create_enterprise_account.rb +25 -0
- data/lib/osso/graphql/mutations/create_identity_provider.rb +30 -0
- data/lib/osso/graphql/mutations/set_identity_provider.rb +27 -0
- data/lib/osso/graphql/query.rb +25 -0
- data/lib/osso/graphql/resolvers.rb +12 -0
- data/lib/osso/graphql/resolvers/enterprise_account.rb +25 -0
- data/lib/osso/graphql/resolvers/enterprise_accounts.rb +17 -0
- data/lib/osso/graphql/resolvers/oauth_clients.rb +15 -0
- data/lib/osso/graphql/schema.rb +46 -0
- data/lib/osso/graphql/types.rb +16 -0
- data/lib/osso/graphql/types/base_enum.rb +10 -0
- data/lib/osso/graphql/types/base_input_object.rb +10 -0
- data/lib/osso/graphql/types/base_object.rb +12 -0
- data/lib/osso/graphql/types/enterprise_account.rb +33 -0
- data/lib/osso/graphql/types/identity_provider.rb +33 -0
- data/lib/osso/graphql/types/identity_provider_service.rb +12 -0
- data/lib/osso/graphql/types/identity_provider_status.rb +14 -0
- data/lib/osso/graphql/types/oauth_client.rb +20 -0
- data/lib/osso/graphql/types/user.rb +17 -0
- data/lib/osso/helpers/auth.rb +53 -49
- data/lib/osso/helpers/helpers.rb +3 -1
- data/lib/osso/lib/app_config.rb +1 -1
- data/lib/osso/lib/route_map.rb +28 -0
- data/lib/osso/models/enterprise_account.rb +4 -4
- data/lib/osso/models/identity_provider.rb +56 -0
- data/lib/osso/models/models.rb +1 -1
- data/lib/osso/models/oauth_client.rb +2 -2
- data/lib/osso/models/saml_provider.rb +13 -16
- data/lib/osso/models/saml_providers/azure_saml_provider.rb +2 -2
- data/lib/osso/models/saml_providers/okta_saml_provider.rb +1 -1
- data/lib/osso/models/user.rb +3 -3
- data/lib/osso/routes/admin.rb +18 -19
- data/lib/osso/routes/auth.rb +30 -27
- data/lib/osso/routes/oauth.rb +50 -44
- data/lib/osso/version.rb +1 -1
- data/osso-rb.gemspec +3 -3
- data/spec/factories/enterprise_account.rb +5 -4
- data/spec/factories/identity_providers.rb +49 -0
- data/spec/factories/user.rb +1 -1
- data/spec/graphql/mutations/configure_identity_provider_spec.rb +75 -0
- data/spec/graphql/mutations/create_enterprise_account_spec.rb +68 -0
- data/spec/graphql/mutations/create_identity_provider_spec.rb +104 -0
- data/spec/graphql/query/enterprise_account_spec.rb +68 -0
- data/spec/graphql/query/enterprise_accounts_spec.rb +44 -0
- data/spec/graphql/query/identity_provider_spec.rb +65 -0
- data/spec/graphql/query/oauth_clients_account_spec.rb +48 -0
- data/spec/models/azure_saml_provider_spec.rb +14 -14
- data/spec/models/identity_provider_spec.rb +17 -0
- data/spec/models/okta_saml_provider_spec.rb +15 -15
- data/spec/routes/admin_spec.rb +3 -0
- data/spec/routes/auth_spec.rb +9 -9
- data/spec/routes/oauth_spec.rb +1 -1
- data/spec/spec_helper.rb +8 -5
- data/spec/support/spec_app.rb +9 -0
- data/spec/support/views/admin.erb +5 -0
- metadata +60 -12
- data/lib/osso/db/migrate/20200411144528_create_saml_providers.rb +0 -13
- data/lib/osso/db/migrate/20200413153029_add_oauth_client_reference_to_saml_providers.rb +0 -5
- data/lib/osso/db/migrate/20200501203026_drop_null_constraints_from_saml_provider.rb +0 -7
- data/lib/osso/db/migrate/20200501204047_drop_acs_url.rb +0 -5
- data/lib/osso/db/migrate/20200502135008_add_oauth_client_id_to_enterprise_account.rb +0 -5
- data/lib/osso/db/migrate/20200601131227_drop_null_constraint_from_saml_providers_provider.rb +0 -7
- data/spec/factories/saml_providers.rb +0 -46
- data/spec/models/saml_provider_spec.rb +0 -31
- data/spec/support/vcr_cassettes/okta_saml_callback.yml +0 -59
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/.buildkite/pipeline.yml
CHANGED
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
osso (0.0.3.
|
4
|
+
osso (0.0.3.8)
|
5
5
|
activesupport (>= 6.0.3.2)
|
6
|
+
graphql
|
6
7
|
jwt
|
7
8
|
omniauth-multi-provider
|
8
9
|
omniauth-saml
|
@@ -48,6 +49,7 @@ GEM
|
|
48
49
|
activesupport (>= 5.0.0)
|
49
50
|
faker (2.13.0)
|
50
51
|
i18n (>= 1.6, < 2)
|
52
|
+
graphql (1.11.1)
|
51
53
|
hashdiff (1.0.1)
|
52
54
|
hashie (4.1.0)
|
53
55
|
httpclient (2.8.3)
|
data/bin/console
CHANGED
data/config/database.yml
CHANGED
@@ -2,13 +2,13 @@ development:
|
|
2
2
|
adapter: postgresql
|
3
3
|
encoding: unicode
|
4
4
|
pool: 5
|
5
|
-
database:
|
5
|
+
database: ossorb-development
|
6
6
|
host: ''
|
7
7
|
port: 5432
|
8
8
|
test:
|
9
9
|
adapter: postgresql
|
10
10
|
encoding: unicode
|
11
11
|
pool: 5
|
12
|
-
database:
|
12
|
+
database: ossorb-test
|
13
13
|
host: ''
|
14
14
|
port: 5432
|
@@ -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"
|
@@ -46,10 +46,14 @@ ActiveRecord::Schema.define(version: 2020_05_02_135008) do
|
|
46
46
|
t.integer "external_int_id"
|
47
47
|
t.string "external_id"
|
48
48
|
t.uuid "oauth_client_id"
|
49
|
+
t.string "name", null: false
|
49
50
|
t.index ["domain"], name: "index_enterprise_accounts_on_domain", unique: true
|
50
51
|
t.index ["oauth_client_id"], name: "index_enterprise_accounts_on_oauth_client_id"
|
51
52
|
end
|
52
53
|
|
54
|
+
# Could not dump table "identity_providers" because of following StandardError
|
55
|
+
# Unknown type 'identity_provider_status' for column 'status'
|
56
|
+
|
53
57
|
create_table "oauth_access_grants", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
|
54
58
|
t.uuid "resource_owner_id", null: false
|
55
59
|
t.uuid "application_id", null: false
|
@@ -103,22 +107,10 @@ ActiveRecord::Schema.define(version: 2020_05_02_135008) do
|
|
103
107
|
t.index ["uri", "primary"], name: "index_redirect_uris_on_uri_and_primary", unique: true
|
104
108
|
end
|
105
109
|
|
106
|
-
create_table "saml_providers", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
|
107
|
-
t.string "provider", null: false
|
108
|
-
t.string "domain", null: false
|
109
|
-
t.string "idp_sso_target_url"
|
110
|
-
t.text "idp_cert"
|
111
|
-
t.uuid "enterprise_account_id"
|
112
|
-
t.uuid "oauth_client_id"
|
113
|
-
t.index ["domain", "provider"], name: "index_saml_providers_on_domain_and_provider", unique: true
|
114
|
-
t.index ["enterprise_account_id"], name: "index_saml_providers_on_enterprise_account_id"
|
115
|
-
t.index ["oauth_client_id"], name: "index_saml_providers_on_oauth_client_id"
|
116
|
-
end
|
117
|
-
|
118
110
|
create_table "users", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
|
119
111
|
t.string "email", null: false
|
120
112
|
t.string "idp_id", null: false
|
121
|
-
t.uuid "
|
113
|
+
t.uuid "identity_provider_id"
|
122
114
|
t.uuid "enterprise_account_id"
|
123
115
|
t.index ["email", "idp_id"], name: "index_users_on_email_and_idp_id", unique: true
|
124
116
|
t.index ["enterprise_account_id"], name: "index_users_on_enterprise_account_id"
|
@@ -128,5 +120,5 @@ ActiveRecord::Schema.define(version: 2020_05_02_135008) do
|
|
128
120
|
add_foreign_key "oauth_access_grants", "users", column: "resource_owner_id"
|
129
121
|
add_foreign_key "oauth_access_tokens", "oauth_applications", column: "application_id"
|
130
122
|
add_foreign_key "oauth_access_tokens", "users", column: "resource_owner_id"
|
131
|
-
add_foreign_key "users", "
|
123
|
+
add_foreign_key "users", "identity_providers"
|
132
124
|
end
|
data/lib/osso.rb
CHANGED
@@ -4,6 +4,8 @@ module Osso
|
|
4
4
|
require_relative 'osso/helpers/helpers'
|
5
5
|
require_relative 'osso/lib/app_config'
|
6
6
|
require_relative 'osso/lib/oauth2_token'
|
7
|
+
require_relative 'osso/lib/route_map'
|
7
8
|
require_relative 'osso/models/models'
|
8
9
|
require_relative 'osso/routes/routes'
|
10
|
+
require_relative 'osso/graphql/schema'
|
9
11
|
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
class CreateIdentityProviders < ActiveRecord::Migration[6.0]
|
2
|
+
def change
|
3
|
+
create_table :identity_providers, id: :uuid do |t|
|
4
|
+
t.string :service
|
5
|
+
t.string :domain, null: false
|
6
|
+
t.string :idp_sso_target_url
|
7
|
+
t.text :idp_cert
|
8
|
+
end
|
9
|
+
|
10
|
+
add_index :identity_providers, :domain
|
11
|
+
end
|
12
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
class AddProviderIdToUsers < ActiveRecord::Migration[6.0]
|
2
2
|
def change
|
3
|
-
add_column :users, :
|
3
|
+
add_column :users, :identity_provider_id, :uuid
|
4
4
|
|
5
|
-
add_foreign_key :users, :
|
5
|
+
add_foreign_key :users, :identity_providers
|
6
6
|
end
|
7
7
|
end
|
@@ -9,7 +9,7 @@ class CreateEnterpriseAccounts < ActiveRecord::Migration[6.0]
|
|
9
9
|
|
10
10
|
add_index :enterprise_accounts, :domain, unique: true
|
11
11
|
|
12
|
-
add_reference :
|
12
|
+
add_reference :identity_providers, :enterprise_account, type: :uuid, index: true
|
13
13
|
add_reference :users, :enterprise_account, type: :uuid, index: true
|
14
14
|
end
|
15
15
|
end
|
@@ -0,0 +1,6 @@
|
|
1
|
+
class AddOauthClientIdToEnterpriseAccountsAndIdentityProviders < ActiveRecord::Migration[6.0]
|
2
|
+
def change
|
3
|
+
add_reference :enterprise_accounts, :oauth_client, type: :uuid, index: true
|
4
|
+
add_reference :identity_providers, :oauth_client, type: :uuid, index: true
|
5
|
+
end
|
6
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class AddIdentityProviderServiceEnum < ActiveRecord::Migration[6.0]
|
2
|
+
def change
|
3
|
+
def up
|
4
|
+
execute <<-SQL
|
5
|
+
CREATE TYPE identity_provider_service AS ENUM ('OKTA', 'AZURE');
|
6
|
+
SQL
|
7
|
+
change_column :identity_providers, :service, :identity_provider_service
|
8
|
+
end
|
9
|
+
|
10
|
+
def down
|
11
|
+
chnage_column :identity_providers, :service, :text
|
12
|
+
execute <<-SQL
|
13
|
+
DROP TYPE identity_provider_service;
|
14
|
+
SQL
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -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
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'mutations'
|
4
|
+
|
5
|
+
module Osso
|
6
|
+
module GraphQL
|
7
|
+
module Types
|
8
|
+
class MutationType < BaseObject
|
9
|
+
field :configure_identity_provider, mutation: Mutations::ConfigureIdentityProvider, null: true
|
10
|
+
field :create_identity_provider, mutation: Mutations::CreateIdentityProvider
|
11
|
+
field :create_enterprise_account, mutation: Mutations::CreateEnterpriseAccount
|
12
|
+
field :set_identity_provider, mutation: Mutations::SetSamlProvider
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Osso
|
4
|
+
module Mutations
|
5
|
+
end
|
6
|
+
end
|
7
|
+
|
8
|
+
require_relative 'mutations/base_mutation'
|
9
|
+
require_relative 'mutations/configure_identity_provider'
|
10
|
+
require_relative 'mutations/create_identity_provider'
|
11
|
+
require_relative 'mutations/create_enterprise_account'
|
12
|
+
require_relative 'mutations/set_identity_provider'
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Osso
|
4
|
+
module GraphQL
|
5
|
+
module Mutations
|
6
|
+
class BaseMutation < ::GraphQL::Schema::RelayClassicMutation
|
7
|
+
object_class Types::BaseObject
|
8
|
+
input_object_class Types::BaseInputObject
|
9
|
+
|
10
|
+
def response_data(data)
|
11
|
+
data.merge(errors: [])
|
12
|
+
end
|
13
|
+
|
14
|
+
def response_error(error)
|
15
|
+
error.merge(data: nil)
|
16
|
+
end
|
17
|
+
|
18
|
+
def ready?(enterprise_account_id: nil, domain: nil, identity_provider_id: nil, **args)
|
19
|
+
return true if context[:scope] == :admin
|
20
|
+
|
21
|
+
domain ||= account_domain(enterprise_account_id) || provider_domain(identity_provider_id)
|
22
|
+
return true if domain == context[:scope]
|
23
|
+
|
24
|
+
raise ::GraphQL::ExecutionError, "This user lacks the scope to mutate records belonging to #{args[:domain]}"
|
25
|
+
end
|
26
|
+
|
27
|
+
def account_domain(id)
|
28
|
+
return false unless id
|
29
|
+
|
30
|
+
Osso::Models::EnterpriseAccount.find(id)&.domain
|
31
|
+
end
|
32
|
+
|
33
|
+
def provider_domain(id)
|
34
|
+
return false unless id
|
35
|
+
|
36
|
+
Osso::Models::IdentityProvider.find(id)&.domain
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Osso
|
4
|
+
module GraphQL
|
5
|
+
module Mutations
|
6
|
+
class ConfigureIdentityProvider < BaseMutation
|
7
|
+
null false
|
8
|
+
argument :id, ID, required: true
|
9
|
+
argument :service, Types::IdentityProviderService, required: false
|
10
|
+
argument :sso_url, String, required: false
|
11
|
+
argument :sso_cert, String, required: false
|
12
|
+
|
13
|
+
field :identity_provider, Types::IdentityProvider, null: false
|
14
|
+
field :errors, [String], null: false
|
15
|
+
|
16
|
+
def resolve(id:, **args)
|
17
|
+
provider = Osso::Models::IdentityProvider.find(id)
|
18
|
+
|
19
|
+
return response_data(identity_provider: provider) if provider.update(args)
|
20
|
+
|
21
|
+
response_error(errors: provder.errors.messages)
|
22
|
+
end
|
23
|
+
|
24
|
+
def ready?(id:, **args)
|
25
|
+
return true if context[:scope] == :admin
|
26
|
+
|
27
|
+
domain = Osso::Models::IdentityProvider.find(id)&.domain
|
28
|
+
|
29
|
+
return true if domain == context[:scope]
|
30
|
+
|
31
|
+
raise ::GraphQL::ExecutionError, "This user lacks the scope to mutate records belonging to #{domain}"
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Osso
|
4
|
+
module GraphQL
|
5
|
+
module Mutations
|
6
|
+
class CreateEnterpriseAccount < BaseMutation
|
7
|
+
null false
|
8
|
+
|
9
|
+
argument :domain, String, required: true
|
10
|
+
argument :name, String, required: true
|
11
|
+
|
12
|
+
field :enterprise_account, Types::EnterpriseAccount, null: false
|
13
|
+
field :errors, [String], null: false
|
14
|
+
|
15
|
+
def resolve(**args)
|
16
|
+
enterprise_account = Osso::Models::EnterpriseAccount.new(args)
|
17
|
+
|
18
|
+
return response_data(enterprise_account: enterprise_account) if enterprise_account.save
|
19
|
+
|
20
|
+
response_error(errors: enterprise_account.errors.full_messages)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Osso
|
4
|
+
module GraphQL
|
5
|
+
module Mutations
|
6
|
+
class CreateIdentityProvider < BaseMutation
|
7
|
+
null false
|
8
|
+
|
9
|
+
argument :enterprise_account_id, ID, required: true
|
10
|
+
argument :service, Types::IdentityProviderService, required: false
|
11
|
+
|
12
|
+
field :identity_provider, Types::IdentityProvider, null: false
|
13
|
+
field :errors, [String], null: false
|
14
|
+
|
15
|
+
def resolve(enterprise_account_id:, service: nil)
|
16
|
+
enterprise_account = Osso::Models::EnterpriseAccount.find(enterprise_account_id)
|
17
|
+
identity_provider = enterprise_account.identity_providers.build(
|
18
|
+
enterprise_account_id: enterprise_account_id,
|
19
|
+
service: service,
|
20
|
+
domain: enterprise_account.domain,
|
21
|
+
)
|
22
|
+
|
23
|
+
return response_data(identity_provider: identity_provider) if identity_provider.save
|
24
|
+
|
25
|
+
response_error(errors: identity_provider.errors.full_messages)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Osso
|
4
|
+
module GraphQL
|
5
|
+
module Mutations
|
6
|
+
class SetSamlProvider < BaseMutation
|
7
|
+
null false
|
8
|
+
|
9
|
+
argument :provider, Types::IdentityProviderService, required: true
|
10
|
+
argument :id, ID, required: true
|
11
|
+
|
12
|
+
field :identity_provider, Types::IdentityProvider, null: false
|
13
|
+
field :errors, [String], null: false
|
14
|
+
|
15
|
+
def resolve(provider:, id:)
|
16
|
+
identity_provider = Osso::Models::IdentityProvider.find(id)
|
17
|
+
identity_provider.service = provider
|
18
|
+
identity_provider.save!
|
19
|
+
{
|
20
|
+
identity_provider: identity_provider,
|
21
|
+
errors: [],
|
22
|
+
}
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Osso
|
4
|
+
module GraphQL
|
5
|
+
module Types
|
6
|
+
class QueryType < ::GraphQL::Schema::Object
|
7
|
+
field :enterprise_accounts, null: true, resolver: Resolvers::EnterpriseAccounts
|
8
|
+
field :oauth_clients, null: true, resolver: Resolvers::OAuthClients
|
9
|
+
|
10
|
+
field :enterprise_account, null: true, resolver: Resolvers::EnterpriseAccount do
|
11
|
+
argument :domain, String, required: true
|
12
|
+
end
|
13
|
+
|
14
|
+
field(
|
15
|
+
:identity_provider,
|
16
|
+
Types::IdentityProvider,
|
17
|
+
null: true,
|
18
|
+
resolve: ->(_obj, args, _context) { Osso::Models::IdentityProvider.find(args[:id]) },
|
19
|
+
) do
|
20
|
+
argument :id, ID, required: true
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|