Skip to content

Commit

Permalink
Update SignalingApiTest.cpp
Browse files Browse the repository at this point in the history
if using temp creds need to use the temp creds file format
  • Loading branch information
hassanctech authored Aug 24, 2023
1 parent 2f9e5a1 commit 1b66e41
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions tst/SignalingApiTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,22 @@ TEST_F(SignalingApiTest, signalingSendMessageSyncFileCredsProvider)
PAwsCredentialProvider pAwsCredentialProvider = NULL;
CHAR fileContent[10000];
UINT32 length = ARRAY_SIZE(fileContent);
CHAR futureTime[] = "2200-06-05T09:39:36Z";


ASSERT_EQ(TRUE, mAccessKeyIdSet);

// Store the credentials in a file under the current dir
length = SNPRINTF(fileContent, length, "CREDENTIALS %s %s", mAccessKey, mSecretKey);
ASSERT_GT(ARRAY_SIZE(fileContent), length);
if (mSessionToken == NULL) {
// Store the credentials in a file under the current dir
length = SNPRINTF(fileContent, length, "CREDENTIALS %s %s", mAccessKey, mSecretKey);
ASSERT_GT(ARRAY_SIZE(fileContent), length);
} else {
// test Temp Creds
// "CREDENTIALS accessKey expiration secretKey sessionToken"
length = SNPRINTF(fileContent, length, "CREDENTIALS %s %s %s %s", mAccessKey, futureTime, mSecretKey, mSessionToken);
ASSERT_GT(ARRAY_SIZE(fileContent), length);
}

ASSERT_EQ(STATUS_SUCCESS, writeFile(TEST_FILE_CREDENTIALS_FILE_PATH, FALSE, FALSE, (PBYTE) fileContent, length));

// Create file creds provider from the file
Expand Down

0 comments on commit 1b66e41

Please sign in to comment.