Skip to content

Commit

Permalink
Update OCP
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis CI committed Oct 29, 2021
1 parent fb17c0e commit 9b0f84c
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 1 deletion.
3 changes: 2 additions & 1 deletion OCP/AppFramework/Bootstrap/IRegistrationContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

use OCP\AppFramework\IAppContainer;
use OCP\Authentication\TwoFactorAuth\IProvider;
use OCP\Calendar\ICalendarProvider;
use OCP\Capabilities\ICapability;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\Files\Template\ICustomTemplateProvider;
Expand Down Expand Up @@ -248,7 +249,7 @@ public function registerPreviewProvider(string $previewProviderClass, string $mi
* Register a calendar provider
*
* @param string $class
* @psalm-param class-string<IProvider> $class
* @psalm-param class-string<ICalendarProvider> $class
* @since 23.0.0
*/
public function registerCalendarProvider(string $class): void;
Expand Down
56 changes: 56 additions & 0 deletions OCP/Security/ITrustedDomainHelper.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?php

declare(strict_types=1);
/**
* @copyright Copyright (c) 2021 Joas Schilling <coding@schilljs.com>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

namespace OCP\Security;

/**
* Allows checking domains and full URLs against the list of trusted domains for
* this server in the config file.
*
* @package OCP\Security
* @since 23.0.0
*/
interface ITrustedDomainHelper {
/**
* Checks whether a given URL is considered as trusted from the list
* of trusted domains in the server's config file. If no trusted domains
* have been configured and the url is valid, returns true.
*
* @param string $url
* @return bool
* @since 23.0.0
*/
public function isTrustedUrl(string $url): bool;

/**
* Checks whether a given domain is considered as trusted from the list
* of trusted domains in the server's config file. If no trusted domains
* have been configured, returns true.
* This is used to prevent Host Header Poisoning.
*
* @param string $domainWithPort
* @return bool
* @since 23.0.0
*/
public function isTrustedDomain(string $domainWithPort): bool;
}

0 comments on commit 9b0f84c

Please sign in to comment.