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 CSharp SDK #234

Merged
merged 1 commit into from
Jun 20, 2024
Merged

feat: Add CSharp SDK #234

merged 1 commit into from
Jun 20, 2024

Conversation

vgwizardx
Copy link
Contributor

FLI-783 - C# Server Side SDK

  • Add Authentication
  • Add Evaluation (Boolean, Variant, and Batch)

@vgwizardx vgwizardx requested a review from a team as a code owner June 20, 2024 00:35
Copy link
Contributor

@markphelps markphelps left a comment

Choose a reason for hiding this comment

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

looking great! thank you @vgwizardx !!

One minor change around auth headers requested, as well as a question about the srcWrong directory/package

Also, is there a best practice for testing in C#, like a test runner/framework/pattern? I can add some integration tests once we get this merged so just wondering.

Thanks again!

flipt-csharp/src/Clients/Evaluation.cs Outdated Show resolved Hide resolved
flipt-csharp/srcWrong/Controllers/EvaluationController.cs Outdated Show resolved Hide resolved
[FLI-783 - C# Server Side SDK](flipt-io#86)
- Add Authentication
- Add Evaluation (Boolean, Variant, and Batch)
- Removed hardcoded "Bearer" prefix from AuthenticationHeaderValue constructor to use the value returned by _authenticationStrategy.GetAuthorizationHeader() method for more flexibility and customization.
- Also, removed unnecessary appsettings files, EvaluationController, DTOs, Models, and Program.cs.

Signed-off-by: vgwizardx <[email protected]>
@vgwizardx
Copy link
Contributor Author

vgwizardx commented Jun 20, 2024

@markphelps I fixed the issues you mentioned. Since the srcWrong didn't show in Visual Studio, I forgot I removed it, but it must not have been deleted from the folder. Now, the header will be set by the strategy. As far as patterns for testing. Xunit is commonly used, similar to junit.

This might be more than what you want, but you can do something like this for the integration test
https://blog.devgenius.io/integration-testing-in-net-8-b8ab83e7531d

You can also use other integration testing tools like Selenium, but I haven't set anything up like that.

If you just need something similar to how the Java test is set up. I probably could knock that out tonight.

@vgwizardx vgwizardx requested a review from markphelps June 20, 2024 16:45
Copy link
Contributor

@markphelps markphelps left a comment

Choose a reason for hiding this comment

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

this looks great! thank you @vgwizardx !

@markphelps
Copy link
Contributor

@markphelps I fixed the issues you mentioned. Since the srcWrong didn't show in Visual Studio, I forgot I removed it, but it must not have been deleted from the folder. Now, the header will be set by the strategy. As far as patterns for testing. Xunit is commonly used, similar to junit.

This might be more than what you want, but you can do something like this for the integration test https://blog.devgenius.io/integration-testing-in-net-8-b8ab83e7531d

You can also use other integration testing tools like Selenium, but I haven't set anything up like that.

If you just need something similar to how the Java test is set up. I probably could knock that out tonight.

No pressure! But if you are able to that would be amazing! yeah the tests are very basic at the moment, the Java one is probably a good reference as you mentioned

basically it just depends on FLIPT_URL and FLIPT_AUTH_TOKEN.

If you are able to get something going I can take it and hook it up to our CI, as we use Dagger and getting it all wired up takes a bit of time.

But if not I can also take a stab at writing a test if you don't have the time. Regardless this contribution is much appreciated! We've been asked by several people to have a C# SDK and now we can say we've got one!! Thanks again @vgwizardx

@kodiakhq kodiakhq bot merged commit 749b83e into flipt-io:main Jun 20, 2024
7 checks passed
This was referenced Jun 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants