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
F3345452: D6747.diff
Fri, Nov 22, 6:06 AM
F3342613: D6747.id22899.diff
Fri, Nov 22, 1:44 AM
F3342612: D6747.id22652.diff
Fri, Nov 22, 1:44 AM
F3342593: D6747.id.diff
Fri, Nov 22, 1:43 AM
F3342574: D6747.diff
Fri, Nov 22, 1:41 AM
Unknown Object (File)
Wed, Nov 20, 11:58 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
Branch
disable-update-session-online
Lint
No Lint Coverage
Unit
No Test Coverage

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

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

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!