diff --git a/publish/saml.php b/publish/saml.php new file mode 100644 index 0000000..f0ef930 --- /dev/null +++ b/publish/saml.php @@ -0,0 +1,25 @@ + 'sp', + // 'type' => 'idp', + + 'server' => [ + 'idp_id' => '', // 单点登录 + + // sp config + // 以下内容向服务端申请 + 'idp_assertion_url' => '', // 判断用户是否登录 + 'idp_logout_url' => '', //单点退出 + ], + 'client' => [ + // idp config + + // sp config + // 以下内容向服务端申请 + 'entity_id' => '', // 业务系统唯一标识 + 'acs_url' => '', // 回调地址 + ], +]; \ No newline at end of file diff --git a/src/ConfigProvider.php b/src/ConfigProvider.php index 0343cd0..ce8a80e 100644 --- a/src/ConfigProvider.php +++ b/src/ConfigProvider.php @@ -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', // 复制为这个路径下的该文件 + ], ]; } }