-
Notifications
You must be signed in to change notification settings - Fork 0
Authorized Client implementation #8
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: main
Are you sure you want to change the base?
Conversation
| using OpenPayments.Sdk.HttpSignatureUtils; | ||
|
|
||
| /// <summary> | ||
| /// |
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.
Since this extension is public and not internal, lets define summary here
| if (keyBytes.Length != 32 && keyBytes.Length != 64) | ||
| if (keyBytes.Length != 32 && keyBytes.Length != 64 && keyBytes.Length != 48) | ||
| { | ||
| Console.WriteLine($"Key length was {keyBytes.Length} bytes, expected 32 or 64."); |
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.
Is is ok to use console.writeline in library?
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.
Forgot that while debugging, will use this opportunity to cleanup remaining temporary code.
golobitch
left a comment
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.
@cozminu without a doubt, this is an amazing job that you did! Thank you for this. I don't see any big problems with this implementation right now. Maybe I would have some nitpicks if I dive a little bit dipper but nothing to big.
I would however wait also on @koekiebox to take a look at this PR.
Thank you !
koekiebox
left a comment
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.
Couple of comments, rest looks good @cozminu . 🚀 , some notes that may not be applicable:
- How much do we want to rely on comments? Or do we largely depend on openpayments.dev docs?
- Do we need to cover integration tests, and to which level?
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 we add a .gitignore for the .idea folder and exclude? Specific to Jetbrains.
| if (keyBytes.Length != 32 && keyBytes.Length != 64) | ||
| if (keyBytes.Length != 32 && keyBytes.Length != 64 && keyBytes.Length != 48) | ||
| { | ||
| Console.WriteLine($"Key length was {keyBytes.Length} bytes, expected 32 or 64."); |
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.
The logic allows for 32, 64 and 48, but the console output only mentions 32 and 64.
|
|
||
| public AuthContractResolver() | ||
| { | ||
| // this.SetProp(typeof(Response), "Interact"); |
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.
To be removed?
| MemberSerialization memberSerialization) | ||
| { | ||
| var prop = base.CreateProperty(member, memberSerialization); | ||
| prop.Required = Required.AllowNull; |
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 may have missed it, is there a way to control the JSON fields order?
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.
Do we want to include this file?
| } | ||
| ); | ||
|
|
||
| // Console.WriteLine(JsonSerializer.Serialize(response, new JsonSerializerOptions { WriteIndented = true })); |
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.
To be removed?
| { | ||
| Start = [Start.Redirect], | ||
| // Finish = new Finish() | ||
| // { |
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.
To be removed?
| partial void PrepareRequest(HttpClient client, HttpRequestMessage request, | ||
| string url) | ||
| { | ||
| if (_privateKey == null || _keyId == null) return; |
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.
Do we want to log at least a warning here? Or is it handled elsewhere?
Addresses #2 , #3 , #4