Skip to content

Commit

Permalink
Basic Implementation
Browse files Browse the repository at this point in the history
Signed-off-by: SebastianKrupinski <[email protected]>
  • Loading branch information
SebastianKrupinski committed Jul 22, 2024
1 parent 7c1ac06 commit 9c14d79
Show file tree
Hide file tree
Showing 12 changed files with 416 additions and 28 deletions.
37 changes: 37 additions & 0 deletions lib/Providers/IServiceIdentity.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php
declare(strict_types=1);

/**
* @copyright Copyright (c) 2023 Sebastian Krupinski <[email protected]>
*
* @author Sebastian Krupinski <[email protected]>
*
* @license AGPL-3.0-or-later
*
* 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 OCA\JMAPC\Providers;

/**
* This is the interface that is implemented by apps that
* implement a mail provider
*
* @since 30.0.0
*/
interface IServiceIdentity {



}
59 changes: 59 additions & 0 deletions lib/Providers/IServiceIdentityBAuth.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?php
declare(strict_types=1);

/**
* @copyright Copyright (c) 2023 Sebastian Krupinski <[email protected]>
*
* @author Sebastian Krupinski <[email protected]>
*
* @license AGPL-3.0-or-later
*
* 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 OCA\JMAPC\Providers;

/**
* This is the interface that is implemented by apps that
* implement a mail provider
*
* @since 30.0.0
*/
interface IServiceIdentityBAuth extends IServiceIdentity {

/**
*
* @since 30.0.0
*/
public function getIdentity(): string;

/**
*
* @since 30.0.0
*/
public function setIdentity(string $value);

/**
*
* @since 30.0.0
*/
public function getSecret(): string;

/**
*
* @since 30.0.0
*/
public function setSecret(string $value);

}
95 changes: 95 additions & 0 deletions lib/Providers/IServiceIdentityOAuth.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<?php
declare(strict_types=1);

/**
* @copyright Copyright (c) 2023 Sebastian Krupinski <[email protected]>
*
* @author Sebastian Krupinski <[email protected]>
*
* @license AGPL-3.0-or-later
*
* 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 OCA\JMAPC\Providers;

/**
* This is the interface that is implemented by apps that
* implement a mail provider
*
* @since 30.0.0
*/
interface IServiceIdentityOAuth extends IServiceIdentity {

/**
*
* @since 30.0.0
*/
public function getAccessToken(): string;

/**
*
* @since 30.0.0
*/
public function setAccessToken(string $value);

/**
*
* @since 30.0.0
*/
public function getAccessScope(): array;

/**
*
* @since 30.0.0
*/
public function setAccessScope(array $value);

/**
*
* @since 30.0.0
*/
public function getAccessExpiry(): int;

/**
*
* @since 30.0.0
*/
public function setAccessExpiry(int $value);

/**
*
* @since 30.0.0
*/
public function getRefreshToken(): string;

/**
*
* @since 30.0.0
*/
public function setRefreshToken(string $value);

/**
*
* @since 30.0.0
*/
public function getRefreshLocation(): string;

/**
*
* @since 30.0.0
*/
public function setRefreshLocation(string $value);

}
41 changes: 41 additions & 0 deletions lib/Providers/IServiceLocation.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php
declare(strict_types=1);

/**
* @copyright Copyright (c) 2023 Sebastian Krupinski <[email protected]>
*
* @author Sebastian Krupinski <[email protected]>
*
* @license AGPL-3.0-or-later
*
* 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 OCA\JMAPC\Providers;

/**
* This is the interface that is implemented by apps that
* implement a mail provider
*
* @since 30.0.0
*/
interface IServiceLocation {

/**
*
* @since 30.0.0
*/
public function type(): string;

}
89 changes: 89 additions & 0 deletions lib/Providers/IServiceLocationUri.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<?php
declare(strict_types=1);

/**
* @copyright Copyright (c) 2023 Sebastian Krupinski <[email protected]>
*
* @author Sebastian Krupinski <[email protected]>
*
* @license AGPL-3.0-or-later
*
* 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 OCA\JMAPC\Providers;

/**
* This is the interface that is implemented by apps that
* implement a mail provider
*
* @since 30.0.0
*/
interface IServiceLocationUri extends IServiceLocation {

/**
*
* @since 30.0.0
*/
public function location(): string;

/**
*
* @since 30.0.0
*/
public function getScheme(): string;

/**
*
* @since 30.0.0
*/
public function setScheme(string $value);

/**
*
* @since 30.0.0
*/
public function getHost(): string;

/**
*
* @since 30.0.0
*/
public function setHost(string $value);

/**
*
* @since 30.0.0
*/
public function getPort(): int;

/**
*
* @since 30.0.0
*/
public function setPort(int $value);

/**
*
* @since 30.0.0
*/
public function getPath(): string;

/**
*
* @since 30.0.0
*/
public function setPath(string $value);

}
2 changes: 1 addition & 1 deletion lib/Providers/Mail/Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ protected function instanceService(string $uid, array $entry): Service {
*/
public function initiateService(): IService {

return (new Service($this->container));
return new Service($this->container);

}

Expand Down
Loading

0 comments on commit 9c14d79

Please sign in to comment.