diff --git a/examples/ehcache/src/test/java/com/giffing/bucket4j/spring/boot/starter/examples/ehcache/EhcacheGeneralSuiteTest.java b/examples/ehcache/src/test/java/com/giffing/bucket4j/spring/boot/starter/examples/ehcache/EhcacheGeneralSuiteTest.java index 7821b066..dcfd47e8 100644 --- a/examples/ehcache/src/test/java/com/giffing/bucket4j/spring/boot/starter/examples/ehcache/EhcacheGeneralSuiteTest.java +++ b/examples/ehcache/src/test/java/com/giffing/bucket4j/spring/boot/starter/examples/ehcache/EhcacheGeneralSuiteTest.java @@ -1,6 +1,5 @@ package com.giffing.bucket4j.spring.boot.starter.examples.ehcache; -import com.giffing.bucket4j.spring.boot.starter.general.tests.filter.method.MethodTestSuite; import com.giffing.bucket4j.spring.boot.starter.general.tests.filter.servlet.ServletTestSuite; import org.junit.platform.suite.api.SelectClasses; import org.junit.platform.suite.api.Suite; @@ -8,7 +7,6 @@ @Suite @SelectClasses({ ServletTestSuite.class, - MethodTestSuite.class, }) public class EhcacheGeneralSuiteTest { } diff --git a/src/main/doc/plantuml/post_execution_condition.plantuml b/src/main/doc/plantuml/post_execution_condition.plantuml index 7f35233f..22c89377 100644 --- a/src/main/doc/plantuml/post_execution_condition.plantuml +++ b/src/main/doc/plantuml/post_execution_condition.plantuml @@ -1,30 +1,35 @@ @startuml -== First Request - 1 Token available == - -User -> Bucket4jFilter: webRequest -box "Webserver" #LightBlue -participant Bucket4jFilter -participant SpringSecurityFilter - -Bucket4jFilter -> Bucket4jFilter : check remaining tokens -Bucket4jFilter -> SpringSecurityFilter : tokens available proceed -SpringSecurityFilter -> SpringSecurityFilter : authenticate -SpringSecurityFilter -> Bucket4jFilter : authentication Failed 401 -Bucket4jFilter -> Bucket4jFilter : if response status 401 consume token -Bucket4jFilter -> User : response 401 -end box +User -> Bucket4jFilter: request + +box "Webserver" #f5e4e4 + + Bucket4jFilter -> Bucket4jFilter : estimate_remaining_tokens + participant Bucket4jFilter + participant SpringSecurityFilter + alt 1 token available + + note right of Bucket4jFilter: There is one token available. \nThe request will not be aborted + Bucket4jFilter -> SpringSecurityFilter : request + SpringSecurityFilter -> SpringSecurityFilter : authenticate + SpringSecurityFilter -> Bucket4jFilter : response(401) + alt HTTP Response Status == 401 + note right of Bucket4jFilter: The token will only be consumed\n if the HTTP Status is 401\n + Bucket4jFilter -> Bucket4jFilter : consume_token + end + Bucket4jFilter -> User : response(401) + + else 0 token available + note right of Bucket4jFilter: The token was consumed \nbecause of the HTTP Response Status 401 + Bucket4jFilter -> Bucket4jFilter : reject request + Bucket4jFilter -> User : response\n(429 Too Many Requests) + end + -== Second Request - 0 Token available == -User -> Bucket4jFilter: webRequest -box "Webserver" #LightBlue -participant Bucket4jFilter -participant SpringSecurityFilter -Bucket4jFilter -> Bucket4jFilter : check remaining tokens -> no token available -Bucket4jFilter -> User : reject request 429 end box + @enduml \ No newline at end of file diff --git a/src/main/doc/plantuml/post_execution_condition.png b/src/main/doc/plantuml/post_execution_condition.png index 8490255a..31f3f8cb 100644 Binary files a/src/main/doc/plantuml/post_execution_condition.png and b/src/main/doc/plantuml/post_execution_condition.png differ