Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

feat(bridge): Make session cookie timeout configurable and set default value to 60 minutes #5455

Conversation

Kavindu-Dodan
Copy link
Member

@Kavindu-Dodan Kavindu-Dodan commented Oct 1, 2021

This PR

Fixes #5449

PR improves the configurability of OAuth session cookie timeout. Further, it increases the default timeout to 60mnts in code level.

Installer argument SESSION_TIMEOUT_MS is set in Helm template.

Related Issues

#3448

How to test

If #3448 fulfilling OAuth provider is present for Bridge, this can be tested easily. Timeout can be configured by using env. variable SESSION_TIMEOUT_MS, then validate the console output for correct value extraction and verify session timeouts in Bridge.

Note - refactored method signatures in session.ts to improve code quality.

@Kavindu-Dodan Kavindu-Dodan requested a review from a team as a code owner October 1, 2021 11:16
@Kavindu-Dodan Kavindu-Dodan changed the title Make session cookie timeout configurable and set default value to 60 minutes feat(bridge): Make session cookie timeout configurable and set default value to 60 minutes Oct 1, 2021
@codecov
Copy link

codecov bot commented Oct 1, 2021

Codecov Report

Merging #5455 (0c0356a) into master (4a1be75) will decrease coverage by 1.00%.
The diff coverage is n/a.

❗ Current head 0c0356a differs from pull request most recent head 36ba410. Consider uploading reports for the commit 36ba410 to get more accurate results

@@            Coverage Diff             @@
##           master    #5455      +/-   ##
==========================================
- Coverage   54.74%   53.74%   -1.01%     
==========================================
  Files         319      304      -15     
  Lines       18565    17899     -666     
  Branches      928      928              
==========================================
- Hits        10164     9619     -545     
+ Misses       7498     7405      -93     
+ Partials      903      875      -28     
Impacted Files Coverage Δ
distributor/pkg/lib/controlplane/uniformlog.go 74.07% <0.00%> (-5.56%) ⬇️
cli/cmd/version.go 51.61% <0.00%> (-4.31%) ⬇️
webhook-service/lib/cmd_executor.go
secret-service/pkg/backend/secretbackend_k8s.go
webhook-service/lib/curl_executor.go
webhook-service/lib/template_engine.go
webhook-service/lib/eventmod.go
webhook-service/handler/handler.go
secret-service/pkg/backend/registry.go
secret-service/pkg/repository/scopes.go
... and 7 more

@Kavindu-Dodan Kavindu-Dodan added this to the 0.10.0 (Bridge) milestone Oct 5, 2021
@Kavindu-Dodan Kavindu-Dodan added this to In progress in Sprint 229 [24/09-08/10] via automation Oct 5, 2021
Signed-off-by: Kavindu-Dodan <kavindudodanduwa@gmail.com>
@Kavindu-Dodan Kavindu-Dodan force-pushed the patch/5449/improve-oauth-session-timeout branch 2 times, most recently from a1adb2c to 6143a07 Compare October 5, 2021 06:38
@thisthat thisthat removed this from In progress in Sprint 229 [24/09-08/10] Oct 5, 2021
@thisthat thisthat removed this from the 0.10.0 (Bridge) milestone Oct 5, 2021
@thisthat
Copy link
Member

thisthat commented Oct 5, 2021

Thank you @Kavindu-Dodan for your contribution. Could you please fix the format of session.ts? The linting is failing: https://github.com/keptn/keptn/runs/3800103672#step:6:88

Signed-off-by: Kavindu-Dodan <kavindudodanduwa@gmail.com>
@Kavindu-Dodan Kavindu-Dodan force-pushed the patch/5449/improve-oauth-session-timeout branch from 6143a07 to 8f3e7ed Compare October 5, 2021 09:37
Signed-off-by: Kavindu-Dodan <kavindudodanduwa@gmail.com>
@sonarcloud
Copy link

sonarcloud bot commented Oct 5, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@Kavindu-Dodan Kavindu-Dodan merged commit 711c43e into keptn:master Oct 5, 2021
bhamail pushed a commit to bhamail/keptn that referenced this pull request Oct 6, 2021
…t value to 60 minutes (keptn#5455)

* Make session cookie configurable and set default value to 60 minutes

Signed-off-by: Kavindu-Dodan <kavindudodanduwa@gmail.com>

* Review update - convert env paramters to minutes to be consistant

Signed-off-by: Kavindu-Dodan <kavindudodanduwa@gmail.com>

* Fix lint issues

Signed-off-by: Kavindu-Dodan <kavindudodanduwa@gmail.com>
Signed-off-by: Dan Rollo <danrollo@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bridge: Make OAuth session timeout configurable & set default timeout value to 60mnts
3 participants