surfnet/stepup-gssp-bundle

A Symfony 6 扩展包,用于辅助创建 GSSP(通用 SAML Step-up 提供商)设备支持。

安装数: 3,066

依赖项: 0

建议者: 0

安全: 0

星标: 1

关注者: 10

分支: 0

开放问题: 1

类型:symfony-bundle


README

Run tests (static analysis, lint and unit tests) Run acceptance tests (Behat)

通用 SAML Stepup 提供商 扩展包。

安装

  • 将包添加到您的 Composer 文件中
composer require surfnet/stepup-gssp-bundle
  • 将扩展包添加到您的内核中 app/AppKernel.php
public function registerBundles()
{
  // ...
  $bundles[] = new Surfnet\SamlBundle\SurfnetSamlBundle();
  $bundles[] = new Surfnet\GsspBundle\GsspBundle();
}

配置

config.yml

surfnet_saml:
    hosted:
        identity_provider:
            enabled: true
            service_provider_repository: surfnet_gssp.saml.service_provider_repository
            sso_route: sso
            public_key: "%saml_idp_publickey%"
            private_key: "%saml_idp_privatekey%"
        metadata:
            entity_id_route: gssp_saml_metadata
            public_key: "%saml_metadata_publickey%"
            private_key: "%saml_metadata_privatekey%"
    remote:
        identity_provider:
            enabled: true
            entity_id: "%saml_remote_idp_entity_id%"
            sso_url: "%saml_remote_idp_sso_url%"
            certificate_file: "%saml_remote_idp_certificate%"
            
            
surfnet_gssp:
    registration_route: '<your-registration-route>'
    authentication_route: '<your-authentication-route>'             

有关“surfnet_saml”配置的更多信息,请参阅Saml 扩展包文档

示例控制器中查看“surfnet_gssp”路由的工作示例

AuthenticationService 和 RegistrationService 是应用程序与该扩展包交互的 API。这两个服务都提供了一个如何在控制器操作中使用它们的示例。

routing.yml

gssp_saml:
    resource: '@SurfnetGsspBundle/Resources/config/routing.yml'

parameters.yml

parameters:
    saml_idp_publickey: '%kernel.root_dir%/../vendor/surfnet/stepup-saml-bundle/src/Resources/keys/development_publickey.cer'
    saml_idp_privatekey: '%kernel.root_dir%/../vendor/surfnet/stepup-saml-bundle/src/Resources/keys/development_privatekey.pem'
    saml_metadata_publickey: '%kernel.root_dir%/../vendor/surfnet/stepup-saml-bundle/src/Resources/keys/development_publickey.cer'
    saml_metadata_privatekey: '%kernel.root_dir%/../vendor/surfnet/stepup-saml-bundle/src/Resources/keys/development_privatekey.pem'
    saml_remote_idp_entity_id: 'https://pieter.aai.surfnet.nl/simplesamlphp/saml2/idp/metadata.php'
    saml_remote_idp_sso_url: 'https://pieter.aai.surfnet.nl/simplesamlphp/saml2/idp/SSOService.php'
    saml_remote_idp_certificate: '%kernel.root_dir%/../vendor/surfnet/stepup-gssp-bundle/src/Resources/keys/pieter.aai.surfnet.nl.pem'

这是与 pieter.aai.surfnet.nl idp 一起工作的示例 idp 配置。

开发环境

开发环境的目的仅限于运行不同的测试和指标工具。

要开始,首先设置开发环境。开发环境是一个 docker 容器。它通过 OpenConext-devconf 项目进行控制。

下面描述的每个任务都应该从该容器中运行。

要求

  • Docker
  • OpenConext-devconf

调试

在配置您的开发 Vagrant 盒子时配置了 Xdebug。它配置了自动连接 IDE_KEY=phpstorm 和 xon 在 cli 环境中。

测试和指标

要运行所有必要的测试,您可以从开发环境中运行以下命令

composer test

每个部分都可以单独运行。检查 composer.json 文件中的“scripts”部分以获取不同的选项。

发布说明

请阅读:https://github.com/OpenConext/Stepup-Deploy/wiki/Release-Management 了解 Stepup 项目中使用的发布策略的更多信息。

其他资源