migrate therinaldos.com data
Build & Deploy to DigitalOcean Space / build (push) Failing after 2m38s

This commit is contained in:
2024-05-05 15:50:45 -04:00
commit ef1ff240d4
23182 changed files with 3801898 additions and 0 deletions
@@ -0,0 +1,48 @@
<?php
declare(strict_types=1);
/**
* @copyright 2022 Carl Schwan <carl@carlschwan.eu>
*
* @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\Federation\Events;
use OCP\EventDispatcher\Event;
/**
* @since 25.0.0
*/
class TrustedServerRemovedEvent extends Event {
private string $urlHash;
/**
* @since 25.0.0
*/
public function __construct(string $urlHash) {
parent::__construct();
$this->urlHash = $urlHash;
}
/**
* @since 25.0.0
*/
public function getUrlHash(): string {
return $this->urlHash;
}
}
@@ -0,0 +1,46 @@
<?php
/**
* @copyright Copyright (c) 2018 Bjoern Schiessle <bjoern@schiessle.org>
*
* @author Bjoern Schiessle <bjoern@schiessle.org>
*
* @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\Federation\Exceptions;
use OCP\HintException;
/**
* Class ActionNotSupportedException
*
*
* @since 14.0.0
*/
class ActionNotSupportedException extends HintException {
/**
* ActionNotSupportedException constructor.
*
* @since 14.0.0
*
*/
public function __construct($action) {
$l = \OC::$server->getL10N('federation');
$message = 'Action "' . $action . '" not supported or implemented.';
$hint = $l->t('Action "%s" not supported or implemented.', [$action]);
parent::__construct($message, $hint);
}
}
@@ -0,0 +1,46 @@
<?php
/**
* @copyright Copyright (c) 2018 Bjoern Schiessle <bjoern@schiessle.org>
*
* @author Bjoern Schiessle <bjoern@schiessle.org>
*
* @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\Federation\Exceptions;
use OCP\HintException;
/**
* Class AuthenticationFailedException
*
*
* @since 14.0.0
*/
class AuthenticationFailedException extends HintException {
/**
* BadRequestException constructor.
*
* @since 14.0.0
*
*/
public function __construct() {
$l = \OC::$server->getL10N('federation');
$message = 'Authentication failed, wrong token or provider ID given';
$hint = $l->t('Authentication failed, wrong token or provider ID given');
parent::__construct($message, $hint);
}
}
@@ -0,0 +1,79 @@
<?php
/**
* @copyright Copyright (c) 2018 Bjoern Schiessle <bjoern@schiessle.org>
*
* @author Bjoern Schiessle <bjoern@schiessle.org>
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
*
* @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\Federation\Exceptions;
use OCP\HintException;
/**
* Class BadRequestException
*
*
* @since 14.0.0
*/
class BadRequestException extends HintException {
/**
* @var string[] $parameterList
*/
private $parameterList;
/**
* BadRequestException constructor.
*
* @since 14.0.0
*
* @param array $missingParameters
*/
public function __construct(array $missingParameters) {
$l = \OC::$server->getL10N('federation');
$this->parameterList = $missingParameters;
$parameterList = implode(',', $missingParameters);
$message = 'Parameters missing in order to complete the request. Missing Parameters: ' . $parameterList;
$hint = $l->t('Parameters missing in order to complete the request. Missing Parameters: "%s"', [$parameterList]);
parent::__construct($message, $hint);
}
/**
* get array with the return message as defined in the OCM API
*
* @since 14.0.0
*
* @return array{message: string, validationErrors: array{message: string, name: string}[]}
*/
public function getReturnMessage() {
$result = [
'message' => 'RESOURCE_NOT_FOUND',
'validationErrors' => [
]
];
foreach ($this->parameterList as $missingParameter) {
$result['validationErrors'][] = [
'name' => $missingParameter,
'message' => 'NOT_FOUND'
];
}
return $result;
}
}
@@ -0,0 +1,50 @@
<?php
/**
* @copyright Copyright (c) 2018 Bjoern Schiessle <bjoern@schiessle.org>
*
* @author Bjoern Schiessle <bjoern@schiessle.org>
* @author Joas Schilling <coding@schilljs.com>
* @author rakekniven <mark.ziegler@rakekniven.de>
*
* @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\Federation\Exceptions;
use OCP\HintException;
/**
* Class ProviderAlreadyExistsException
*
*
* @since 14.0.0
*/
class ProviderAlreadyExistsException extends HintException {
/**
* ProviderAlreadyExistsException constructor.
*
* @since 14.0.0
*
* @param string $newProviderId cloud federation provider ID of the new provider
* @param string $existingProviderName name of cloud federation provider which already use the same ID
*/
public function __construct($newProviderId, $existingProviderName) {
$l = \OC::$server->getL10N('federation');
$message = 'ID "' . $newProviderId . '" already used by cloud federation provider "' . $existingProviderName . '"';
$hint = $l->t('ID "%1$s" already used by cloud federation provider "%2$s"', [$newProviderId, $existingProviderName]);
parent::__construct($message, $hint);
}
}
@@ -0,0 +1,48 @@
<?php
/**
* @copyright Copyright (c) 2018 Bjoern Schiessle <bjoern@schiessle.org>
*
* @author Bjoern Schiessle <bjoern@schiessle.org>
*
* @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\Federation\Exceptions;
use OCP\AppFramework\Http;
use OCP\HintException;
/**
* Class ProviderCouldNotAddShareException
*
*
* @since 14.0.0
*/
class ProviderCouldNotAddShareException extends HintException {
/**
* ProviderCouldNotAddShareException constructor.
*
* @since 14.0.0
*
* @param string $message
* @param string $hint
* @param int $code
* @param \Exception|null $previous
*/
public function __construct($message, $hint = '', $code = Http::STATUS_BAD_REQUEST, \Exception $previous = null) {
parent::__construct($message, $hint, $code, $previous);
}
}
@@ -0,0 +1,47 @@
<?php
/**
* @copyright Copyright (c) 2018 Bjoern Schiessle <bjoern@schiessle.org>
*
* @author Bjoern Schiessle <bjoern@schiessle.org>
*
* @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\Federation\Exceptions;
use OCP\HintException;
/**
* Class ProviderDoesNotExistsException
*
*
* @since 14.0.0
*/
class ProviderDoesNotExistsException extends HintException {
/**
* ProviderDoesNotExistsException constructor.
*
* @since 14.0.0
*
* @param string $providerId cloud federation provider ID
*/
public function __construct($providerId) {
$l = \OC::$server->getL10N('federation');
$message = 'Cloud Federation Provider with ID: "' . $providerId . '" does not exist.';
$hint = $l->t('Cloud Federation Provider with ID: "%s" does not exist.', [$providerId]);
parent::__construct($message, $hint);
}
}
@@ -0,0 +1,61 @@
<?php
/**
* @copyright Copyright (c) 2018 Bjoern Schiessle <bjoern@schiessle.org>
*
* @author Bjoern Schiessle <bjoern@schiessle.org>
*
* @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\Federation;
/**
* Interface ICloudFederationFactory
*
*
* @since 14.0.0
*/
interface ICloudFederationFactory {
/**
* get a CloudFederationShare Object to prepare a share you want to send
*
* @param string $shareWith
* @param string $name resource name (e.g. document.odt)
* @param string $description share description (optional)
* @param string $providerId resource UID on the provider side
* @param string $owner provider specific UID of the user who owns the resource
* @param string $ownerDisplayName display name of the user who shared the item
* @param string $sharedBy provider specific UID of the user who shared the resource
* @param string $sharedByDisplayName display name of the user who shared the resource
* @param string $sharedSecret used to authenticate requests across servers
* @param string $shareType ('group' or 'user' share)
* @param $resourceType ('file', 'calendar',...)
* @return ICloudFederationShare
*
* @since 14.0.0
*/
public function getCloudFederationShare($shareWith, $name, $description, $providerId, $owner, $ownerDisplayName, $sharedBy, $sharedByDisplayName, $sharedSecret, $shareType, $resourceType);
/**
* get a Cloud FederationNotification object to prepare a notification you
* want to send
*
* @return ICloudFederationNotification
*
* @since 14.0.0
*/
public function getCloudFederationNotification();
}
@@ -0,0 +1,52 @@
<?php
/**
* @copyright Copyright (c) 2018 Bjoern Schiessle <bjoern@schiessle.org>
*
* @author Bjoern Schiessle <bjoern@schiessle.org>
*
* @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\Federation;
/**
* Interface ICloudFederationNotification
*
*
* @since 14.0.0
*/
interface ICloudFederationNotification {
/**
* add a message to the notification
*
* @param string $notificationType (e.g. SHARE_ACCEPTED)
* @param string $resourceType (e.g. file, calendar, contact,...)
* @param string $providerId id of the share
* @param array $notification payload of the notification
*
* @since 14.0.0
*/
public function setMessage($notificationType, $resourceType, $providerId, array $notification);
/**
* get message, ready to send out
*
* @return array
*
* @since 14.0.0
*/
public function getMessage();
}
@@ -0,0 +1,88 @@
<?php
/**
* @copyright Copyright (c) 2018 Bjoern Schiessle <bjoern@schiessle.org>
*
* @author Bjoern Schiessle <bjoern@schiessle.org>
* @author Roeland Jago Douma <roeland@famdouma.nl>
*
* @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\Federation;
use OCP\Federation\Exceptions\ActionNotSupportedException;
use OCP\Federation\Exceptions\AuthenticationFailedException;
use OCP\Federation\Exceptions\BadRequestException;
use OCP\Federation\Exceptions\ProviderCouldNotAddShareException;
use OCP\Share\Exceptions\ShareNotFound;
/**
* Interface ICloudFederationProvider
*
* Enable apps to create their own cloud federation provider
*
* @since 14.0.0
*
*/
interface ICloudFederationProvider {
/**
* get the name of the share type, handled by this provider
*
* @return string
*
* @since 14.0.0
*/
public function getShareType();
/**
* share received from another server
*
* @param ICloudFederationShare $share
* @return string provider specific unique ID of the share
*
* @throws ProviderCouldNotAddShareException
*
* @since 14.0.0
*/
public function shareReceived(ICloudFederationShare $share);
/**
* notification received from another server
*
* @param string $notificationType (e.g SHARE_ACCEPTED)
* @param string $providerId share ID
* @param array $notification provider specific notification
* @return array<string> $data send back to sender
*
* @throws ShareNotFound
* @throws ActionNotSupportedException
* @throws BadRequestException
* @throws AuthenticationFailedException
*
* @since 14.0.0
*/
public function notificationReceived($notificationType, $providerId, array $notification);
/**
* get the supported share types, e.g. "user", "group", etc.
*
* @return array
*
* @since 14.0.0
*/
public function getSupportedShareTypes();
}
@@ -0,0 +1,105 @@
<?php
/**
* @copyright Copyright (c) 2018 Bjoern Schiessle <bjoern@schiessle.org>
*
* @author Bjoern Schiessle <bjoern@schiessle.org>
* @author 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\Federation;
/**
* Class ICloudFederationProviderManager
*
* Manage cloud federation providers
*
* @since 14.0.0
*
*/
interface ICloudFederationProviderManager {
/**
* Registers an callback function which must return an cloud federation provider
*
* @param string $resourceType which resource type does the provider handles
* @param string $displayName user facing name of the federated share provider
* @param callable $callback
* @throws Exceptions\ProviderAlreadyExistsException
*
* @since 14.0.0
*/
public function addCloudFederationProvider($resourceType, $displayName, callable $callback);
/**
* remove cloud federation provider
*
* @param string $resourceType
*
* @since 14.0.0
*/
public function removeCloudFederationProvider($resourceType);
/**
* get a list of all cloudFederationProviders
*
* @return array [resourceType => ['resourceType' => $resourceType, 'displayName' => $displayName, 'callback' => callback]]
*
* @since 14.0.0
*/
public function getAllCloudFederationProviders();
/**
* get a specific cloud federation provider
*
* @param string $resourceType
* @return ICloudFederationProvider
* @throws Exceptions\ProviderDoesNotExistsException
*
* @since 14.0.0
*/
public function getCloudFederationProvider($resourceType);
/**
* send federated share
*
* @param ICloudFederationShare $share
* @return mixed
*
* @since 14.0.0
*/
public function sendShare(ICloudFederationShare $share);
/**
* send notification about existing share
*
* @param string $url
* @param ICloudFederationNotification $notification
* @return array|false
*
* @since 14.0.0
*/
public function sendNotification($url, ICloudFederationNotification $notification);
/**
* check if the new cloud federation API is ready to be used
*
* @return bool
*
* @since 14.0.0
*/
public function isReady();
}
@@ -0,0 +1,248 @@
<?php
/**
* @copyright Copyright (c) 2018 Bjoern Schiessle <bjoern@schiessle.org>
*
* @author Bjoern Schiessle <bjoern@schiessle.org>
*
* @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\Federation;
/**
* Interface ICloudFederationShare
*
*
* @since 14.0.0
*/
interface ICloudFederationShare {
/**
* set uid of the recipient
*
* @param string $user
*
* @since 14.0.0
*/
public function setShareWith($user);
/**
* set resource name (e.g. file, calendar, contact,...)
*
* @param string $name
*
* @since 14.0.0
*/
public function setResourceName($name);
/**
* set resource type (e.g. file, calendar, contact,...)
*
* @param string $resourceType
*
* @since 14.0.0
*/
public function setResourceType($resourceType);
/**
* set resource description (optional)
*
* @param string $description
*
* @since 14.0.0
*/
public function setDescription($description);
/**
* set provider ID (e.g. file ID)
*
* @param string $providerId
*
* @since 14.0.0
*/
public function setProviderId($providerId);
/**
* set owner UID
*
* @param string $owner
*
* @since 14.0.0
*/
public function setOwner($owner);
/**
* set owner display name
*
* @param string $ownerDisplayName
*
* @since 14.0.0
*/
public function setOwnerDisplayName($ownerDisplayName);
/**
* set UID of the user who sends the share
*
* @param string $sharedBy
*
* @since 14.0.0
*/
public function setSharedBy($sharedBy);
/**
* set display name of the user who sends the share
*
* @param $sharedByDisplayName
*
* @since 14.0.0
*/
public function setSharedByDisplayName($sharedByDisplayName);
/**
* set protocol specification
*
* @param array $protocol
*
* @since 14.0.0
*/
public function setProtocol(array $protocol);
/**
* share type (group or user)
*
* @param string $shareType
*
* @since 14.0.0
*/
public function setShareType($shareType);
/**
* get the whole share, ready to send out
*
* @return array
*
* @since 14.0.0
*/
public function getShare();
/**
* get uid of the recipient
*
* @return string
*
* @since 14.0.0
*/
public function getShareWith();
/**
* get resource name (e.g. file, calendar, contact,...)
*
* @return string
*
* @since 14.0.0
*/
public function getResourceName();
/**
* get resource type (e.g. file, calendar, contact,...)
*
* @return string
*
* @since 14.0.0
*/
public function getResourceType();
/**
* get resource description (optional)
*
* @return string
*
* @since 14.0.0
*/
public function getDescription();
/**
* get provider ID (e.g. file ID)
*
* @return string
*
* @since 14.0.0
*/
public function getProviderId();
/**
* get owner UID
*
* @return string
*
* @since 14.0.0
*/
public function getOwner();
/**
* get owner display name
*
* @return string
*
* @since 14.0.0
*/
public function getOwnerDisplayName();
/**
* get UID of the user who sends the share
*
* @return string
*
* @since 14.0.0
*/
public function getSharedBy();
/**
* get display name of the user who sends the share
*
* @return string
*
* @since 14.0.0
*/
public function getSharedByDisplayName();
/**
* get share type (group or user)
*
* @return string
*
* @since 14.0.0
*/
public function getShareType();
/**
* get share Secret
*
* @return string
*
* @since 14.0.0
*/
public function getShareSecret();
/**
* get protocol specification
*
* @return array
*
* @since 14.0.0
*/
public function getProtocol();
}
@@ -0,0 +1,66 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2017, Robin Appelman <robin@icewind.nl>
*
* @author Robin Appelman <robin@icewind.nl>
* @author Roeland Jago Douma <roeland@famdouma.nl>
*
* @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\Federation;
/**
* Parsed federated cloud id
*
* @since 12.0.0
*/
interface ICloudId {
/**
* The remote cloud id
*
* @return string
* @since 12.0.0
*/
public function getId(): string;
/**
* Get a clean representation of the cloud id for display
*
* @return string
* @since 12.0.0
*/
public function getDisplayId(): string;
/**
* The username on the remote server
*
* @return string
* @since 12.0.0
*/
public function getUser(): string;
/**
* The base address of the remote server
*
* @return string
* @since 12.0.0
*/
public function getRemote(): string;
}
@@ -0,0 +1,75 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2017, Robin Appelman <robin@icewind.nl>
*
* @author Joas Schilling <coding@schilljs.com>
* @author Robin Appelman <robin@icewind.nl>
* @author Roeland Jago Douma <roeland@famdouma.nl>
*
* @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\Federation;
/**
* Interface for resolving federated cloud ids
*
* @since 12.0.0
*/
interface ICloudIdManager {
/**
* @param string $cloudId
* @return ICloudId
* @throws \InvalidArgumentException
*
* @since 12.0.0
*/
public function resolveCloudId(string $cloudId): ICloudId;
/**
* Get the cloud id for a remote user
*
* @param string $user
* @param string|null $remote (optional since 23.0.0 for local users)
* @return ICloudId
*
* @since 12.0.0
*/
public function getCloudId(string $user, ?string $remote): ICloudId;
/**
* Check if the input is a correctly formatted cloud id
*
* @param string $cloudId
* @return bool
*
* @since 12.0.0
*/
public function isValidCloudId(string $cloudId): bool;
/**
* remove scheme/protocol from an url
*
* @param string $url
*
* @return string
* @since 28.0.0
*/
public function removeProtocolFromUrl(string $url): string;
}