mirror of
http://124.126.16.154:8888/singularity/hyperf-saml.git
synced 2026-01-15 07:15:05 +08:00
feat(config): 更新了配置文件,和 ConfigProvider
This commit is contained in:
25
publish/saml.php
Normal file
25
publish/saml.php
Normal 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' => '', // 回调地址
|
||||
],
|
||||
];
|
||||
@@ -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', // 复制为这个路径下的该文件
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user