Skip to content

Commit

Permalink
Merge pull request #151 from pdsinterop/feature/nextcloud28
Browse files Browse the repository at this point in the history
Feature/nextcloud28
  • Loading branch information
ylebre committed Feb 13, 2024
2 parents 1f46e74 + 22e6f67 commit eb2ae68
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 83 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
- 25
- 26
- 27
- 28

steps:
- name: Create docker tag from git reference
Expand Down Expand Up @@ -85,13 +86,14 @@ jobs:
- 25
- 26
- 27
- 28
test:
- 'solidtestsuite/solid-crud-tests:v7.0.5'
- 'solidtestsuite/web-access-control-tests:v7.1.0'
- 'solidtestsuite/webid-provider-tests:v2.1.0'

# Prevent EOL or non-stable versions of Nextcloud to fail the test-suite
continue-on-error: ${{ contains(fromJson('[25,26,27]'), matrix.nextcloud_version) == false }}
continue-on-error: ${{ contains(fromJson('[25,26,27,28]'), matrix.nextcloud_version) == false }}

steps:
- name: Create docker tag from git reference
Expand Down
2 changes: 1 addition & 1 deletion solid/appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ IMPORTANT: See [INSTALL.md](https://github.com/pdsinterop/solid-nextcloud/blob/m
<category>integration</category>
<bugs>https://github.com/pdsinterop/solid-nextcloud/issues</bugs>
<dependencies>
<nextcloud min-version="25" max-version="27"/>
<nextcloud min-version="25" max-version="28"/>
</dependencies>
<settings>
<admin>\OCA\Solid\Settings</admin>
Expand Down
59 changes: 4 additions & 55 deletions solid/img/app.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 17 additions & 23 deletions solid/lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
use OC\Server;

use OCA\Solid\Service\UserService;
use OCA\Solid\Service\SolidWebhookService;
use OCA\Solid\Db\SolidWebhookMapper;
use OCA\Solid\WellKnown\OpenIdConfigurationHandler;
use OCA\Solid\WellKnown\SolidHandler;
use OCA\Solid\Middleware\SolidCorsMiddleware;
Expand All @@ -23,6 +25,7 @@
use OCP\IServerContainer;
use OCP\Settings\IManager;
use OCP\Util;
use OCP\IDBConnection;

class Application extends App implements IBootstrap {
public const APP_ID = 'solid';
Expand All @@ -32,34 +35,12 @@ class Application extends App implements IBootstrap {
*/
public function __construct(array $urlParams = []) {
parent::__construct(self::APP_ID, $urlParams);

$container = $this->getContainer();

$container->registerService(SolidCorsMiddleware::class, function($c): SolidCorsMiddleware {
return new SolidCorsMiddleware(
$c->get(IRequest::class)
);
});

// executed in the order that it is registered
$container->registerMiddleware(SolidCorsMiddleware::class);

$container->registerService(SolidWebhookService::class, function($c): SolidWebhookService {
return new SolidWebhookService(
$c->query(SolidWebhookMapper::class)
);
});

$container->registerService(SolidWebhookMapper::class, function($c): SolidWebhookMapper {
return new SolidWebhookMapper(
$c->get(IDBConnection::class)
);
});
}

public function register(IRegistrationContext $context): void {
$context->registerWellKnownHandler(\OCA\Solid\WellKnown\OpenIdConfigurationHandler::class);
$context->registerWellKnownHandler(\OCA\Solid\WellKnown\SolidHandler::class);
$context->registerMiddleware(SolidCorsMiddleware::class);

/**
* Core class wrappers
Expand All @@ -79,6 +60,19 @@ public function register(IRegistrationContext $context): void {
$context->registerService('User', function($c) {
return $c->query('UserSession')->getUser();
});

/* webhook DB services */
$context->registerService(SolidWebhookService::class, function($c): SolidWebhookService {
return new SolidWebhookService(
$c->query(SolidWebhookMapper::class)
);
});

$context->registerService(SolidWebhookMapper::class, function($c): SolidWebhookMapper {
return new SolidWebhookMapper(
$c->get(\OCP\IDBConnection::class)
);
});
}

public function boot(IBootContext $context): void {
Expand Down
2 changes: 1 addition & 1 deletion solid/lib/Controller/StorageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ private function respond($response) {
$policy->addAllowedFontDomain("*");
$policy->addAllowedConnectDomain("*");
$policy->allowInlineStyle(true);
$policy->allowInlineScript(true);
// $policy->allowInlineScript(true); - removed, this function no longer exists in NC28
$policy->allowEvalScript(true);
$result->setContentSecurityPolicy($policy);

Expand Down
2 changes: 1 addition & 1 deletion solid/templates/applauncher.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
style('solid', 'style');
?>

<div id="app-navigation">
<div id="app-navigation" class="app-navigation-personal">
<?php print_unescaped($this->inc('navigation/index')); ?>
</div>

Expand Down
2 changes: 1 addition & 1 deletion solid/templates/profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
style('solid', 'style');
?>

<div id="app-navigation">
<div id="app-navigation" class="app-navigation-personal">
<?php print_unescaped($this->inc('navigation/index')); ?>
</div>

Expand Down

0 comments on commit eb2ae68

Please sign in to comment.