|
Database System 0.1.0
Advanced C++20 Database System with Multi-Backend Support
|
#include <gtest/gtest.h>#include <memory>#include <string>#include <sstream>#include <regex>#include "database/backends/sqlite_backend.h"#include "database/core/database_backend.h"#include "database/database_types.h"
Go to the source code of this file.
Classes | |
| class | CredentialSecurityTest |
| Test fixture for credential security tests. More... | |
Functions | |
| TEST_F (CredentialSecurityTest, PasswordNotInErrorMessages) | |
| Tests that passwords are not exposed in error messages. | |
| TEST_F (CredentialSecurityTest, PasswordNotExposedOnConnectionFailure) | |
| Tests that failed connections don't expose credentials. | |
| TEST_F (CredentialSecurityTest, SpecialCharactersInPassword) | |
| Tests that special characters in passwords don't break parsing. | |
| TEST_F (CredentialSecurityTest, ConnectionStringInjectionPrevention) | |
| Tests that connection string values can't inject parameters. | |
| TEST_F (CredentialSecurityTest, ConnectionLogDoesNotContainPassword) | |
| Tests that connection logging masks passwords. | |
| TEST_F (CredentialSecurityTest, DebugModeMasksCredentials) | |
| Tests that debug output masks sensitive information. | |
| TEST_F (CredentialSecurityTest, PasswordNotInCoreAfterDisconnect) | |
| Tests that credentials are cleared from memory after disconnect. | |
| TEST_F (CredentialSecurityTest, EnvironmentCredentialsNotLogged) | |
| Tests that credentials from environment variables aren't logged. | |
| TEST_F (CredentialSecurityTest, EmptyPasswordHandled) | |
| Tests that empty passwords are handled safely. | |
| TEST_F (CredentialSecurityTest, VeryLongPasswordHandled) | |
| Tests that very long passwords don't cause buffer overflows. | |
| TEST_F | ( | CredentialSecurityTest | , |
| ConnectionLogDoesNotContainPassword | ) |
Tests that connection logging masks passwords.
When logging is enabled, passwords should be masked or omitted.
Definition at line 187 of file credential_test.cpp.
References database::core::connection_config::database.
| TEST_F | ( | CredentialSecurityTest | , |
| ConnectionStringInjectionPrevention | ) |
Tests that connection string values can't inject parameters.
Definition at line 155 of file credential_test.cpp.
References database::core::connection_config::database.
| TEST_F | ( | CredentialSecurityTest | , |
| DebugModeMasksCredentials | ) |
Tests that debug output masks sensitive information.
Definition at line 231 of file credential_test.cpp.
| TEST_F | ( | CredentialSecurityTest | , |
| EmptyPasswordHandled | ) |
Tests that empty passwords are handled safely.
Definition at line 298 of file credential_test.cpp.
References database::core::connection_config::database.
| TEST_F | ( | CredentialSecurityTest | , |
| EnvironmentCredentialsNotLogged | ) |
Tests that credentials from environment variables aren't logged.
Definition at line 279 of file credential_test.cpp.
| TEST_F | ( | CredentialSecurityTest | , |
| PasswordNotExposedOnConnectionFailure | ) |
Tests that failed connections don't expose credentials.
Definition at line 90 of file credential_test.cpp.
References database::core::connection_config::database, database::core::connection_config::host, database::core::connection_config::password, database::core::connection_config::port, and database::core::connection_config::username.
| TEST_F | ( | CredentialSecurityTest | , |
| PasswordNotInCoreAfterDisconnect | ) |
Tests that credentials are cleared from memory after disconnect.
This is a best-effort test - we can't fully verify memory clearing without specialized tools, but we can verify the principle.
Definition at line 251 of file credential_test.cpp.
References database::core::connection_config::database.
| TEST_F | ( | CredentialSecurityTest | , |
| PasswordNotInErrorMessages | ) |
Tests that passwords are not exposed in error messages.
When a connection fails, the error message should not contain the password from the connection string.
Definition at line 65 of file credential_test.cpp.
References database::core::connection_config::database.
| TEST_F | ( | CredentialSecurityTest | , |
| SpecialCharactersInPassword | ) |
Tests that special characters in passwords don't break parsing.
Definition at line 121 of file credential_test.cpp.
References database::core::connection_config::database, and database::core::connection_config::password.
| TEST_F | ( | CredentialSecurityTest | , |
| VeryLongPasswordHandled | ) |
Tests that very long passwords don't cause buffer overflows.
Definition at line 316 of file credential_test.cpp.
References database::core::connection_config::database, and database::core::connection_config::password.