cyberspectrum/api-platform-toolkit-bundle

一些方便的工具包,用于更有效地使用api-platform/core

dev-master / 1.0.x-dev 2022-05-04 09:07 UTC

This package is auto-updated.

Last update: 2024-03-04 12:57:51 UTC


README

安装

composer require cyberspectrum/api-platform-toolkit-bundle

配置

api_platform_toolkit:
  # Enable custom expression language providers
  enable_expression_language: true
  # Enable JWT handling - this can be disabled.
  lexik_jwt:
    # Enable documentation handling (adds the login endpoint to swagger docs).
    add_documentation: true
    # The default ttl if not specified in request (defaults to 3600)
    default_ttl: 3600
    # The login url.
    login_url: '/api/login_check'

功能

向表达式语言添加自己的提供者。

此包支持向api平台表达式语言添加标记化服务。

要添加自己的ExpressionFunctionProviderInterface实现,请使用此服务注册

App\ExpressionLanguage\SomeExpressionLanguageProvider:
    tags:
        - { name: csap_toolkit.security.expression_language }

待办事项

  • api-platform/core的表达式语言支持提交PR。
  • 使JWT TTL支持配置可选。
  • 为JWT TTL添加最小和最大值支持。