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

feat: add support for .NET SDK V4 #156

Merged
merged 2 commits into from
Oct 17, 2024
Merged

Conversation

philasmar
Copy link
Contributor

Issue #, if available:
DOTNET-7759

Description of changes:

  • Added .NET 8 target framework and marked as trimmable
  • Updated the .NET SDK dependencies to the latest version 4.0.0-preview.4
  • Add SourceLink support

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@philasmar philasmar requested review from normj and 96malhar October 16, 2024 02:18
Copy link
Member

@normj normj left a comment

Choose a reason for hiding this comment

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

Nevermind this comment. Posted on the wrong PR.

Copy link
Member

@normj normj left a comment

Choose a reason for hiding this comment

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

The GetUserPoolClientConfiguration method in CognitoUserPool is passing in collections into CognitoUserPoolClientConfiguration which doesn't accept nulls. We should probably pass in empty collections if the the DescribeUserPoolClientAsync returns back null collection.

I'm pretty sure the AuthParameters at this point should not be null but I would still add a defensive check: https://github.com/aws/aws-sdk-net-extensions-cognito/blob/master/src/Amazon.Extensions.CognitoAuthentication/CognitoUserAuthentication.cs#L76C33-L76C47

The null checks for the challengeParameters don't look complete in this method. UpdateUsernameAndSecretHash

Make sure the ChallengeResponses property is not null at this point: https://github.com/aws/aws-sdk-net-extensions-cognito/blob/master/src/Amazon.Extensions.CognitoAuthentication/CognitoUserAuthentication.cs#L96

The ChallengeParameters parameter needs some null checking: https://github.com/aws/aws-sdk-net-extensions-cognito/blob/master/src/Amazon.Extensions.CognitoAuthentication/CognitoUserAuthentication.cs#L175

Add some null checks on these collections. I'm not exactly sure where these collections are coming from but it might be from service responses.
https://github.com/aws/aws-sdk-net-extensions-cognito/blob/master/src/Amazon.Extensions.CognitoAuthentication/CognitoUser.cs#L774
https://github.com/aws/aws-sdk-net-extensions-cognito/blob/master/src/Amazon.Extensions.CognitoAuthentication/CognitoUser.cs#L792
https://github.com/aws/aws-sdk-net-extensions-cognito/blob/master/src/Amazon.Extensions.CognitoAuthentication/Util/CognitoAuthHelper.cs#L129
https://github.com/aws/aws-sdk-net-extensions-cognito/blob/master/src/Amazon.Extensions.CognitoAuthentication/CognitoDevice.cs#L317

@philasmar
Copy link
Contributor Author

The GetUserPoolClientConfiguration method in CognitoUserPool is passing in collections into CognitoUserPoolClientConfiguration which doesn't accept nulls. We should probably pass in empty collections if the the DescribeUserPoolClientAsync returns back null collection.

I'm pretty sure the AuthParameters at this point should not be null but I would still add a defensive check: https://github.com/aws/aws-sdk-net-extensions-cognito/blob/master/src/Amazon.Extensions.CognitoAuthentication/CognitoUserAuthentication.cs#L76C33-L76C47

The null checks for the challengeParameters don't look complete in this method. UpdateUsernameAndSecretHash

Make sure the ChallengeResponses property is not null at this point: https://github.com/aws/aws-sdk-net-extensions-cognito/blob/master/src/Amazon.Extensions.CognitoAuthentication/CognitoUserAuthentication.cs#L96

The ChallengeParameters parameter needs some null checking: https://github.com/aws/aws-sdk-net-extensions-cognito/blob/master/src/Amazon.Extensions.CognitoAuthentication/CognitoUserAuthentication.cs#L175

Add some null checks on these collections. I'm not exactly sure where these collections are coming from but it might be from service responses. https://github.com/aws/aws-sdk-net-extensions-cognito/blob/master/src/Amazon.Extensions.CognitoAuthentication/CognitoUser.cs#L774 https://github.com/aws/aws-sdk-net-extensions-cognito/blob/master/src/Amazon.Extensions.CognitoAuthentication/CognitoUser.cs#L792 https://github.com/aws/aws-sdk-net-extensions-cognito/blob/master/src/Amazon.Extensions.CognitoAuthentication/Util/CognitoAuthHelper.cs#L129 https://github.com/aws/aws-sdk-net-extensions-cognito/blob/master/src/Amazon.Extensions.CognitoAuthentication/CognitoDevice.cs#L317

I went through the code base and added more defensive checks for collections.

@philasmar philasmar requested a review from normj October 17, 2024 15:04
@philasmar philasmar merged commit 47c407e into v4sdk-development Oct 17, 2024
2 checks passed
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.

3 participants