surfnet/stepup-middleware-client-bundle

Symfony 5|6 的Bundle,用于消费Step-up Middleware API。


README

Build status

一个用于消费Step-up Middleware API的Symfony 6 Bundle。有关概述,请参阅Stepup-Deploy

要求

安装

  • 将包添加到您的Composer文件中

    composer require surfnet/stepup-middleware-client-bundle
  • 将Bundle添加到您的Kernel在 app/AppKernel.php

    public function registerBundles()
    {
        // ...
        $bundles[] = new Surfnet\StepupMiddlewareClientBundle\SurfnetStepupMiddlewareClientBundle;
    }

配置

surfnet_stepup_middleware_client:
    authorisation:
        username: john
        password: doe
    url:
        command_api: http://middleware.tld/command

用法

执行命令

# In the context of a Symfony2 controller action
$command = new \Surfnet\StepupMiddlewareClientBundle\Identity\Command\CreateIdentityCommand();
$command->id = \Surfnet\StepupMiddlewareClientBundle\Uuid\Uuid::generate();
$command->nameId = \Surfnet\StepupMiddlewareClientBundle\Uuid\Uuid::generate();

/** @var \Surfnet\StepupMiddlewareClientBundle\Service\CommandService $service */
$service = $this->get('surfnet_stepup_middleware_client.service.command');
$result = $service->execute($command);

读取DTO

/** @var \Surfnet\StepupMiddlewareClientBundle\Identity\Service\IdentityService $service */
$service = $container->get('surfnet_stepup_middleware_client.identity.service.identity');
/** @var null|\Surfnet\StepupMiddlewareClientBundle\Identity\Dto\Identity */
$identity = $service->get($id);

发布策略

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