Skip to content

Document Kubernetes Kit backend session expiration policy #4144

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
May 8, 2025

Conversation

TatuLund
Copy link
Contributor


== Backend Session Expiration Policy

Backend session expiration policy allows to define an expiration timeout for the backend stored session. By default no expiration is set, but can be expiration can be activated setting the property or by providing a custom SessionExpirationPolicy bean. If no unit is provided in the property, seconds are assumed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By implementing the SessionExpirationPolicy interface, the developer can define the expiration timeout.
However, the property does not define the timeout value, but the amount of time to be added to the HTTP session timeout to determine the expiration of the backend session. If time unit is not given, milliseconds is assumed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to add also a SessionExpirationPolicy implementation example

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for clarification

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this suffice for code example?

    @Bean
    SessionExpirationPolicy sessionExpirationPolicy() {
        return Duration.ofMinutes(60);
    }

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SessionExpirationPolicy.apply() method takes current HTTP session timeout as argument

@Bean
SessionExpirationPolicy sessionExpirationPolicy() {
    return sessionTimeout -> Duration.ofMinutes(60);
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If time unit is not given, milliseconds is assumed.

This may be the default, but it's not particularly useful. If seconds are more appropriate, perhaps the property should be annotated with @DurationUnit(ChronoUnit.SECONDS) and the original phrasing kept?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sound a good idea

TatuLund and others added 3 commits February 24, 2025 12:46
Co-authored-by: Matthew Wilson <98319962+MatthewVaadin@users.noreply.github.com>
TatuLund and others added 2 commits February 24, 2025 15:00
Co-authored-by: Marco Collovati <marco@vaadin.com>
Co-authored-by: Marco Collovati <marco@vaadin.com>
@russelljtdyer russelljtdyer added Language checking English language and AsciiDoc formatting checking is in progress and removed Language unchecked labels Feb 28, 2025
@russelljtdyer russelljtdyer added Language checked English language and AsciiDoc formatting checks done and removed Language checking English language and AsciiDoc formatting checking is in progress labels Feb 28, 2025
@jorgheymans
Copy link
Contributor

Are these docs scheduled for publishing anytime soon ?

Co-authored-by: Jorg Heymans <jorg.heymans@gmail.com>
Copy link

github-actions bot commented May 7, 2025

AI Language Review

The newly added section on "Backend Session Expiration Policy" is clear and well-structured. The example code is correctly formatted, and the explanation is understandable. There are no issues requiring improvement.

@mcollovati
Copy link
Contributor

@MatthewVaadin do you think it is ok to merge?

@MatthewVaadin
Copy link
Contributor

I'm still concerned that we don't have consistency across the examples, or an explanation that the Java example works differently than the other two. In my "resolved" review I proposed a fix that already included the corrected spelling mistake, along with a layout that allows a description for each example without resorting to in-example comments.

@MatthewVaadin MatthewVaadin merged commit 49af526 into latest May 8, 2025
4 of 5 checks passed
@MatthewVaadin MatthewVaadin deleted the doc-kubernetes-kit-pr163 branch May 8, 2025 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Language checked English language and AsciiDoc formatting checks done
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants