Commit 18642340 authored by Alex Kalderimis's avatar Alex Kalderimis

Merge branch '350552-add-external-audit-event-destination-graphql-specs' into 'master'

Add specs for ExternalAuditEventDestinationType

See merge request gitlab-org/gitlab!79316
parents 51d5dd88 d7f3b4d4
# frozen_string_literal: true
module EE
module Types
module AuditEvents
class ExternalAuditEventDestinationType < ::Types::BaseObject
graphql_name 'ExternalAuditEventDestination'
description 'Represents an external resource to send audit events to'
field :id, GraphQL::Types::ID,
null: false,
description: 'ID of the destination.'
field :destination_url, GraphQL::Types::String,
null: false,
description: 'External destination to send audit events to.'
field :group, ::Types::GroupType,
null: false,
description: 'Group the destination belongs to.'
field :verification_token, GraphQL::Types::String,
null: false,
description: 'Verification token to validate source of event.'
end
end
end
end
......@@ -94,7 +94,7 @@ module EE
description: "Group's DORA metrics."
field :external_audit_event_destinations,
EE::Types::AuditEvents::ExternalAuditEventDestinationType.connection_type,
::Types::AuditEvents::ExternalAuditEventDestinationType.connection_type,
null: true,
description: 'External locations that receive audit events belonging to the group.',
authorize: :admin_external_audit_events
......
......@@ -16,7 +16,7 @@ module Mutations
required: true,
description: 'Group path.'
field :external_audit_event_destination, EE::Types::AuditEvents::ExternalAuditEventDestinationType,
field :external_audit_event_destination, ::Types::AuditEvents::ExternalAuditEventDestinationType,
null: true,
description: 'Destination created.'
......
......@@ -16,7 +16,7 @@ module Mutations
required: false,
description: 'Destination URL to change.'
field :external_audit_event_destination, EE::Types::AuditEvents::ExternalAuditEventDestinationType,
field :external_audit_event_destination, ::Types::AuditEvents::ExternalAuditEventDestinationType,
null: true,
description: 'Updated destination.'
......
# frozen_string_literal: true
module Types
module AuditEvents
class ExternalAuditEventDestinationType < ::Types::BaseObject
graphql_name 'ExternalAuditEventDestination'
description 'Represents an external resource to send audit events to'
authorize :admin_external_audit_events
field :id, GraphQL::Types::ID,
null: false,
description: 'ID of the destination.'
field :destination_url, GraphQL::Types::String,
null: false,
description: 'External destination to send audit events to.'
field :group, ::Types::GroupType,
null: false,
description: 'Group the destination belongs to.'
field :verification_token, GraphQL::Types::String,
null: false,
description: 'Verification token to validate source of event.'
end
end
end
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe GitlabSchema.types['ExternalAuditEventDestination'] do
let(:fields) do
%i[id destination_url group verification_token]
end
specify { expect(described_class.graphql_name).to eq('ExternalAuditEventDestination') }
specify { expect(described_class).to have_graphql_fields(fields) }
specify { expect(described_class).to require_graphql_authorizations(:admin_external_audit_events) }
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment