Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 10.0.0-alpha.2 -- cleanup, twig prep, typehints #216

Merged
merged 58 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from 57 commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
9ae69c4
fix exception thrown when a user's password is about to expire
briskt May 24, 2024
e3730cc
fix exception thrown when a user is low on printable codes
briskt May 24, 2024
ac6b1c2
remove the cast to int
briskt May 27, 2024
e019a44
use material module for all tests
briskt May 27, 2024
5851807
ensure daysLeft is int
briskt May 27, 2024
80551ca
remove THEME_USE variable
briskt May 28, 2024
b9a3c4c
remove templates not used by material theme
briskt May 28, 2024
76f4b74
copy material theme templates to other modules
briskt May 28, 2024
2e239d3
generate browser.js path in the controller, not the template
briskt May 28, 2024
ab9637e
remove extra dot that messed up the browser.js hash
briskt May 28, 2024
3f4f1f9
pass the announcement in as a template parameter
briskt May 28, 2024
ba7eff6
move PHP code from other_mfas.php template into the controller
briskt May 28, 2024
cc41526
ensure recaptcha.siteKey is assigned in the controller
briskt May 28, 2024
de7c619
add announcement.php to actions-services.yml
briskt May 28, 2024
ddecb44
Merge remote-tracking branch 'origin/develop' into feature/always-mat…
briskt May 29, 2024
f454b8b
Merge remote-tracking branch 'origin/develop' into feature/fix-type-e…
briskt May 29, 2024
be25aca
update match strings in mfa tests
briskt May 29, 2024
3a24380
Merge branch 'feature/always-material' into feature/remove-default-theme
briskt May 29, 2024
308cb1e
Merge branch 'feature/remove-default-theme' into feature/twig-prep
briskt May 29, 2024
2e49085
insert blank line after opening php tag [skip ci]
briskt May 30, 2024
24fd66b
clarify comment about the purpose of authsources.php [skip ci]
briskt May 30, 2024
6f20c17
Merge pull request #207 from silinternational/feature/always-material
briskt May 30, 2024
3386802
Merge pull request #200 from silinternational/feature/fix-type-errors
briskt May 30, 2024
6b77463
Merge pull request #208 from silinternational/feature/remove-default-…
briskt May 30, 2024
352ef44
Merge pull request #209 from silinternational/feature/twig-prep
briskt May 30, 2024
f5b8856
remove xdebug and add instructions to README
briskt Jun 4, 2024
fa4cc40
use a new Docker arg to control composer install command flags
briskt Jun 4, 2024
608cce6
change container name to match docker-compose.yml
briskt Jun 4, 2024
2dbed26
change the composer flags in actions-services.yml
briskt Jun 4, 2024
b44307e
still need composer install for metadata tests
briskt Jun 4, 2024
339e387
Merge pull request #211 from silinternational/feature/misc
briskt Jun 4, 2024
9d6bd38
share the use of static functions in Mfa authproc
briskt Jun 4, 2024
0a1cdfd
add typehints
briskt Jun 6, 2024
adbc87b
update simpleSAMLphp files to version 1.19.8
briskt Jun 6, 2024
18dc22c
change session.cookie.samesite back to `null` to fix tests
briskt Jun 6, 2024
2c9a87d
allow null in typehint
briskt Jun 9, 2024
4cb55ef
Revert "share the use of static functions in Mfa authproc"
briskt Jun 11, 2024
3d28b7c
array return is not needed
briskt Jun 11, 2024
8eb1fca
add typehint on setUserAttributes
briskt Jun 11, 2024
191478c
typehint removeCategory
briskt Jun 11, 2024
c19a67b
restrict return type to int
briskt Jun 11, 2024
1e9bd5b
Merge branch 'feature/type-hinting' of github.com:silinternational/ss…
briskt Jun 11, 2024
cbe50dc
Update modules/sildisco/www/sp/discoresp.php
briskt Jun 11, 2024
59cf871
Merge pull request #214 from silinternational/feature/type-hinting
briskt Jun 11, 2024
5d884bd
Merge pull request #215 from silinternational/feature/sync-to-1-19-9
briskt Jun 11, 2024
f4c0934
save a screenshot when a test fails
briskt Jun 11, 2024
e983c4c
fix simplewebauthn/browser.js path
briskt Jun 11, 2024
0a7de22
allow mfa submission to be an array as well as a string
briskt Jun 11, 2024
ba13825
revert the namespace change on migration files
briskt Jun 11, 2024
a69735c
move the migration files to the old namespace to avoid yii treating t…
briskt Jun 11, 2024
282dc5a
move migrations into silauth directory and update yii2-config.php wit…
briskt Jun 11, 2024
9320d6d
ADMIN_EMAIL (technicalcontact_email) is not mandatory or required
briskt Jun 12, 2024
750fdf5
avoid a logged error in nag controller
briskt Jun 12, 2024
03f3b5e
better error handling for manager code request
briskt Jun 12, 2024
b8943b3
adding missing dependency AWS SDK and updated installed-packages.json
briskt Jun 12, 2024
b33f093
remove ADMIN_EMAIL dummy values for dev and test
briskt Jun 12, 2024
6a9993b
make ADMIN_EMAIL not required in test config also
briskt Jun 12, 2024
1a1e348
move optional variables out of the "required" section
briskt Jun 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
- name: test
run: docker-compose -f actions-services.yml run --rm app ./run-tests.sh
run: docker-compose -f actions-services.yml run --rm test ./run-tests.sh
briskt marked this conversation as resolved.
Show resolved Hide resolved
- name: check hub metadata for tests
run: docker-compose -f actions-services.yml run --rm ssp-hub.local ./run-metadata-tests.sh
- name: check idp metadata for tests
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ composer.phar
*.aes
dockercfg
node_modules/
features/screenshots/
8 changes: 7 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,22 @@ RUN curl https://raw.githubusercontent.com/silinternational/s3-expand/1.5/s3-exp
WORKDIR /data

# Install/cleanup composer dependencies
ARG COMPOSER_FLAGS="--prefer-dist --no-interaction --no-dev --optimize-autoloader --no-scripts --no-progress"
COPY composer.json /data/
COPY composer.lock /data/
RUN composer self-update --no-interaction
RUN COMPOSER_ALLOW_SUPERUSER=1 composer install --prefer-dist --no-interaction --no-dev --optimize-autoloader --no-scripts --no-progress
RUN COMPOSER_ALLOW_SUPERUSER=1 composer install $COMPOSER_FLAGS

ENV SSP_PATH /data/vendor/simplesamlphp/simplesamlphp

# Copy modules into simplesamlphp
COPY modules/ $SSP_PATH/modules

# Copy material theme templates to other modules, just in case the "default" theme is selected
COPY modules/material/themes/material/expirychecker/* $SSP_PATH/modules/expirychecker/templates/
COPY modules/material/themes/material/mfa/* $SSP_PATH/modules/mfa/templates/
COPY modules/material/themes/material/profilereview/* $SSP_PATH/modules/profilereview/templates/

# Copy in SSP override files
RUN mv $SSP_PATH/www/index.php $SSP_PATH/www/ssp-index.php
COPY dockerbuild/ssp-overrides/index.php $SSP_PATH/www/index.php
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ test-integration:
docker-compose run --rm test ./run-integration-tests.sh

copyJsLib:
cp ./node_modules/@simplewebauthn/browser/dist/bundle/index.umd.min.js ./modules/material/www/simplewebauthn/browser.js
cp ./node_modules/@simplewebauthn/browser/LICENSE.md ./www/simplewebauthn/LICENSE.md
cp ./node_modules/@simplewebauthn/browser/dist/bundle/index.umd.min.js ./modules/mfa/www/simplewebauthn/browser.js
cp ./node_modules/@simplewebauthn/browser/LICENSE.md ./modules/mfa/www/simplewebauthn/LICENSE.md

deps:
docker-compose run --rm node npm install --ignore-scripts
Expand Down
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,26 @@ will overwrite variables set in the execution environment.
4. `make` or `docker-compose up -d` within the project root.
5. Visit http://ssp-hub.local to see SimpleSAMLphp

### Configure a container for debugging with Xdebug

1. Add a volume map for run-debug.sh on the container you wish to debug.

```yml
- ./development/run-debug.sh:/data/run-debug.sh
```

2. Add or change the `command` for the container.

```yml
command: /data/run-debug.sh
```

3. Restart the container.

```shell
docker composer up -d ssp-hub.local
```

### Setup PhpStorm for remote debugging with Docker

1. Make sure you're running PhpStorm 2016.3 or later
Expand Down Expand Up @@ -192,7 +212,7 @@ Update `/simplesamlphp/config/config.php`:
'theme.use' => 'material:material'
```

This project provides a convenience by loading this config with whatever is in the environment variable `THEME_USE`._
This project sets this as the default value in the provided config file.

##### Google reCAPTCHA

Expand Down
22 changes: 7 additions & 15 deletions actions-services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ services:
MYSQL_USER: silauth
MYSQL_PASSWORD: silauth

app:
build: .
test:
build:
context: .
args:
COMPOSER_FLAGS: "--no-interaction --no-progress"
depends_on:
- ssp-hub.local
- ssp-idp1.local
Expand All @@ -28,7 +31,6 @@ services:
MYSQL_USER: silauth
MYSQL_PASSWORD: silauth
PROFILE_URL_FOR_TESTS: http://pwmanager.local/module.php/core/authenticate.php?as=ssp-hub
ADMIN_EMAIL: [email protected]
ADMIN_PASS: b
SECRET_SALT: abc123
IDP_NAME: x
Expand All @@ -53,6 +55,7 @@ services:

# Utilize custom configs
- ./development/hub/config/authsources.php:/data/vendor/simplesamlphp/simplesamlphp/config/authsources.php
- ./development/announcement.php:/data/vendor/simplesamlphp/simplesamlphp/announcement/announcement.php

# Utilize custom metadata
- ./development/hub/metadata/idp-remote.php:/data/vendor/simplesamlphp/simplesamlphp/metadata/idp-remote.php
Expand All @@ -63,14 +66,12 @@ services:
# Enable checking our test metadata
- ./dockerbuild/run-metadata-tests.sh:/data/run-metadata-tests.sh
environment:
ADMIN_EMAIL: "[email protected]"
ADMIN_PASS: "abc123"
SECRET_SALT: "not-secret-h57fjemb&dn^nsJFGNjweJ"
IDP_NAME: "Hub"
SECURE_COOKIE: "false"
ADMIN_PROTECT_INDEX_PAGE: "false"
SHOW_SAML_ERRORS: "true"
THEME_USE: "material:material"
THEME_COLOR_SCHEME: "orange-light_blue"
HUB_MODE: "true"

Expand All @@ -85,6 +86,7 @@ services:
# Utilize custom configs
- ./development/idp-local/config/authsources.php:/data/vendor/simplesamlphp/simplesamlphp/config/authsources.php
- ./development/idp-local/config/config.php:/data/vendor/simplesamlphp/simplesamlphp/config/config.php
- ./development/announcement.php:/data/vendor/simplesamlphp/simplesamlphp/announcement/announcement.php

# Utilize custom metadata
- ./development/idp-local/metadata/saml20-idp-hosted.php:/data/vendor/simplesamlphp/simplesamlphp/metadata/saml20-idp-hosted.php
Expand All @@ -102,7 +104,6 @@ services:
bash -c "whenavail db 3306 60 /data/vendor/simplesamlphp/simplesamlphp/modules/silauth/lib/Auth/Source/yii migrate --interactive=0 &&
/data/run.sh"
environment:
ADMIN_EMAIL: "[email protected]"
ADMIN_PASS: "a"
SECRET_SALT: "not-secret-h57fjemb&dn^nsJFGNjweJ"
IDP_NAME: "IDP 1"
Expand All @@ -117,7 +118,6 @@ services:
PROFILE_URL_FOR_TESTS: "http://pwmanager.local/module.php/core/authenticate.php?as=ssp-hub"
SECURE_COOKIE: "false"
SHOW_SAML_ERRORS: "true"
THEME_USE: "default"
MYSQL_HOST: "db"
MYSQL_DATABASE: "silauth"
MYSQL_USER: "silauth"
Expand All @@ -142,13 +142,11 @@ services:
- ./development/UserPass.php:/data/vendor/simplesamlphp/simplesamlphp/modules/exampleauth/lib/Auth/Source/UserPass.php

environment:
ADMIN_EMAIL: "[email protected]"
ADMIN_PASS: "b"
SECRET_SALT: "h57fjemb&dn^nsJFGNjweJ"
IDP_NAME: "IDP 2"
SECURE_COOKIE: "false"
SHOW_SAML_ERRORS: "true"
THEME_USE: "material:material"

ssp-idp3.local:
build: .
Expand All @@ -165,7 +163,6 @@ services:
- ./development/idp3-local/metadata/saml20-sp-remote.php:/data/vendor/simplesamlphp/simplesamlphp/metadata/saml20-sp-remote.php

environment:
ADMIN_EMAIL: "[email protected]"
ADMIN_PASS: "c"
SECRET_SALT: "h57fjem34fh*nsJFGNjweJ"
SECURE_COOKIE: "false"
Expand All @@ -188,7 +185,6 @@ services:
# Enable checking our test metadata
- ./dockerbuild/run-metadata-tests.sh:/data/run-metadata-tests.sh
environment:
ADMIN_EMAIL: "[email protected]"
ADMIN_PASS: "sp1"
SECRET_SALT: "not-secret-h57fjemb&dn^nsJFGNjweJz1"
SECURE_COOKIE: "false"
Expand All @@ -210,7 +206,6 @@ services:
- ./development/sp2-local/metadata/saml20-idp-remote.php:/data/vendor/simplesamlphp/simplesamlphp/metadata/saml20-idp-remote.php

environment:
ADMIN_EMAIL: [email protected]
ADMIN_PASS: sp2
SECRET_SALT: h57fjemb&dn^nsJFGNjweJz2
SECURE_COOKIE: "false"
Expand All @@ -232,7 +227,6 @@ services:
- ./development/sp3-local/metadata/saml20-idp-remote.php:/data/vendor/simplesamlphp/simplesamlphp/metadata/saml20-idp-remote.php

environment:
ADMIN_EMAIL: [email protected]
ADMIN_PASS: sp3
SECRET_SALT: h57fjemb&dn^nsJFGNjweJz3
SECURE_COOKIE: "false"
Expand All @@ -253,15 +247,13 @@ services:
# Utilize custom metadata
- ./development/sp-local/metadata/saml20-idp-remote.php:/data/vendor/simplesamlphp/simplesamlphp/metadata/saml20-idp-remote.php
environment:
ADMIN_EMAIL: [email protected]
ADMIN_PASS: sp1
IDP_NAME: THIS VARIABLE IS REQUIRED BUT PROBABLY NOT USED
SECRET_SALT: NOT-a-secret-k49fjfkw73hjf9t87wjiw
SECURE_COOKIE: "false"
SHOW_SAML_ERRORS: "true"
SAML20_IDP_ENABLE: "false"
ADMIN_PROTECT_INDEX_PAGE: "false"
THEME_USE: default

# the broker and brokerDb containers are used by the silauth module
broker:
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
"simplesamlphp/composer-module-installer": "1.1.8",
"rlanvin/php-ip": "^1.0",
"silinternational/ssp-utilities": "^1.1.0",
"silinternational/simplesamlphp-module-material": "^8.1.1",
"silinternational/simplesamlphp-module-sildisco": "^4.0.0",
"silinternational/php-env": "^3.1.0",
"silinternational/psr3-adapters": "^3.1",
"silinternational/yii2-json-log-targets": "^2.0",
Expand All @@ -32,7 +30,8 @@
"fillup/fake-bower-assets": "^2.0",
"google/recaptcha": "^1.1",
"psr/log": "^1.0",
"monolog/monolog": "^1.22"
"monolog/monolog": "^1.22",
"aws/aws-sdk-php": "^3.313"
},
"require-dev": {
"behat/behat": "^3.8",
Expand All @@ -46,7 +45,8 @@
"vendor/yiisoft/yii2/Yii.php"
],
"psr-4": {
"Sil\\SspBase\\Features\\": "features/"
"Sil\\SspBase\\Features\\": "features/",
"Sil\\SilAuth\\migrations\\": "modules/silauth/migrations/"
}
},
"config": {
Expand Down
Loading