Skip to content
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

[Feat/retention rule] Added ttl rule for sessions #218

Merged
merged 15 commits into from
Jan 10, 2024

Conversation

PascalDR
Copy link
Collaborator

@PascalDR PascalDR commented Jan 8, 2024

This PR is relative to issue 33 and adds the ttl rule to the session collection on mongo storage class.

def set_session_retention_ttl(self, ttl: int | None) -> None:
self._connect()

if ttl == None:
Copy link
Member

Choose a reason for hiding this comment

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

None can be expressed as a non existent or False, and we can have it as an int valued to 0 (zero) as well

Copy link
Member

@peppelinux peppelinux left a comment

Choose a reason for hiding this comment

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

I made some quick changes in the form of suggestion to be merged by you @PascalDR

at the same time I expect to have in this PR also the settings parameter in the storage section where the ttl value can be configured as well

pyeudiw/storage/mongo_storage.py Outdated Show resolved Hide resolved
pyeudiw/storage/mongo_storage.py Outdated Show resolved Hide resolved
pyeudiw/storage/base_storage.py Outdated Show resolved Hide resolved
PascalDR and others added 3 commits January 9, 2024 11:35
Co-authored-by: Giuseppe De Marco <giuseppe.demarco@teamdigitale.governo.it>
Co-authored-by: Giuseppe De Marco <giuseppe.demarco@teamdigitale.governo.it>
Co-authored-by: Giuseppe De Marco <giuseppe.demarco@teamdigitale.governo.it>
@PascalDR
Copy link
Collaborator Author

PascalDR commented Jan 9, 2024

I made some quick changes in the form of suggestion to be merged by you @PascalDR

at the same time I expect to have in this PR also the settings parameter in the storage section where the ttl value can be configured as well

@peppelinux the setting parameter is handled here.

Do you want the parameter added to the example configuration?

@peppelinux
Copy link
Member

peppelinux commented Jan 9, 2024

Si @PascalDR

@peppelinux peppelinux merged commit 5ef6301 into italia:dev Jan 10, 2024
4 checks passed
peppelinux pushed a commit that referenced this pull request Jan 10, 2024
* QRCode features (#217)

* feat: changed qrcode handling

* feat: copied static files from Satosa-saml2spid

* feat: modified expiration time handling

* fix: update test configuration

* fix: remove of connection params

* [Feat/retention rule] Added ttl rule for sessions (#218)

* feat: added retention rule for session collection

* test: added test for retention rule

* Update pyeudiw/storage/mongo_storage.py

Co-authored-by: Giuseppe De Marco <giuseppe.demarco@teamdigitale.governo.it>

* Update pyeudiw/storage/mongo_storage.py

Co-authored-by: Giuseppe De Marco <giuseppe.demarco@teamdigitale.governo.it>

* Update pyeudiw/storage/base_storage.py

Co-authored-by: Giuseppe De Marco <giuseppe.demarco@teamdigitale.governo.it>

* chore: added config parameter

---------

Co-authored-by: Giuseppe De Marco <giuseppe.demarco@teamdigitale.governo.it>

* fix: error handling

---------

Co-authored-by: Giuseppe De Marco <giuseppe.demarco@teamdigitale.governo.it>
Co-authored-by: Ghenadie Artic <57416779+Gartic99@users.noreply.github.com>
@peppelinux peppelinux mentioned this pull request Jan 10, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants