Skip to content

[RateLimiter] [XML] The attribute 'policy' is not allowed. #49671

Closed
@dariuszkaminski

Description

@dariuszkaminski

Symfony version(s) affected

5.4+

Description

I'm using the XML version config.

<framework:config>
    <framework:rate-limiter>
        <framework:limiter name="access_setting_update"
               policy="sliding_window"
               limit="30"
               interval="3 minutes"
        />
    </framework:rate-limiter>
</framework:config>

The application works, but calling debug:container causes the error below.

[ERROR 1866] Element '{http://symfony.com/schema/dic/symfony}limiter', attribute 'policy': The attribute 'policy' is not allowed. (in /var/www/ - line 16, column 0)

Further digging in the code led me to a probable error in the XSD. The policy attribute does not appear in XSD, but we see strategy. When we use strategy we get the following error within the whole application.

Unrecognized option "strategy" under "framework.rate_limiter.limiters.access_setting_update". Available options are "cache_pool", "interval", "limit", "lock_factory", "policy", "rate", "storage_service".

How to reproduce

  1. Install Rate Limiter
  2. Setup configuration in XML
  3. Run debug:container console command

Possible Solution

Change attribute strategy to policy in rate_limiter_limiter section in symfony-1.0.xsd.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions