-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(security): Add public API to allow validating IP Ranges and chec…
…king for "in range" Signed-off-by: Joas Schilling <coding@schilljs.com>
- Loading branch information
1 parent
d1007db
commit 3391801
Showing
4 changed files
with
49 additions
and
3 deletions.
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
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
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,35 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
/** | ||
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
|
||
namespace OCP\Security; | ||
|
||
/** | ||
* @since 30.0.0 | ||
*/ | ||
interface IRemoteIpAddress { | ||
|
||
/** | ||
* Check if the current remote address is allowed to perform admin actions | ||
* @since 30.0.0 | ||
*/ | ||
public function allowsAdminActions(): bool; | ||
|
||
/** | ||
* Check if a given range is valid | ||
* @since 30.0.0 | ||
*/ | ||
public function isValidRangeString(string $rangeString): bool; | ||
|
||
/** | ||
* Check if a given remote address is in a list of ranges | ||
* | ||
* @param string[] $rangeStrings | ||
* @since 30.0.0 | ||
*/ | ||
public function isRemoteAddressInAnyRange(string $remoteAddress, array $rangeStrings): bool; | ||
} |