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

Remove embedded bouncy castle from core. Separate CloudFrontSigners and EC2 DecryptPassword to extension packages. #3435

Merged
merged 2 commits into from
Aug 23, 2024

Conversation

peterrsongg
Copy link
Contributor

@peterrsongg peterrsongg commented Aug 13, 2024

Description

This PR removes the embedded bouncy castle source copy in the third party namespace. It refactors CloudFrontSigners to separate extension packages and EC2 DecryptPassword as well. There was one other occurrence where Third Party bouncy castle was used in SNS and that has been refactored as well.

Revision 2
Added the test mentioned in #3221 and verified it worked. Made some logic change to accommodate for this test. Addressed PR feedback.

Motivation and Context

Allows us to take a dependency on Portable.Bouncy castle in the extension packages and receive updates. Removes tech debt of having a source copy in core.

Testing

E2E tests pass

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project
  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have read the README document
  • I have added tests to cover my changes
  • All new and existing tests passed

License

  • I confirm that this pull request can be released under the Apache 2 license

@peterrsongg peterrsongg force-pushed the petesong/remove-embedded-bouncy-castle branch from 75141c6 to 60d5ee5 Compare August 13, 2024 01:44
@dscpinheiro
Copy link
Contributor

If we're removing the embedded source, should we also update the notice files?

@peterrsongg peterrsongg force-pushed the petesong/remove-embedded-bouncy-castle branch from 57b42f5 to 237e7a6 Compare August 17, 2024 22:03
],
"type": "patch",
"type": "minor",
Copy link
Contributor

Choose a reason for hiding this comment

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

I think type here is ignored by our build system (since there's an overrideVersion as well).

Also, is the -preview suffix required? For example, see the config we use for the first preview: https://github.com/aws/aws-sdk-net/blob/15a866102abf3763fa4c180c936a248d3b40c45b/generator/.DevConfigs/525da348-b9e8-4f4d-9dc7-47b2ee7f4716.json

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The preview actually failed the E2E test I ran last night, so I will remove it

<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
Copy link
Member

Choose a reason for hiding this comment

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

Project file should be marked as trimmable for the .NET 8 target.

  <PropertyGroup Condition="'$(TargetFramework)' == 'net8.0'">
    <IsTrimmable>true</IsTrimmable>
  </PropertyGroup>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good call, added.

<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
Copy link
Member

Choose a reason for hiding this comment

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

Project file should be marked as trimmable for the .NET 8 target.

  <PropertyGroup Condition="'$(TargetFramework)' == 'net8.0'">
    <IsTrimmable>true</IsTrimmable>
  </PropertyGroup>

<dependency id="AWSSDK.CloudFront" version="4.0.1.0-preview" />
<dependency id="BouncyCastle.Cryptography" version="2.4.0" />
</group>
</dependencies>
Copy link
Member

Choose a reason for hiding this comment

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

You are missing the dependency groups for .NET Core 3.1 and .NET 8.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm I tested the nuget package locally and it worked (for net 8), and given that the CrtIntegration nuspec file doesn't have a target for netcore31 and net 8, I don't think I need one here, unless the CrtIntegration nuspec is doing something different.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wasn't sure, and looks like the service nuspec's do this as well so I added them in the latest revision

Copy link
Member

Choose a reason for hiding this comment

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

I assumed it worked by resolving to use the .NET Standard 2.0 version of the assembly.

<file src=".\bin\Release\net472\AWSSDK.Extensions.CloudFront.Signers.pdb" target="lib\net472" />

<file src=".\bin\Release\netstandard2.0\AWSSDK.Extensions.CloudFront.Signers.dll" target="lib\netstandard2.0"/>
<file src=".\bin\Release\netstandard2.0\AWSSDK.Extensions.CloudFront.Signers.pdb" target="lib\netstandard2.0"/>
Copy link
Member

Choose a reason for hiding this comment

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

You need to add the .NET Core 3.1 and .NET 8 files.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will add these

<tags>AWS Amazon aws-sdk-v4</tags>
<icon>images\AWSLogo.png</icon>
<dependencies>
<group targetFramework="net472">
Copy link
Member

Choose a reason for hiding this comment

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

Missing .NET Core 3.1 and .NET 8 group dependencies.

<file src=".\bin\Release\net472\AWSSDK.Extensions.EC2.DecryptPassword.dll" target="lib\net472" />
<file src=".\bin\Release\net472\AWSSDK.Extensions.EC2.DecryptPassword.pdb" target="lib\net472" />

<file src=".\bin\Release\netstandard2.0\AWSSDK.Extensions.EC2.DecryptPassword.dll" target="lib\netstandard2.0"/>
Copy link
Member

Choose a reason for hiding this comment

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

Add the .NET Core 3.1 and .NET 8 files.

@peterrsongg peterrsongg requested a review from normj August 21, 2024 21:03
@@ -10,29 +10,6 @@ purpose, commercial or non-commercial, and by any means.

----------------

** Parsing PEM files from Bouncy Castle
Copy link
Member

Choose a reason for hiding this comment

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

You need add a new entry for BouncyCastle NuGet package. Like we recently did for the new System.* NuGet packages we added for V4. https://github.com/aws/aws-sdk-net/blob/v4-development/Notice.txt#L127

@@ -10,34 +10,6 @@ purpose, commercial or non-commercial, and by any means.

----------------

** Parsing PEM files from Bouncy Castle
Copy link
Member

Choose a reason for hiding this comment

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

You need add a new entry for BouncyCastle NuGet package. Like we recently did for the new System.* NuGet packages we added for V4. https://github.com/aws/aws-sdk-net/blob/v4-development/Notice.txt#L127

</dependencies>

</metadata>
<files>
Copy link
Member

Choose a reason for hiding this comment

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

Add the documentation xml files so VS intellisense can use them.

</dependencies>

</metadata>
<files>
Copy link
Member

Choose a reason for hiding this comment

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

Add the documentation xml files so VS intellisense can use them.

…ont signers and ec2 decrypt password to extension packages to take a dependency on BouncyCastle.Cryptography
@peterrsongg peterrsongg force-pushed the petesong/remove-embedded-bouncy-castle branch 2 times, most recently from 906f8c6 to 65d9228 Compare August 23, 2024 03:56
@peterrsongg peterrsongg force-pushed the petesong/remove-embedded-bouncy-castle branch from 65d9228 to 362858a Compare August 23, 2024 06:30
@peterrsongg peterrsongg merged commit 7056953 into v4-development Aug 23, 2024
1 check passed
@dscpinheiro dscpinheiro deleted the petesong/remove-embedded-bouncy-castle branch August 24, 2024 00:02
@peterrsongg peterrsongg added the v4 label Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants