Skip to content

Commit

Permalink
Update to support Nextcloud 30
Browse files Browse the repository at this point in the history
Signed-off-by: H2CK <dev@jagel.net>
  • Loading branch information
H2CK committed Aug 29, 2024
1 parent 9b9a043 commit b03d86e
Show file tree
Hide file tree
Showing 52 changed files with 13,791 additions and 5,447 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

All notable changes to this project will be documented in this file.

## [0.9.3] - 2024-08-29

### Changed

- Added support for Nextcloud 30
- Removed support for Nextcloud 27
- Updated dependencies
- Updated translations
- Code cleanup and replacement of deprecated Nextcloud functions

## [0.9.2] - 2024-07-25

### Changed
Expand Down
4 changes: 2 additions & 2 deletions appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Full documentation can be found at:
- [Developer Documentation](https://github.com/H2CK/oidc/wiki#developer-documentation)
]]></description>
<version>0.9.2</version>
<version>0.9.3</version>
<licence>agpl</licence>
<author mail="dev@jagel.net" homepage="https://github.com/H2CK/oidc">Thorsten Jagel</author>
<namespace>OIDCIdentityProvider</namespace>
Expand All @@ -40,7 +40,7 @@ Full documentation can be found at:
<screenshot>https://raw.githubusercontent.com/H2CK/oidc/master/docs/oidc-app.png</screenshot>
<dependencies>
<lib>openssl</lib>
<nextcloud min-version="27" max-version="29"/>
<nextcloud min-version="28" max-version="30"/>
</dependencies>

<background-jobs>
Expand Down
56 changes: 28 additions & 28 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10,967 changes: 9,704 additions & 1,263 deletions js/oidc-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/oidc-main.js.map

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,28 +34,28 @@
use OCP\AppFramework\Bootstrap\IRegistrationContext;

class Application extends App implements IBootstrap {
public const APP_ID = 'oidc';
public const APP_ID = 'oidc';

private $backend;
private $backend;

public function __construct() {
parent::__construct(self::APP_ID);
}
public function __construct() {
parent::__construct(self::APP_ID);
}

public function register(IRegistrationContext $context): void {
public function register(IRegistrationContext $context): void {
// Register the composer autoloader for packages shipped by this app
require_once __DIR__ . '/../../vendor/autoload.php';
// Register WebFingerHandler
$context->registerWellKnownHandler(WebFingerHandler::class);
// Register OIDCDiscoveryHandler
$context->registerWellKnownHandler(OIDCDiscoveryHandler::class);
// Register WebFingerHandler
$context->registerWellKnownHandler(WebFingerHandler::class);
// Register OIDCDiscoveryHandler
$context->registerWellKnownHandler(OIDCDiscoveryHandler::class);

$this->backend = $this->getContainer()->get(BasicAuthBackend::class);
OC_User::useBackend($this->backend);
$this->backend = $this->getContainer()->get(BasicAuthBackend::class);
OC_User::useBackend($this->backend);
}

public function boot(IBootContext $context): void {

// Currently not needed
}

}
48 changes: 24 additions & 24 deletions lib/BackgroundJob/CleanupExpiredClients.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,29 +33,29 @@
class CleanupExpiredClients extends TimedJob {

/** @var ClientMapper */
private $clientMapper;
/** @var IConfig */
private $settings;

/**
* @param ITimeFactory $time
* @param ClientMapper $clientMapper
*/
public function __construct(ITimeFactory $time,
ClientMapper $clientMapper,
IConfig $settings) {
parent::__construct($time);
$this->clientMapper = $clientMapper;
$this->settings = $settings;

// Run each hour
$this->setInterval(1 * 60 * 60);
$this->setTimeSensitivity(\OCP\BackgroundJob\IJob::TIME_INSENSITIVE);
}

protected function run($argument): void {
// Don't run CleanUpJob when backgroundjobs_mode is ajax or webcron
// if ($this->settings->getAppValue('core', 'backgroundjobs_mode') !== 'cron') return;
private $clientMapper;
/** @var IConfig */
private $settings;

/**
* @param ITimeFactory $time
* @param ClientMapper $clientMapper
*/
public function __construct(ITimeFactory $time,
ClientMapper $clientMapper,
IConfig $settings) {
parent::__construct($time);
$this->clientMapper = $clientMapper;
$this->settings = $settings;

// Run each hour
$this->setInterval(1 * 60 * 60);
$this->setTimeSensitivity(\OCP\BackgroundJob\IJob::TIME_INSENSITIVE);
}

protected function run($argument): void {
// Don't run CleanUpJob when backgroundjobs_mode is ajax or webcron
// if ($this->settings->getAppValue('core', 'backgroundjobs_mode') !== 'cron') return;
$this->clientMapper->cleanUp();
}
}
}
48 changes: 24 additions & 24 deletions lib/BackgroundJob/CleanupExpiredTokens.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,29 +33,29 @@
class CleanupExpiredTokens extends TimedJob {

/** @var AccessTokenMapper */
private $accessTokenMapper;
/** @var IConfig */
private $settings;

/**
* @param ITimeFactory $time
* @param AccessTokenMapper $accessTokenMapper
*/
public function __construct(ITimeFactory $time,
AccessTokenMapper $accessTokenMapper,
IConfig $settings) {
parent::__construct($time);
$this->accessTokenMapper = $accessTokenMapper;
$this->settings = $settings;

// Run four times a day
$this->setInterval(6 * 60 * 60);
$this->setTimeSensitivity(\OCP\BackgroundJob\IJob::TIME_INSENSITIVE);
}

protected function run($argument): void {
// Don't run CleanUpJob when backgroundjobs_mode is ajax or webcron
// if ($this->settings->getAppValue('core', 'backgroundjobs_mode') !== 'cron') return;
private $accessTokenMapper;
/** @var IConfig */
private $settings;

/**
* @param ITimeFactory $time
* @param AccessTokenMapper $accessTokenMapper
*/
public function __construct(ITimeFactory $time,
AccessTokenMapper $accessTokenMapper,
IConfig $settings) {
parent::__construct($time);
$this->accessTokenMapper = $accessTokenMapper;
$this->settings = $settings;

// Run four times a day
$this->setInterval(6 * 60 * 60);
$this->setTimeSensitivity(\OCP\BackgroundJob\IJob::TIME_INSENSITIVE);
}

protected function run($argument): void {
// Don't run CleanUpJob when backgroundjobs_mode is ajax or webcron
// if ($this->settings->getAppValue('core', 'backgroundjobs_mode') !== 'cron') return;
$this->accessTokenMapper->cleanUp();
}
}
}
Loading

0 comments on commit b03d86e

Please sign in to comment.