Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
bobvandevijver committed May 25, 2018
0 parents commit 78a88a4
Show file tree
Hide file tree
Showing 6 changed files with 202 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
@@ -0,0 +1,4 @@
.idea
composer.lock
composer.phar
vendor
32 changes: 32 additions & 0 deletions .gitlab-ci.yml
@@ -0,0 +1,32 @@
stages:
- prepare
- static

install-dependencies:
stage: prepare
image: drenso/php:7.1-d1
artifacts:
name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}_cache"
expire_in: 1 hour
paths:
- vendor/
before_script:
- ./install-composer.sh
script:
- php composer.phar install --no-interaction --no-progress --no-suggest
after_script:
- find vendor/ -name .git -type d -exec rm -rf {} \+
tags:
- docker

php-analysis:
stage: static
image:
name: kickin/phan:0.12.2
entrypoint: [ "" ]
dependencies:
- install-dependencies
script:
- php7 /opt/phan/phan -k tests/phan/config.php
tags:
- docker
9 changes: 9 additions & 0 deletions README.md
@@ -0,0 +1,9 @@
# Symfony OIDC bundle

This bundle can be used to add OIDC support to any application. Currently it has only been tested with SURFconext OIDC.

### Composer

You can add this bundle to the `composer.json` by defining the security options: see [Composer docs](https://getcomposer.org/doc/articles/handling-private-packages-with-satis.md#security).

You will need to create a new deploy key for every installation (dev or prod).
31 changes: 31 additions & 0 deletions composer.json
@@ -0,0 +1,31 @@
{
"name": "drenso/symfony-oidc-bundle",
"description": "OpenID connect bundle for Symfony",
"keywords": [
"symfony",
"oidc",
"openid connect"
],
"type": "symfony-bundle",
"homepage": "https://gitlab.drenso.nl/intern/symfony-oidc",
"license": "closed",
"authors": [
{
"name": "Bob van de Vijver",
"email": "bob@drenso.nl"
},
{
"name": "Tobias Feijten",
"email": "tobias@drenso.nl"
}
],
"require": {},
"require-dev": {
"drenso/phan-extensions": "^2.3"
},
"autoload": {
"psr-4": {
"Drenso\\OidcBundle\\": ""
}
}
}
17 changes: 17 additions & 0 deletions install-composer.sh
@@ -0,0 +1,17 @@
#!/bin/sh

EXPECTED_SIGNATURE=$(wget -q -O - https://composer.github.io/installer.sig)
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');")

if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]
then
>&2 echo 'ERROR: Invalid installer signature'
rm composer-setup.php
exit 1
fi

php composer-setup.php --quiet
RESULT=$?
rm composer-setup.php
exit $RESULT
109 changes: 109 additions & 0 deletions tests/phan/config.php
@@ -0,0 +1,109 @@
<?php

/**
* This configuration will be read and overlayed on top of the
* default configuration. Command line arguments will be applied
* after this file is read.
*
* @see src/Phan/Config.php
* @see https://github.com/etsy/phan/blob/master/.phan/config.php
* See Config for all configurable options.
*
* A Note About Paths
* ==================
*
* Files referenced from this file should be defined as
*
* ```
* Config::projectPath('relative_path/to/file')
* ```
*
* where the relative path is relative to the root of the
* project which is defined as either the working directory
* of the phan executable or a path passed in via the CLI
* '-d' flag.
*/

/**
* Runs glob recursivly on a specified directory, and returns all files that conform to the given glob.
*
* @param string $pattern
* @param int $flags
*
* @return array
*/

function rglob($pattern, $flags = 0)
{
$files = glob($pattern, $flags);
foreach (glob(dirname($pattern) . '/*', GLOB_ONLYDIR | GLOB_NOSORT) as $dir) {
$files = array_merge($files, rglob($dir . '/' . basename($pattern), $flags));
}

return $files;
}

//Disables analysis on the cache, all vendor code, the code for HTMLDiff (non-composer dependency) and all Traits (done via rglob).
$disabled_analysis = array_merge(
[
'vendor',
],
rglob('src/*Trait*')
);


return [
// If true, missing properties will be created when they are first seen. If false, we'll report an error message.
"allow_missing_properties" => false,

// Allow null to be cast as any type and for any type to be cast to null.
"null_casts_as_any_type" => true,

// Backwards Compatibility Checking
'backward_compatibility_checks' => false,

// Run a quick version of checks that takes less time
"quick_mode" => false,

// Only emit normal severity issues
"minimum_severity" => 5,

// A set of fully qualified class-names for which
// a call to parent::__construct() is required
'parent_constructor_required' => [],

// A list of plugin files to execute
'plugins' => [
'vendor/drenso/phan-extensions/Plugin/Annotation/SymfonyAnnotationPlugin.php',
'vendor/drenso/phan-extensions/Plugin/DocComment/ThrowsPlugin.php',
'vendor/drenso/phan-extensions/Plugin/DocComment/MethodPlugin.php',
'vendor/drenso/phan-extensions/Plugin/DocComment/InlineVarPlugin.php',
],

// A list of directories that should be parsed for class and
// method information. After excluding the directories
// defined in exclude_analysis_directory_list, the remaining
// files will be statically analyzed for errors.
//
// Thus, both first-party and third-party code being used by
// your application should be included in this list.
'directory_list' => [
'src',
'vendor',
],

// A list of directories holding code that we want to parse, but not analyze
"exclude_analysis_directory_list" => $disabled_analysis,

// A file list that defines files that will be excluded
// from parsing and analysis and will not be read at all.

// This is useful for excluding hopelessly unanalyzable
// files that can't be removed for whatever reason.

// Added are the show/actions/excel controllers that are not used.
// They are however required to generate some of the routes that are used
'exclude_file_list' => [
'vendor/symfony/symfony/src/Symfony/Component/Intl/Resources/stubs/IntlDateFormatter.php',
],
];

0 comments on commit 78a88a4

Please sign in to comment.