Skip to content

Commit c6d848d

Browse files
Development flow improvements (#117)
* Development flow improvements * use scimconfig for now
1 parent 6f48690 commit c6d848d

File tree

13 files changed

+1517
-128
lines changed

13 files changed

+1517
-128
lines changed

.devcontainer/Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM mcr.microsoft.com/devcontainers/php:8.2
2+
3+
# Create Laravel test project directory in vscode user home
4+
USER vscode
5+
RUN mkdir -p /home/vscode/laravel-test
6+
7+
# Expose port 8000 for Laravel
8+
EXPOSE 8000
9+
10+
# Create setup script for Laravel test environment
11+
COPY ./setup-laravel-test.sh /usr/local/bin/setup-laravel-test.sh
12+
USER root
13+
RUN chmod +x /usr/local/bin/setup-laravel-test.sh
14+
USER vscode

.devcontainer/devcontainer.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/php
3+
{
4+
"name": "Laravel SCIM Server Dev",
5+
// Use the Dockerfile in the .devcontainer folder
6+
"build": {
7+
"dockerfile": "Dockerfile",
8+
"context": "."
9+
},
10+
11+
// Configure tool-specific properties
12+
"customizations": {
13+
"vscode": {
14+
"extensions": [
15+
"bmewburn.vscode-intelephense-client",
16+
"xdebug.php-debug",
17+
"mikestead.dotenv",
18+
"mehedidracula.php-namespace-resolver",
19+
"recca0120.vscode-phpunit",
20+
"formulahendry.terminal",
21+
"junstyle.php-cs-fixer"
22+
],
23+
"settings": {
24+
"php.validate.executablePath": "/usr/local/bin/php"
25+
}
26+
}
27+
},
28+
29+
// Use 'forwardPorts' to make a list of ports inside the container available locally
30+
"forwardPorts": [8000],
31+
32+
// Use 'postCreateCommand' to run commands after the container is created
33+
"postCreateCommand": "composer install",
34+
35+
// Add a non-root user to run the server
36+
"remoteUser": "vscode"
37+
}

.devcontainer/setup-laravel-test.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# Create Laravel project if it doesn't exist
5+
if [ ! -d "/home/vscode/laravel-test/vendor" ]; then
6+
echo "Creating new Laravel project..."
7+
cd /home/vscode
8+
composer create-project --prefer-dist laravel/laravel laravel-test
9+
10+
cd laravel-test
11+
12+
# Add the local package as a repository
13+
jq '.repositories=[{"type": "path","url": "/workspaces/laravel-scim-server"}]' ./composer.json > composer.json.tmp && mv composer.json.tmp composer.json
14+
15+
# Require the package and laravel/tinker
16+
composer require arietimmerman/laravel-scim-server @dev
17+
composer require laravel/tinker
18+
19+
# Set up SQLite database
20+
touch ./.database.sqlite
21+
echo "DB_CONNECTION=sqlite" >> ./.env
22+
echo "DB_DATABASE=/home/vscode/laravel-test/.database.sqlite" >> ./.env
23+
24+
# Run migrations
25+
php artisan migrate
26+
27+
# Create test users
28+
echo "User::factory()->count(100)->create();" | php artisan tinker
29+
30+
echo "Laravel test environment setup complete!"
31+
else
32+
echo "Laravel test environment already exists!"
33+
fi

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
vendor
2+
.phpunit.result.cache

.vscode/launch.json

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
8+
{
9+
"name": "Listen for Xdebug",
10+
"type": "php",
11+
"request": "launch",
12+
"port": 9000
13+
},
14+
{
15+
"name": "Launch currently open script",
16+
"type": "php",
17+
"request": "launch",
18+
"program": "${file}",
19+
"cwd": "${fileDirname}",
20+
"port": 0,
21+
"runtimeArgs": [
22+
"-dxdebug.start_with_request=yes"
23+
],
24+
"env": {
25+
"XDEBUG_MODE": "debug,develop",
26+
"XDEBUG_CONFIG": "client_port=${port}"
27+
}
28+
},
29+
{
30+
"name": "Launch Built-in web server",
31+
"type": "php",
32+
"request": "launch",
33+
"runtimeArgs": [
34+
"-dxdebug.mode=debug",
35+
"-dxdebug.start_with_request=yes",
36+
"-S",
37+
"localhost:0"
38+
],
39+
"program": "",
40+
"cwd": "${workspaceRoot}",
41+
"port": 9003,
42+
"serverReadyAction": {
43+
"pattern": "Development Server \\(http://localhost:([0-9]+)\\) started",
44+
"uriFormat": "http://localhost:%s",
45+
"action": "openExternally"
46+
}
47+
}
48+
]
49+
}

.vscode/settings.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"php.validate.enable": true,
3+
"php.validate.run": "onType",
4+
"php.validate.executablePath": "/usr/local/bin/php",
5+
"php-cs-fixer.executablePath": "/workspaces/laravel-scim-server/vendor/bin/php-cs-fixer",
6+
"files.associations": {
7+
"*.php": "php"
8+
},
9+
"[php]": {
10+
"editor.formatOnSave": true
11+
}
12+
}

.vscode/tasks.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "Setup Laravel SCIM Test Server",
6+
"type": "shell",
7+
"command": "setup-laravel-test.sh",
8+
"problemMatcher": [],
9+
"presentation": {
10+
"reveal": "always",
11+
"panel": "new"
12+
},
13+
"group": "test"
14+
},
15+
{
16+
"label": "Start Laravel SCIM Test Server",
17+
"type": "shell",
18+
"command": "export XDEBUG_MODE=debug,develop && cd /home/vscode/laravel-test && COMPOSER_AUTOLOAD_DEV=1 composer dump-autoload && php artisan serve --host=0.0.0.0 --port=8000",
19+
"dependsOn": "Setup Laravel SCIM Test Server",
20+
"problemMatcher": [],
21+
"presentation": {
22+
"reveal": "always",
23+
"panel": "dedicated"
24+
},
25+
"group": "test"
26+
},
27+
{
28+
"label": "Open SCIM Server in Browser",
29+
"type": "shell",
30+
"command": "$BROWSER http://localhost:8000/scim/v2/Users",
31+
"problemMatcher": [],
32+
"group": "test"
33+
}
34+
]
35+
}

README.md

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,17 @@
33
[![Latest Stable Version](https://poser.pugx.org/arietimmerman/laravel-scim-server/v/stable)](https://packagist.org/packages/arietimmerman/laravel-scim-server)
44
[![Total Downloads](https://poser.pugx.org/arietimmerman/laravel-scim-server/downloads)](https://packagist.org/packages/arietimmerman/laravel-scim-server)
55

6+
![Logo of Laravel SCIM Server, the SCIM server implementation from scim.dev, SCIM Playground](./laravel-scim-server.svg)
7+
68
# SCIM 2.0 Server implementation for Laravel
79

8-
Add SCIM 2.0 Server capabilities with ease. Usually, no configuration is needed in order to benefit from the basic functionalities.
10+
Add SCIM 2.0 Server capabilities to your Laravel application with ease. This package requires minimal configuration to get started with basic functionalities.
11+
12+
This implementation is used by [The SCIM Playground](https://scim.dev) and is therefore one of the most widely tested SCIM servers available.
13+
14+
## Installation
15+
16+
Simply run:
917

1018
~~~
1119
composer require arietimmerman/laravel-scim-server
@@ -17,37 +25,29 @@ And optionally
1725
php artisan vendor:publish --tag=laravel-scim
1826
~~~
1927

20-
The module is used by [idaas.nl](https://www.idaas.nl/) and by [The SCIM Playground](https://scim.dev).
21-
2228
# Routes
2329

24-
~~~
25-
+----------+-----------------------------------------+
26-
| GET|HEAD | scim/v1 |
27-
| GET|HEAD | scim/v1/{fallbackPlaceholder} |
28-
| POST | scim/v2/.search |
29-
| | |
30-
| GET|HEAD | scim/v2/ResourceTypes |
31-
| GET|HEAD | scim/v2/ResourceTypes/{id} |
32-
| GET|HEAD | scim/v2/Schemas |
33-
| GET|HEAD | scim/v2/Schemas/{id} |
34-
| GET|HEAD | scim/v2/ServiceProviderConfig |
35-
| GET|HEAD | scim/v2/{fallbackPlaceholder} |
36-
| | |
37-
| GET|HEAD | scim/v2/{resourceType} |
38-
| | |
39-
| POST | scim/v2/{resourceType} |
40-
| | |
41-
| GET|HEAD | scim/v2/{resourceType}/{resourceObject} |
42-
| | |
43-
| PUT | scim/v2/{resourceType}/{resourceObject} |
44-
| | |
45-
| PATCH | scim/v2/{resourceType}/{resourceObject} |
46-
| | |
47-
| DELETE | scim/v2/{resourceType}/{resourceObject} |
48-
| | |
49-
+----------+-----------------------------------------+
50-
~~~
30+
| Method | Path |
31+
|--------|------|
32+
| GET\|HEAD | / |
33+
| GET\|HEAD | scim/v1 |
34+
| GET\|HEAD | scim/v1/{fallbackPlaceholder} |
35+
| POST | scim/v2/.search |
36+
| POST | scim/v2/Bulk |
37+
| GET\|HEAD | scim/v2/ResourceTypes |
38+
| GET\|HEAD | scim/v2/ResourceTypes/{id} |
39+
| GET\|HEAD | scim/v2/Schemas |
40+
| GET\|HEAD | scim/v2/Schemas/{id} |
41+
| GET\|HEAD | scim/v2/ServiceProviderConfig |
42+
| GET\|HEAD | scim/v2/{fallbackPlaceholder} |
43+
| GET\|HEAD | scim/v2/{resourceType} |
44+
| POST | scim/v2/{resourceType} |
45+
| POST | scim/v2/{resourceType}/.search |
46+
| GET\|HEAD | scim/v2/{resourceType}/{resourceObject} |
47+
| PUT | scim/v2/{resourceType}/{resourceObject} |
48+
| PATCH | scim/v2/{resourceType}/{resourceObject} |
49+
| DELETE | scim/v2/{resourceType}/{resourceObject} |
50+
5151

5252
# Configuration
5353

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
},
3131
"require-dev": {
3232
"orchestra/testbench": "^6.0|^7.0|^8.0|^9.0|^10.0",
33-
"laravel/legacy-factories": "*"
33+
"laravel/legacy-factories": "*",
34+
"friendsofphp/php-cs-fixer": "^3.66"
3435
},
3536

3637
"extra": {

0 commit comments

Comments
 (0)