Skip to content

Commit

Permalink
use default un/pw if none supplied in environment
Browse files Browse the repository at this point in the history
  • Loading branch information
nam20485 committed Apr 22, 2024
1 parent 62c43b0 commit 8198000
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions OdbDesignLib/App/BasicRequestAuthentication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,18 @@ namespace Odb::Lib::App
{
// 500 - Internal Server Error
auto validUsername = std::getenv(USERNAME_ENV_NAME);

Check warning on line 43 in OdbDesignLib/App/BasicRequestAuthentication.cpp

View workflow job for this annotation

GitHub Actions / CMake-Multi-Platform-Build (windows-2022, x64-release)

'getenv': This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.

Check warning on line 43 in OdbDesignLib/App/BasicRequestAuthentication.cpp

View workflow job for this annotation

GitHub Actions / CMake-Multi-Platform-Build (windows-2022, x64-release)

'getenv': This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
if (validUsername == nullptr) return crow::response(500, "Failed retrieving credentials");
if (validUsername == nullptr) //return crow::response(500, "Failed retrieving credentials");
{
// default username if none supplied in environment
validUsername = "odb";

Check warning on line 47 in OdbDesignLib/App/BasicRequestAuthentication.cpp

View workflow job for this annotation

GitHub Actions / CMake-Multi-Platform-Build (ubuntu-22.04, linux-release)

ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]

Check warning on line 47 in OdbDesignLib/App/BasicRequestAuthentication.cpp

View workflow job for this annotation

GitHub Actions / CMake-Multi-Platform-Build (macos-12, macos-release)

ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]

Check warning on line 47 in OdbDesignLib/App/BasicRequestAuthentication.cpp

View workflow job for this annotation

GitHub Actions / CMake-Multi-Platform-Build (ubuntu-22.04, linux-release)

ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]

Check warning on line 47 in OdbDesignLib/App/BasicRequestAuthentication.cpp

View workflow job for this annotation

GitHub Actions / CMake-Multi-Platform-Build (macos-12, macos-release)

ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
}

auto validPassword = std::getenv(PASSWORD_ENV_NAME);

Check warning on line 50 in OdbDesignLib/App/BasicRequestAuthentication.cpp

View workflow job for this annotation

GitHub Actions / CMake-Multi-Platform-Build (windows-2022, x64-release)

'getenv': This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.

Check warning on line 50 in OdbDesignLib/App/BasicRequestAuthentication.cpp

View workflow job for this annotation

GitHub Actions / CMake-Multi-Platform-Build (windows-2022, x64-release)

'getenv': This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
if (validPassword == nullptr) return crow::response(500, "Failed retrieving credentials");
if (validPassword == nullptr) //return crow::response(500, "Failed retrieving credentials");
{
// default password if none supplied in environment
validPassword = "plusplus";

Check warning on line 54 in OdbDesignLib/App/BasicRequestAuthentication.cpp

View workflow job for this annotation

GitHub Actions / CMake-Multi-Platform-Build (ubuntu-22.04, linux-release)

ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]

Check warning on line 54 in OdbDesignLib/App/BasicRequestAuthentication.cpp

View workflow job for this annotation

GitHub Actions / CMake-Multi-Platform-Build (macos-12, macos-release)

ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]

Check warning on line 54 in OdbDesignLib/App/BasicRequestAuthentication.cpp

View workflow job for this annotation

GitHub Actions / CMake-Multi-Platform-Build (ubuntu-22.04, linux-release)

ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]

Check warning on line 54 in OdbDesignLib/App/BasicRequestAuthentication.cpp

View workflow job for this annotation

GitHub Actions / CMake-Multi-Platform-Build (macos-12, macos-release)

ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
}

// 403 - Forbidden
if (username != validUsername ||
Expand Down

0 comments on commit 8198000

Please sign in to comment.