feat(config): 更新了配置文件,和 ConfigProvider

This commit is contained in:
李东云
2022-03-29 20:52:17 +08:00
parent 6eda68bba3
commit 5b2b3effde
2 changed files with 41 additions and 2 deletions

25
publish/saml.php Normal file
View File

@@ -0,0 +1,25 @@
<?php
declare(strict_types=1);
return [
'type' => 'sp',
// 'type' => 'idp',
'server' => [
'idp_id' => '', // 单点登录
// sp config
// 以下内容向服务端申请
'idp_assertion_url' => '', // 判断用户是否登录
'idp_logout_url' => '', //单点退出
],
'client' => [
// idp config
// sp config
// 以下内容向服务端申请
'entity_id' => '', // 业务系统唯一标识
'acs_url' => '', // 回调地址
],
];

View File

@@ -9,6 +9,7 @@ declare(strict_types=1);
* @contact group@hyperf.io
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/
namespace Singularity\HyperfSaml;
class ConfigProvider
@@ -16,10 +17,10 @@ class ConfigProvider
public function __invoke(): array
{
return [
// 合并到 config/autoload/dependencies.php 文件
'dependencies' => [
],
'commands' => [
],
// 合并到 config/autoload/annotations.php 文件
'annotations' => [
'scan' => [
'paths' => [
@@ -27,6 +28,19 @@ class ConfigProvider
],
],
],
// 默认 Command 的定义,合并到 Hyperf\Contract\ConfigInterface 内,换个方式理解也就是与 config/autoload/commands.php 对应
'commands' => [
],
// 与 commands 类似
'listeners' => [],
// 组件默认配置文件,即执行命令后会把 source 的对应的文件复制为 destination 对应的的文件
'publish' => [
'id' => 'config',
'description' => 'The config of SAML.', // 描述
// 建议默认配置放在 publish 文件夹中,文件命名和组件名称相同
'source' => __DIR__ . '/../publish/saml.php', // 对应的配置文件路径
'destination' => BASE_PATH . '/config/autoload/saml.php', // 复制为这个路径下的该文件
],
];
}
}