-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add /.well-known/security.txt handling
- Loading branch information
Showing
4 changed files
with
47 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -935,4 +935,4 @@ RUBY VERSION | |
ruby 2.7.2p137 | ||
|
||
BUNDLED WITH | ||
2.3.22 | ||
2.3.23 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# frozen_string_literal: true | ||
|
||
# Copyright (c) 2006-2023, Puzzle ITC GmbH. This file is part of | ||
# PuzzleTime and licensed under the Affero General Public License version 3 | ||
# or later. See the COPYING file at the top-level directory or at | ||
# https://github.com/puzzle/puzzletime. | ||
|
||
# Handles actions on the /.well-known path | ||
class WellknownController < ApplicationController | ||
def security | ||
file = file_for(tenant) || not_found | ||
render plain: file.read | ||
end | ||
|
||
private | ||
|
||
def organization | ||
Decidim::Organization.find_by(host: request.domain) | ||
end | ||
|
||
def tenant | ||
tenant = organization.tenant_type || 'other' | ||
tenant.to_sym | ||
end | ||
|
||
def file_for(tenant) | ||
path = Rails.root.join("lib/tenant_files/#{tenant}/security.txt") | ||
return unless path.exist? | ||
|
||
path | ||
end | ||
|
||
def not_found | ||
raise ActionController::RoutingError, 'Not Found' | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# In the event that you have discovered a technical vulnerability in an IT system of the city of Lucerne (Stadt Luzern), | ||
# we encourage you to report it to the Competence Center for Digital Security and Privacy using the Coordinated Vulnerability Disclosure program. | ||
|
||
Contact: https://www.stadtluzern.ch/politikverwaltung/stadtverwaltung/dienstabteilungenbereiche/33551 | ||
Contact: mailto:[email protected] | ||
Expires: 2023-12-31T23:59:59.000Z | ||
Preferred-Languages: en, de | ||
Canonical: https://www.stadtluzern.ch/.well-known/security.txt | ||
|