Skip to content

Extended configuration for views and expiration allowing both. #189

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

mikhail-nikolaenko
Copy link

@mikhail-nikolaenko mikhail-nikolaenko commented May 5, 2025

Motivation

The current implementation does not allow setting both the view count and expiration at the same time. Additionally, when persistence is required, keys without expiration can flood the database. According to our requirements, we need long-living secrets, but we must ensure that they expire after a specified period.

Solution

This change introduces three new environment variables:

  • DEFAULT_EXPIRE
  • DEFAULT_VIEWS
  • DISABLE_MODE_SWITCH

The main goal is to maintain compatibility with the current implementation in the default configuration.

Key Changes

  • The new implementation always sets an expiration for any secret — there is no option for infinite lifespan. This is the only "breaking" change.
  • DEFAULT_EXPIRE: Used when expiration is not explicitly specified. Defaults to 60 minutes if not provided.
  • DEFAULT_VIEWS: Applied when the advanced mode is disabled or when expiration is selected in advanced mode with the mode switch enabled (keeping its default value to 0 makes views amount unlimited as in the original implementation).
  • DISABLE_MODE_SWITCH: Disables the mode switch in the advanced section, allowing users to specify both a view limit and expiration time.

Summary

This update improves secret management by enforcing expiration, reducing database clutter, and allowing better control over secret lifecycle through configurable defaults. Backward compatibility is preserved for default usage, with the only exception being that secrets can no longer have infinite lifespans.

@cupcakearmy
Copy link
Owner

@cupcakearmy cupcakearmy added the enhancement New feature or request label May 5, 2025
@mikhail-nikolaenko
Copy link
Author

Dear @cupcakearmy do you have any estimation when this could be merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants