Page MenuHomePhabricator

[services] Tunnelbroker - Disabling updating session state when session authentication is skipped
ClosedPublic

Authored by max on Feb 16 2023, 7:06 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 22, 5:19 PM
Unknown Object (File)
Fri, Nov 22, 6:06 AM
Unknown Object (File)
Fri, Nov 22, 1:44 AM
Unknown Object (File)
Fri, Nov 22, 1:44 AM
Unknown Object (File)
Fri, Nov 22, 1:43 AM
Unknown Object (File)
Fri, Nov 22, 1:41 AM
Unknown Object (File)
Wed, Nov 20, 11:58 AM
Unknown Object (File)
Wed, Nov 20, 11:58 AM
Subscribers

Details

Summary

This diff introduces disabling the session state updates when the session authentication mechanism is skipped by the config flag.
In this case, the sessions are not used, so we don't need to update their state.

Full context: ENG-2642
Linear task: ENG-3022

Test Plan

The DynamoDB database field for the session state is not updating when the config flag sessions.skip_authentication is used.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

max held this revision as a draft.
max published this revision for review.Feb 16 2023, 7:12 AM
max edited the summary of this revision. (Show Details)
max edited the test plan for this revision. (Show Details)
max added a reviewer: bartek.
bartek added inline comments.
services/tunnelbroker/src/libcpp/Tunnelbroker.cpp
173–175 ↗(On Diff #22652)

Just a nitpick, I have a feeling that this check is used often across the codebase (e.g. line 185 in this file), so extracting this to a separate function would be more concise and readable:

bool shouldSkipAuthentication() {
  return comm::network::config::ConfigManager::getInstance().isParameterSet(
          comm::network::config::ConfigManager::
              OPTION_SESSIONS_SKIP_AUTH_KEY);
}

// ...
if (shouldSkipAuthentication()) {
  return;
}

But totally up to you

This revision is now accepted and ready to land.Feb 20 2023, 4:09 AM
max added inline comments.
services/tunnelbroker/src/libcpp/Tunnelbroker.cpp
173–175 ↗(On Diff #22652)

Just a nitpick, I have a feeling that this check is used often across the codebase (e.g. line 185 in this file), so extracting this to a separate function would be more concise and readable:

bool shouldSkipAuthentication() {
  return comm::network::config::ConfigManager::getInstance().isParameterSet(
          comm::network::config::ConfigManager::
              OPTION_SESSIONS_SKIP_AUTH_KEY);
}

// ...
if (shouldSkipAuthentication()) {
  return;
}

But totally up to you

It's used only twice and seems that is all usage occurrences. I prefer to live it as is because adding a function will add more complexity here and more lines of code. But thanks for a good suggestion @bartek!