From 3a3194bbd54547b1919ea340ac20553d1b9c08e8 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Mon, 3 Nov 2025 09:28:35 +0000 Subject: [PATCH] Add copyright headers to webhook-related files (#29664). git-svn-id: https://svn.redmine.org/redmine/trunk@24113 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/webhooks_controller.rb | 17 +++++++++++++++++ app/jobs/webhook_job.rb | 17 +++++++++++++++++ app/models/webhook.rb | 17 +++++++++++++++++ app/models/webhook_payload.rb | 17 +++++++++++++++++ lib/webhook_endpoint_validator.rb | 17 +++++++++++++++++ test/functional/webhooks_controller_test.rb | 17 +++++++++++++++++ .../unit/lib/webhook_endpoint_validator_test.rb | 17 +++++++++++++++++ test/unit/webhook_payload_test.rb | 17 +++++++++++++++++ test/unit/webhook_test.rb | 17 +++++++++++++++++ 9 files changed, 153 insertions(+) diff --git a/app/controllers/webhooks_controller.rb b/app/controllers/webhooks_controller.rb index eb6e4b806..27b8d2ddd 100644 --- a/app/controllers/webhooks_controller.rb +++ b/app/controllers/webhooks_controller.rb @@ -1,5 +1,22 @@ # frozen_string_literal: true +# Redmine - project management software +# Copyright (C) 2006- Jean-Philippe Lang +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + class WebhooksController < ApplicationController self.main_menu = false diff --git a/app/jobs/webhook_job.rb b/app/jobs/webhook_job.rb index a3be1a4ce..df3635d50 100644 --- a/app/jobs/webhook_job.rb +++ b/app/jobs/webhook_job.rb @@ -1,5 +1,22 @@ # frozen_string_literal: true +# Redmine - project management software +# Copyright (C) 2006- Jean-Philippe Lang +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + class WebhookJob < ApplicationJob def perform(hook_id, payload_json) if hook = Webhook.find_by_id(hook_id) diff --git a/app/models/webhook.rb b/app/models/webhook.rb index 4b186e0c6..ea1c3aa9c 100644 --- a/app/models/webhook.rb +++ b/app/models/webhook.rb @@ -1,5 +1,22 @@ # frozen_string_literal: true +# Redmine - project management software +# Copyright (C) 2006- Jean-Philippe Lang +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + require 'rest-client' class Webhook < ApplicationRecord diff --git a/app/models/webhook_payload.rb b/app/models/webhook_payload.rb index fd0af9171..098f9a8a7 100644 --- a/app/models/webhook_payload.rb +++ b/app/models/webhook_payload.rb @@ -1,5 +1,22 @@ # frozen_string_literal: true +# Redmine - project management software +# Copyright (C) 2006- Jean-Philippe Lang +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + # Webhook payload class WebhookPayload attr_accessor :event, :object, :user diff --git a/lib/webhook_endpoint_validator.rb b/lib/webhook_endpoint_validator.rb index 860a0af6a..ba1c41220 100644 --- a/lib/webhook_endpoint_validator.rb +++ b/lib/webhook_endpoint_validator.rb @@ -1,5 +1,22 @@ # frozen_string_literal: true +# Redmine - project management software +# Copyright (C) 2006- Jean-Philippe Lang +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + require 'uri' class WebhookEndpointValidator < ActiveModel::EachValidator diff --git a/test/functional/webhooks_controller_test.rb b/test/functional/webhooks_controller_test.rb index 6507782a6..046be69ea 100644 --- a/test/functional/webhooks_controller_test.rb +++ b/test/functional/webhooks_controller_test.rb @@ -1,5 +1,22 @@ # frozen_string_literal: true +# Redmine - project management software +# Copyright (C) 2006- Jean-Philippe Lang +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + require_relative '../test_helper' class WebhooksControllerTest < Redmine::ControllerTest diff --git a/test/unit/lib/webhook_endpoint_validator_test.rb b/test/unit/lib/webhook_endpoint_validator_test.rb index d08914a80..d5317f214 100644 --- a/test/unit/lib/webhook_endpoint_validator_test.rb +++ b/test/unit/lib/webhook_endpoint_validator_test.rb @@ -1,5 +1,22 @@ # frozen_string_literal: true +# Redmine - project management software +# Copyright (C) 2006- Jean-Philippe Lang +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + require_relative '../../test_helper' class WebhookEndpointValidatorTest < ActiveSupport::TestCase diff --git a/test/unit/webhook_payload_test.rb b/test/unit/webhook_payload_test.rb index 5c1ebd928..3be4bdd88 100644 --- a/test/unit/webhook_payload_test.rb +++ b/test/unit/webhook_payload_test.rb @@ -1,5 +1,22 @@ # frozen_string_literal: true +# Redmine - project management software +# Copyright (C) 2006- Jean-Philippe Lang +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + require_relative '../test_helper' class WebhookPayloadTest < ActiveSupport::TestCase diff --git a/test/unit/webhook_test.rb b/test/unit/webhook_test.rb index abb39692a..b9c6f2ad2 100644 --- a/test/unit/webhook_test.rb +++ b/test/unit/webhook_test.rb @@ -1,5 +1,22 @@ # frozen_string_literal: true +# Redmine - project management software +# Copyright (C) 2006- Jean-Philippe Lang +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + require_relative '../test_helper' require 'pp'