Skip to content
Snippets Groups Projects
Verified Commit 4dbe6f1e authored by Dominik Frantisek Bucik's avatar Dominik Frantisek Bucik
Browse files

chore: use semantic release and ECS

parent fdcdea66
No related branches found
No related tags found
1 merge request!13Semantic release preparations
{
"branches": ["master"],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/github",
["@semantic-release/git", {
"assets": ["CHANGELOG.md"],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}]
]
}
...@@ -2,10 +2,19 @@ ...@@ -2,10 +2,19 @@
[![Latest Stable Version](https://poser.pugx.org/bbmri/simplesamlphp-module-bbmri/v/stable)](https://packagist.org/packages/bbmri/simplesamlphp-module-bbmri) [![Latest Stable Version](https://poser.pugx.org/bbmri/simplesamlphp-module-bbmri/v/stable)](https://packagist.org/packages/bbmri/simplesamlphp-module-bbmri)
[![Latest Unstable Version](https://poser.pugx.org/bbmri/simplesamlphp-module-bbmri/v/unstable)](https://packagist.org/packages/bbmri/simplesamlphp-module-bbmri) [![Latest Unstable Version](https://poser.pugx.org/bbmri/simplesamlphp-module-bbmri/v/unstable)](https://packagist.org/packages/bbmri/simplesamlphp-module-bbmri)
[![CodeFactor](https://www.codefactor.io/repository/github/cesnet/bbmri-aai-proxy-idp-template/badge)](https://www.codefactor.io/repository/github/cesnet/bbmri-aai-proxy-idp-template) [![Build and CI](https://github.com/CESNET/bbmri-aai-proxy-idp-template/actions/workflows/build_and_check.yml/badge.svg)](https://github.com/CESNET/bbmri-aai-proxy-idp-template/build_and_check.yml)
[![License](https://poser.pugx.org/bbmri/simplesamlphp-module-bbmri/license)](https://packagist.org/packages/bbmri/simplesamlphp-module-bbmri) [![License](https://poser.pugx.org/bbmri/simplesamlphp-module-bbmri/license)](https://packagist.org/packages/bbmri/simplesamlphp-module-bbmri)
Template for BBMRI AAI Proxy IdP component Template for BBMRI AAI Proxy IdP component
## Instalation ## Contribution
`php composer.phar require bbmri/simplesamlphp-module-bbmri`
\ No newline at end of file This repository uses [Conventional Commits](https://www.npmjs.com/package/@commitlint/config-conventional).
Any change that significantly changes behavior in a backward-incompatible way or requires a configuration change must be marked as BREAKING CHANGE.
### Available scopes:
* theme
## Instalation
`php composer.phar require`
...@@ -17,5 +17,8 @@ ...@@ -17,5 +17,8 @@
], ],
"require": { "require": {
"simplesamlphp/composer-module-installer": "~1.0" "simplesamlphp/composer-module-installer": "~1.0"
},
"require-dev": {
"symplify/easy-coding-standard": "^9.4"
} }
} }
ecs.php 0 → 100644
<?php
declare(strict_types=1);
use PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symplify\EasyCodingStandard\ValueObject\Option;
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;
return static function (ContainerConfigurator $containerConfigurator): void {
$services = $containerConfigurator->services();
$services->set(ArraySyntaxFixer::class)
->call('configure', [[
'syntax' => 'short',
]])
;
$parameters = $containerConfigurator->parameters();
$parameters->set(Option::PATHS, [
__DIR__ . '/ecs.php',
__DIR__ . '/config-templates',
__DIR__ . '/dictionaries',
__DIR__ . '/lib',
__DIR__ . '/themes',
__DIR__ . '/www',
__DIR__ . '/composer.json',
]);
$containerConfigurator->import(SetList::CLEAN_CODE);
$containerConfigurator->import(SetList::SYMPLIFY);
$containerConfigurator->import(SetList::ARRAY);
$containerConfigurator->import(SetList::COMMON);
$containerConfigurator->import(SetList::COMMENTS);
$containerConfigurator->import(SetList::CONTROL_STRUCTURES);
$containerConfigurator->import(SetList::DOCBLOCK);
$containerConfigurator->import(SetList::NAMESPACES);
$containerConfigurator->import(SetList::PHPUNIT);
$containerConfigurator->import(SetList::SPACES);
$containerConfigurator->import(SetList::PSR_12);
};
<?php <?php
declare(strict_types=1);
include \SimpleSAML\Module::getModuleDir('perun') . '/themes/perun/consent/consentform.php'; include \SimpleSAML\Module::getModuleDir('perun') . '/themes/perun/consent/consentform.php';
<?php <?php
declare(strict_types=1);
include \SimpleSAML\Module::getModuleDir('perun') . '/themes/perun/consent/noconsent.php'; include \SimpleSAML\Module::getModuleDir('perun') . '/themes/perun/consent/noconsent.php';
<?php <?php
declare(strict_types=1);
include \SimpleSAML\Module::getModuleDir('perun') . '/themes/perun/core/loginuserpass.php'; include \SimpleSAML\Module::getModuleDir('perun') . '/themes/perun/core/loginuserpass.php';
<?php <?php
declare(strict_types=1);
include \SimpleSAML\Module::getModuleDir('perun') . '/themes/perun/default/error.php'; include \SimpleSAML\Module::getModuleDir('perun') . '/themes/perun/default/error.php';
<?php <?php
declare(strict_types=1);
include \SimpleSAML\Module::getModuleDir('perun') . '/themes/perun/default/errorreport.php'; include \SimpleSAML\Module::getModuleDir('perun') . '/themes/perun/default/errorreport.php';
<?php <?php declare(strict_types=1);
use SimpleSAML\Module; use SimpleSAML\Module;
if (!empty($this->data['htmlinject']['htmlContentPost'])) { if (! empty($this->data['htmlinject']['htmlContentPost'])) {
foreach ($this->data['htmlinject']['htmlContentPost'] as $c) { foreach ($this->data['htmlinject']['htmlContentPost'] as $c) {
echo $c; echo $c;
} }
...@@ -17,8 +17,8 @@ if (!empty($this->data['htmlinject']['htmlContentPost'])) { ...@@ -17,8 +17,8 @@ if (!empty($this->data['htmlinject']['htmlContentPost'])) {
<div style="float: left;"> <div style="float: left;">
<img src="<?php echo Module::getModuleUrl( <img src="<?php echo Module::getModuleUrl(
'bbmri/res/img/BBMRI-ERIC-gateway-for-health_216.png' 'bbmri/res/img/BBMRI-ERIC-gateway-for-health_216.png'
) ?>"> ) ?>">
</div> </div>
<div style="float: left;"> <div style="float: left;">
...@@ -26,7 +26,7 @@ if (!empty($this->data['htmlinject']['htmlContentPost'])) { ...@@ -26,7 +26,7 @@ if (!empty($this->data['htmlinject']['htmlContentPost'])) {
&nbsp; &nbsp; +43 316 34 99 17-0 &nbsp; &nbsp; &nbsp; +43 316 34 99 17-0 &nbsp;
<a href="mailto:contact@bbmri-eric.eu">contact@bbmri-eric.eu</a> <a href="mailto:contact@bbmri-eric.eu">contact@bbmri-eric.eu</a>
</p> </p>
<p>Copyright © BBMRI-ERIC <?php echo date("Y"); ?> </p> <p>Copyright © BBMRI-ERIC <?php echo date('Y'); ?> </p>
</div> </div>
</div> </div>
......
<?php <?php declare(strict_types=1);
use SimpleSAML\Module; use SimpleSAML\Module;
...@@ -22,7 +22,7 @@ if (array_key_exists('pageid', $this->data)) { ...@@ -22,7 +22,7 @@ if (array_key_exists('pageid', $this->data)) {
'post' => &$this->data['htmlinject']['htmlContentPost'], 'post' => &$this->data['htmlinject']['htmlContentPost'],
'head' => &$this->data['htmlinject']['htmlContentHead'], 'head' => &$this->data['htmlinject']['htmlContentHead'],
'jquery' => &$jquery, 'jquery' => &$jquery,
'page' => $this->data['pageid'] 'page' => $this->data['pageid'],
]; ];
Module::callHooks('htmlinject', $hookinfo); Module::callHooks('htmlinject', $hookinfo);
...@@ -30,13 +30,11 @@ if (array_key_exists('pageid', $this->data)) { ...@@ -30,13 +30,11 @@ if (array_key_exists('pageid', $this->data)) {
// - o - o - o - o - o - o - o - o - o - o - o - o - // - o - o - o - o - o - o - o - o - o - o - o - o -
/** /**
* Do not allow to frame SimpleSAMLphp pages from another location. * Do not allow to frame SimpleSAMLphp pages from another location. This prevents clickjacking attacks in modern
* This prevents clickjacking attacks in modern browsers. * browsers.
* *
* If you don't want any framing at all you can even change this to * If you don't want any framing at all you can even change this to 'DENY', or comment it out if you actually want to
* 'DENY', or comment it out if you actually want to allow foreign * allow foreign sites to put SimpleSAMLphp in a frame. The latter is however probably not a good security practice.
* sites to put SimpleSAMLphp in a frame. The latter is however
* probably not a good security practice.
*/ */
header('X-Frame-Options: SAMEORIGIN'); header('X-Frame-Options: SAMEORIGIN');
...@@ -49,9 +47,9 @@ header('X-Frame-Options: SAMEORIGIN'); ...@@ -49,9 +47,9 @@ header('X-Frame-Options: SAMEORIGIN');
<script type="text/javascript" src="/<?php echo $this->data['baseurlpath']; ?>resources/script.js"></script> <script type="text/javascript" src="/<?php echo $this->data['baseurlpath']; ?>resources/script.js"></script>
<title><?php <title><?php
if (array_key_exists('header', $this->data)) { if (array_key_exists('header', $this->data)) {
echo $this->data['header']; echo $this->data['header'];
} else { } else {
echo 'SimpleSAMLphp'; echo 'SimpleSAMLphp';
} }
?></title> ?></title>
...@@ -61,26 +59,26 @@ header('X-Frame-Options: SAMEORIGIN'); ...@@ -61,26 +59,26 @@ header('X-Frame-Options: SAMEORIGIN');
<?php <?php
if (!empty($jquery)) { if (! empty($jquery)) {
$version = '1.8'; $version = '1.8';
if (array_key_exists('version', $jquery)) { if (array_key_exists('version', $jquery)) {
$version = $jquery['version']; $version = $jquery['version'];
} }
if ($version == '1.8') { if ($version === '1.8') {
if (isset($jquery['core']) && $jquery['core']) { if (isset($jquery['core']) && $jquery['core']) {
echo('<script type="text/javascript" src="/' . $this->data['baseurlpath'] . echo '<script type="text/javascript" src="/' . $this->data['baseurlpath'] .
'resources/jquery-1.8.js"></script>' . "\n"); 'resources/jquery-1.8.js"></script>' . "\n";
} }
if (isset($jquery['ui']) && $jquery['ui']) { if (isset($jquery['ui']) && $jquery['ui']) {
echo('<script type="text/javascript" src="/' . $this->data['baseurlpath'] . echo '<script type="text/javascript" src="/' . $this->data['baseurlpath'] .
'resources/jquery-ui-1.8.js"></script>' . "\n"); 'resources/jquery-ui-1.8.js"></script>' . "\n";
} }
if (isset($jquery['css']) && $jquery['css']) { if (isset($jquery['css']) && $jquery['css']) {
echo('<link rel="stylesheet" media="screen" type="text/css" href="/' . $this->data['baseurlpath'] . echo '<link rel="stylesheet" media="screen" type="text/css" href="/' . $this->data['baseurlpath'] .
'resources/uitheme1.8/jquery-ui.css" />' . "\n"); 'resources/uitheme1.8/jquery-ui.css" />' . "\n";
} }
} }
} }
...@@ -90,7 +88,7 @@ header('X-Frame-Options: SAMEORIGIN'); ...@@ -90,7 +88,7 @@ header('X-Frame-Options: SAMEORIGIN');
'resources/clipboard.min.js"></script>' . "\n"; 'resources/clipboard.min.js"></script>' . "\n";
} }
if (!empty($this->data['htmlinject']['htmlContentHead'])) { if (! empty($this->data['htmlinject']['htmlContentHead'])) {
foreach ($this->data['htmlinject']['htmlContentHead'] as $c) { foreach ($this->data['htmlinject']['htmlContentHead'] as $c) {
echo $c; echo $c;
} }
...@@ -139,7 +137,7 @@ if ($onLoad !== '') { ...@@ -139,7 +137,7 @@ if ($onLoad !== '') {
alt="BBMRI-ERIC logo"> alt="BBMRI-ERIC logo">
<h1> <h1>
<?php <?php
echo(isset($this->data['header']) ? $this->data['header'] : 'BBMRI-ERIC proxy IdP'); echo isset($this->data['header']) ? $this->data['header'] : 'BBMRI-ERIC proxy IdP';
?> ?>
</h1> </h1>
</div> </div>
...@@ -148,7 +146,7 @@ if ($onLoad !== '') { ...@@ -148,7 +146,7 @@ if ($onLoad !== '') {
<?php <?php
if (!empty($this->data['htmlinject']['htmlContentPre'])) { if (! empty($this->data['htmlinject']['htmlContentPre'])) {
foreach ($this->data['htmlinject']['htmlContentPre'] as $c) { foreach ($this->data['htmlinject']['htmlContentPre'] as $c) {
echo $c; echo $c;
} }
......
<?php <?php
declare(strict_types=1);
include \SimpleSAML\Module::getModuleDir('perun') . '/themes/perun/default/post.php'; include \SimpleSAML\Module::getModuleDir('perun') . '/themes/perun/default/post.php';
<?php <?php
declare(strict_types=1);
include \SimpleSAML\Module::getModuleDir('perun') . '/themes/perun/perun/disco-tpl.php'; include \SimpleSAML\Module::getModuleDir('perun') . '/themes/perun/perun/disco-tpl.php';
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment