Skip to content

Commit 2a9ee20

Browse files
committed
Initial import
0 parents  commit 2a9ee20

File tree

12 files changed

+507
-0
lines changed

12 files changed

+507
-0
lines changed

.codecov.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
coverage:
2+
status:
3+
project: yes
4+
5+
comment:
6+
layout: "diff"
7+
behavior: once
8+
require_changes: true
9+
require_base: no
10+
require_head: yes
11+
branches: null

.php_cs.dist

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
$finder = PhpCsFixer\Finder::create()
3+
->in([
4+
__DIR__ . '/lib',
5+
__DIR__ . '/tests',
6+
])
7+
;
8+
return PhpCsFixer\Config::create()
9+
->setRules([
10+
'@PSR2' => true,
11+
'@PSR4' => true,
12+
'@PSR5' => true,
13+
])
14+
->setFinder($finder)
15+
;

.travis.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
sudo: required
2+
3+
language: php
4+
5+
php:
6+
- 5.6
7+
- 7.0
8+
- 7.1
9+
- 7.2
10+
- 7.3
11+
12+
env:
13+
- SIMPLESAMLPHP_VERSION=1.17.*
14+
15+
matrix:
16+
allow_failures:
17+
- php: 7.3
18+
19+
before_script:
20+
- composer require "simplesamlphp/simplesamlphp:${SIMPLESAMLPHP_VERSION}" --no-update
21+
- composer update --no-interaction
22+
- if [[ "$TRAVIS_PHP_VERSION" == "7.3" ]]; then composer require --dev vimeo/psalm; fi
23+
24+
script:
25+
- bin/check-syntax.sh
26+
- if [[ "$TRAVIS_PHP_VERSION" == "5.6" ]]; then php vendor/phpunit/phpunit/phpunit; else php vendor/phpunit/phpunit/phpunit --no-coverage; fi
27+
- if [[ "$TRAVIS_PHP_VERSION" == "7.3" ]]; then vendor/bin/psalm; fi
28+
29+
after_success:
30+
# Codecov, need to edit bash uploader for incorrect TRAVIS_PYTHON_VERSION environment variable matching, at least until codecov/codecov-bash#133 is resolved
31+
- curl -s https://codecov.io/bash > .codecov
32+
- sed -i -e 's/TRAVIS_.*_VERSION/^TRAVIS_.*_VERSION=/' .codecov
33+
- chmod +x .codecov
34+
- if [[ $TRAVIS_PHP_VERSION == "5.6" ]]; then ./.codecov -X gcov; fi
35+
# - if [[ "$TRAVIS_PHP_VERSION" == "5.6" ]]; then bash <(curl -s https://codecov.io/bash); fi

bin/check-syntax.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
3+
PHP='/usr/bin/env php'
4+
RETURN=0
5+
6+
# check PHP files
7+
for FILE in `find lib tests -name "*.php"`; do
8+
$PHP -l $FILE > /dev/null 2>&1
9+
if [ $? -ne 0 ]; then
10+
echo "Syntax check failed for ${FILE}"
11+
RETURN=`expr ${RETURN} + 1`
12+
fi
13+
done
14+
15+
exit $RETURN

composer.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"name": "simplesamlphp/simplesamlphp-module-cas",
3+
"description": "A module that provides CAS authentication",
4+
"type": "simplesamlphp-module",
5+
"keywords": ["simplesamlphp", "cas"],
6+
"license": "LGPL-3.0-or-later",
7+
"authors": [
8+
{
9+
"name": "Olav Morken",
10+
"email": "[email protected]"
11+
}
12+
],
13+
"config": {
14+
"preferred-install": {
15+
"simplesamlphp/simplesamlphp": "source",
16+
"*": "dist"
17+
}
18+
},
19+
"autoload": {
20+
"psr-4": {
21+
"SimpleSAML\\Module\\cas\\": "lib/"
22+
}
23+
},
24+
"autoload-dev": {
25+
"psr-4": {
26+
"SimpleSAML\\Test\\Utils\\": "vendor/simplesamlphp/simplesamlphp/tests/Utils"
27+
}
28+
},
29+
"require": {
30+
"php": ">=5.6",
31+
"simplesamlphp/composer-module-installer": "~1.1",
32+
"webmozart/assert": "~1.4"
33+
},
34+
"require-dev": {
35+
"simplesamlphp/simplesamlphp": "^1.17",
36+
"phpunit/phpunit": "~5.7"
37+
},
38+
"support": {
39+
"issues": "https://github.com/tvdijen/simplesamlphp-module-cas/issues",
40+
"source": "https://github.com/tvdijen/simplesamlphp-module-cas"
41+
}
42+
}

default-enable

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
This file indicates that the default state of this module
2+
is enabled. To disable, create a file named disable in the
3+
same directory as this file.

docs/cas.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
Using the CAS authentication source with SimpleSAMLphp
2+
==========================================================
3+
4+
This is completely based on the original cas authentication,
5+
the only diffrence is this is authentication module and not a script.
6+
7+
Setting up the CAS authentication module
8+
----------------------------------
9+
10+
The first thing you need to do is to enable the cas module:
11+
12+
touch modules/cas/enable
13+
14+
Adding a authentication source
15+
16+
example authsource.php
17+
----------------------------------
18+
19+
'example-cas' => array(
20+
'cas:CAS',
21+
'cas' => array(
22+
'login' => 'https://cas.example.com/login',
23+
'validate' => 'https://cas.example.com/validate',
24+
'logout' => 'https://cas.example.com/logout'
25+
),
26+
'ldap' => array(
27+
'servers' => 'ldaps://ldaps.example.be:636/',
28+
'enable_tls' => true,
29+
'searchbase' => 'ou=people,dc=org,dc=com',
30+
'searchattributes' => 'uid',
31+
'attributes' => array('uid','cn'),
32+
'priv_user_dn' => 'cn=simplesamlphp,ou=applications,dc=org,dc=com',
33+
'priv_user_pw' => 'password',
34+
35+
),
36+
),

0 commit comments

Comments
 (0)