Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cognito provider tests #3286

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Cognito provider tests #3286

wants to merge 2 commits into from

Conversation

sbera87
Copy link
Contributor

@sbera87 sbera87 commented Feb 4, 2025

Issue #, if available:

Description of changes:
Add Integration tests for cognito-idp

Check all that applies:

  • Did a review by yourself.
  • Added proper tests to cover this PR. (If tests are not applicable, explain.)
  • Checked if this PR is a breaking (APIs have been changed) change.
  • Checked if this PR will not introduce cross-platform inconsistent behavior.
  • Checked if this PR would require a ReadMe/Wiki update.

Check which platforms you have built SDK on to verify the correctness of this PR.

  • Linux
  • Windows
  • Android
  • MacOS
  • IOS
  • Other Platforms

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@sbera87 sbera87 force-pushed the cognito branch 2 times, most recently from da489d7 to b2a7581 Compare March 13, 2025 20:24
@sbera87 sbera87 marked this pull request as ready for review March 13, 2025 20:34
@sbera87 sbera87 force-pushed the cognito branch 3 times, most recently from 88852d6 to 04683fc Compare March 13, 2025 21:17
#include <aws/core/utils/Outcome.h>
#include <aws/testing/TestingEnvironment.h>
#include <aws/core/platform/Environment.h>
#include <openssl/sha.h>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we using openssl headers directly, this would create a openssl dependency for tests that we dont want to have. what do we need from openssl that we dont have in c-cal

testTrace.erase();
}

private:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: weird spacing on private

}

private:
Aws::String createUserPool(Aws::String poolName)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets use const Aws::String& since we arent calling move on it

private:
Aws::String createUserPool(Aws::String poolName)
{
if(poolName.empty())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldnt we never call with empty?


CreateUserPoolOutcome userPoolOutcome = client->CreateUserPool(userPoolRequest);
if (!userPoolOutcome.IsSuccess()) {
return {};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a test so we should expecting/asserting service outcomes with with either AWS_ASSERT_SUCCESS or AWS_EXPECT_SUCCESS


auto deletePoolOutcome = client->DeleteUserPool(deletePoolRequest);
if (!deletePoolOutcome.IsSuccess()) {
AWS_LOGSTREAM_ERROR(ALLOCATION_TAG, "Failed to delete User Pool: " << deletePoolOutcome.GetError().GetMessage());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah last comment ill leave on this we shoudlnt be logging errors, this is a test therefore we want to assert/expecting

}
~SRPClient()
{
BN_free(N);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah we cant be using linux/openssl symbols otherwise this wont work on windows. also we dont want to make the tests depedent on being run in linux or a direct open ssl depedency.

For crypto try to only use our utility classes, which invokes aws-c-cal instead of taking on a direct crypto dependency.

any crypto related functionality should be flowing through the CRT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants