-
Notifications
You must be signed in to change notification settings - Fork 868
Move S3PostUploadSignedPolicy outside of _bcl folder #3900
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
base: development
Are you sure you want to change the base?
Conversation
6c58f61
to
dd78028
Compare
private static string | ||
KEY_POLICY = "policy", | ||
KEY_SIGNATURE = "signature", | ||
KEY_ACCESSKEY = "access_key"; | ||
|
||
/// <summary> | ||
/// The policy document which governs what uploads can be done. | ||
/// </summary> | ||
public string Policy { get; set; } | ||
|
||
/// <summary> | ||
/// The signature for the policy. | ||
/// </summary> | ||
public string Signature { get; set; } | ||
|
||
/// <summary> | ||
/// The AWS Access Key Id for the credential pair that produced the signature. | ||
/// </summary> | ||
public string AccessKeyId { get; set; } | ||
|
||
/// <summary> | ||
/// The security token from session or instance credentials. | ||
/// </summary> | ||
public string SecurityToken { get; set; } | ||
|
||
/// <summary> | ||
/// The signing algorithm used. Required as a field in the post Amazon | ||
/// S3 can re-calculate the signature. | ||
/// </summary> | ||
public string Algorithm { get; set; } | ||
|
||
/// <summary> | ||
/// The date value in ISO8601 format. It is the same date used in | ||
/// creating the signing key. | ||
/// </summary> | ||
public string Date { get; set; } | ||
|
||
/// <summary> | ||
/// In addition to the access key ID, this provides scope information | ||
/// used in calculating the signing key for signature calculation. | ||
/// </summary> | ||
public string Credential { get; set; } | ||
|
||
|
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 is all existing code, i just moved it to the top of file
/// Framework-agnostic implementation to add conditions to a policy document. | ||
/// Uses JsonDocument/JsonElement instead of JsonNode. | ||
/// </summary> | ||
private static byte[] AddConditionsToPolicy(string policy, Dictionary<string, string> newConditions) |
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 is the only function that i really modified in this PR. the functionality is the same but it uses different logic to parse the json
Justification = "This suppression is here to ignore the warnings since we have not made this function AOT compatible yet.")] | ||
|
||
#endif | ||
public static S3PostUploadSignedPolicy GetSignedPolicyFromXml(string policyXml) |
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 function is the same, i just added the AssemblyLoadTrimming warning
Description
Motivation and Context
In order to implement #1901 , we need to utilize the existing
GetSignedPolicy
function. It is currently in the _bcl folder because it relies on system.text.json.nodes which isnt available in .net core3.1 and the current code wasn't native aot compatible. So in order to fix this, we needed to remove the system.text.json.nodes dependency and move the code out of the _bcl folder.Testing
In order to ensure it works on net standard and is native AOT compatible i created a console app
Dry run:
fb816228-3d51-4f02-bff4-3711227d8874
-Types of changes
Checklist
License