arietimmerman / laravel-scim-server
Laravel SCIM服务器创建包
v1.1.1
2024-09-16 20:30 UTC
Requires
- php: ^8.0
- illuminate/console: ^8.0|^9.0|^10.0|^11.0
- illuminate/database: ^8.0|^9.0|^10.0|^11.0
- illuminate/support: ^8.0|^9.0|^10.0|^11.0
- tmilos/scim-filter-parser: ^1.3
- tmilos/scim-schema: ^0.1.0
Requires (Dev)
- laravel/legacy-factories: *
- orchestra/testbench: ^6.0|^7.0|^8.0|^9.0
- dev-master
- v1.1.1
- v1.1
- v1.0.9
- v1.0.8
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- v0.7.1
- v0.7.0
- v0.6.9
- v0.6.8
- v0.6.7
- v0.6.6
- v0.6.5
- v0.6.4
- v0.6.3
- v0.6.2
- v0.6.1
- v0.6.0
- v0.5.9
- v0.5.8
- v0.5.7
- v0.5.6
- v0.5.5
- v0.5.4
- v0.5.3
- v0.5.2
- v0.5.1
- v0.5.0
- dev-feature/roles-attribute
- dev-feature/allow-add-for-multiple
- dev-hotfix/null-filter-fix
- dev-feature/allow-defaults
- dev-hotfix/better-null-check
- dev-hotfix/fix-no-schema-attributes-in-return
- dev-feature/improved-get-default-schema
- dev-feature/omit-null-values
- dev-feature/cursor-pagination
- dev-feature/displayName-for-groups
- dev-feature/etag-by-default
- dev-feature/new-schema
- dev-feature/use-escaped-dots-for-validation
- dev-feature/improved-events
- dev-hotfix/fixes-bulkid-support
- dev-feature/bulk-operation-support
- dev-feature/custom-schema-test
- dev-feature/definition-of-schema-in-mapping-optional
- dev-feature/option-to-omit-main-schema
- dev-feature/support-for-php-9
- dev-bugfix/fix-for-php8
- dev-feature/publish-routes-optionally
- dev-feature/fixing-pipeline
- dev-feature/updated-packages
- dev-feature/updated-testbench
- dev-feature/enable-schema-routes-by-defaults
- dev-feature/dep-updates
- dev-feature/ci-fixes
This package is auto-updated.
Last update: 2024-09-16 20:31:47 UTC
README
Laravel SCIM 2.0 服务器实现
轻松添加 SCIM 2.0 服务器功能。通常,无需配置即可享受基本功能。
composer require arietimmerman/laravel-scim-server
可选
php artisan vendor:publish --tag=laravel-scim
该模块由 idaas.nl 和 SCIM Playground 使用。
路由
+----------+-----------------------------------------+
| GET|HEAD | scim/v1 |
| GET|HEAD | scim/v1/{fallbackPlaceholder} |
| POST | scim/v2/.search |
| | |
| GET|HEAD | scim/v2/ResourceTypes |
| GET|HEAD | scim/v2/ResourceTypes/{id} |
| GET|HEAD | scim/v2/Schemas |
| GET|HEAD | scim/v2/Schemas/{id} |
| GET|HEAD | scim/v2/ServiceProviderConfig |
| GET|HEAD | scim/v2/{fallbackPlaceholder} |
| | |
| GET|HEAD | scim/v2/{resourceType} |
| | |
| POST | scim/v2/{resourceType} |
| | |
| GET|HEAD | scim/v2/{resourceType}/{resourceObject} |
| | |
| PUT | scim/v2/{resourceType}/{resourceObject} |
| | |
| PATCH | scim/v2/{resourceType}/{resourceObject} |
| | |
| DELETE | scim/v2/{resourceType}/{resourceObject} |
| | |
+----------+-----------------------------------------+
配置
配置从 SCIMConfig::class
获取。
扩展此类并在 app/Providers/AppServiceProvider.php
中注册您的扩展,如下所示。
$this->app->singleton('ArieTimmerman\Laravel\SCIMServer\SCIMConfig', YourCustomSCIMConfig::class);
示例覆盖
以下是在不将太多 SCIMConfig 文件复制到您的应用中的情况下覆盖默认配置的一种方法。
<?php class YourCustomSCIMConfig extends \ArieTimmerman\Laravel\SCIMServer\SCIMConfig { public function getUserConfig() { $config = parent::getUserConfig(); // Modify the $config variable however you need... return $config; } }
安全性与应用集成
默认情况下,此包不会对其本身进行安全检查。这可能是危险的,因为一个功能正常的SCIM服务器可以查看、添加、更新、删除或列出用户。您可以在中间件层或应用合理的地方实施自己的安全检查。但请确保做点什么。
如果您想集成到已存在的中间件中,请执行以下步骤 -
关闭自动发布路由
按如下方式修改 config/scim.php
<?php return [ "publish_routes" => false ];
接下来,使用您选择的中间件显式发布您的路由
在您的 RouteServiceProvider 中,或在特定的路由文件中,添加以下内容
use ArieTimmerman\Laravel\SCIMServer\RouteProvider as SCIMServerRouteProvider; SCIMServerRouteProvider::publicRoutes(); // Make sure to add public routes *first* Route::middleware('auth:api')->group(function () { // or any other middleware you choose SCIMServerRouteProvider::routes( [ 'public_routes' => false // but do not hide public routes (metadata) behind authentication ] ); SCIMServerRouteProvider::meRoutes(); });
测试服务器
docker-compose up
现在访问 http://localhost:18123/scim/v2/Users
。