-
Notifications
You must be signed in to change notification settings - Fork 12
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: dotnet examples #482
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume that these are used somewhere.
Should we put this list in Dafny so that every runtime has access to the same strings?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the same list used in the Java example.
I presume that once I've moved over all the examples, that all these will be used.
Putting them in a central place seems reasonable. I'm not sure Dafny is the right choice, but maybe I just don't see whatever you're envisioning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not looped in on our current plans for repos/languages, but:
Do we actually want to put this in the DDB-Java repo?
var kmsKeyId = TestUtils.TEST_KMS_KEY_ID; | ||
var ddbTableName = TestUtils.TEST_DDB_TABLE_NAME; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Users should be able to pass in their own resource ARNs via a CLI args.
Two questions:
- Could you have PutItemGetItem take in these arguments?
- Could you add a main method to the bottom of this file that takes in command-line arguments and passes them to PutItemGetItem?
@@ -0,0 +1,19 @@ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Users should be able to execute examples independently of one another.
I think you should remove this file in favor of per-example Main methods.
Also for parsing args
and passing them into the example method.
using System; | ||
public class TestUtils | ||
{ | ||
public static readonly string TEST_KEYSTORE_NAME = "KeyStoreDdbTable"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this go in a runtimes/net/tests
or similar directory?
Then add a Tests.csproj
file that executes the tests similar to https://github.com/aws/aws-encryption-sdk-dafny/blob/mainline/aws-encryption-sdk-net/Test/AWSEncryptionSDKTests.csproj
@@ -32,7 +32,7 @@ module PutItemTransform { | |||
//= type=implication | |||
//# The PutItem request MUST NOT refer to any legacy parameters, | |||
//# specifically Expected and ConditionalOperator MUST NOT be set. | |||
&& input.sdkInput.Expected.None? && input.sdkInput.ConditionalOperator.None? | |||
&& NoMap(input.sdkInput.Expected) && input.sdkInput.ConditionalOperator.None? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow. If this is all that is needed to handle empty, we should change Java.
(But treat DDB's AttributeValue specially)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For an optional map or list, the dotnet AWS SDK can't distinguish empty from None (since it hides the IsSet method).
This should be safe for java, since the smithy says "Optional non-empty".
I don't understand what you mean by "we should change java" -- as far as I can tell, Java is right and dotnet is wrong.
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>disable</Nullable> | ||
<LangVersion>10</LangVersion> | ||
<TargetFramework>net6.0</TargetFramework> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be a breaking change. I don't think we can do this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At some point recently, it told me MPL didn't support net48. Maybe changing ProjectReference to PackageReference will fix that.
<ItemGroup> | ||
<PackageReference Include="AWSSDK.DynamoDBv2" Version="3.7.300.2"/> | ||
<PackageReference Include="AWSSDK.Core" Version="3.7.300.2"/> | ||
<ProjectReference Include="../../../submodules/MaterialProviders/AwsCryptographicMaterialProviders/runtimes/net/MPL.csproj" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that this will work when the code is published.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I'll switch it back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@josecorella I think that the sub-module MPL here is only 6.0,
but I think that upstream is 6 and 4.8?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, the mpl submodule commit on the dotnet-example is very out of date
https://github.com/aws/aws-cryptographic-material-providers-library-dafny/blob/13e0ac3c3c5eea83494706e4a96f40126d8f38a8/AwsCryptographicMaterialProviders/runtimes/net/MPL.csproj#L8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ajewellamz we should update the mpl submodule in this pr to point to the latest mpl changes
"BS": [] | ||
"BS": [""] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wondering why change this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because empty sets are illegal. I don't know how is passed in Java.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.