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

[FLI-783] C# Server Side SDK #86

Closed
2 tasks
markphelps opened this issue Jan 20, 2024 · 20 comments
Closed
2 tasks

[FLI-783] C# Server Side SDK #86

markphelps opened this issue Jan 20, 2024 · 20 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed new-language

Comments

@markphelps
Copy link
Contributor

markphelps commented Jan 20, 2024

Language

C#

Willing to Implement

  • I'm willing to help implement the Flipt Server SDK in this language if it's accepted. 🙌

Willing to Review

  • I'm willing to review contributions to the Flipt Server SDK in this language if it's accepted.

Additional Notes

Re: flipt-io/flipt#2208

FLI-783

@markphelps markphelps changed the title C# Server Side SDK [FLI-783] C# Server Side SDK Jan 20, 2024
@GeorgeMac GeorgeMac mentioned this issue Feb 6, 2024
Closed
@markphelps markphelps added good first issue Good for newcomers help wanted Extra attention is needed labels Mar 8, 2024
@mrjavaguy
Copy link

https://github.com/mrjavaguy/flipt-rest-dotnet/tree/main is an example rest of the openapi, is this what you are after? It used a code generator.
I am also consider writing a dotnet provider for OpenFeature

@markphelps
Copy link
Contributor Author

Hey @mrjavaguy ! Thanks for looking at this! We're totally down for using generated code as long as its idiomatic. Ive only done a bit of C# so would def want to lean on your experience here.

Also, our current Server Side SDKs only expose the Evaluation APIs and (ideally) ListFlags. Would it be possible to have the generator only generate those methods to keep it consistent with the other languages?

A user in Discord mentioned they were working on a C# OpenFeature SDK as well (unless that was you ;) ) Let me try and find that thread

@markphelps
Copy link
Contributor Author

@vgwizardx
Copy link
Contributor

vgwizardx commented May 29, 2024

@markphelps So you are looking for Evaluation Api and ListFlag. Are there any other requirements you would like for the C# SDK? I think I'll take a stab at it. Is this the endpoint for the listflags that you are talking about? {{baseUrl}}/api/v1/namespaces/:namespaceKey/flags?limit=<integer>&offset=<integer>&pageToken=<string>&reference=<string>

@markphelps
Copy link
Contributor Author

Thanks @vgwizardx !! That would be very much appreciated!

Yes I think the main REST endpoints we need supported are:

With support for authentication: https://docs.flipt.io/reference/overview#authentication

@vgwizardx
Copy link
Contributor

@markphelps Hey, I was wondering how ListFlags is used. I'm only asking because I can't really think of a situation where a service using the flags would want to list all the flags. Wouldn't you just use the UI?

@markphelps
Copy link
Contributor Author

@vgwizardx yeah i see your point, and that's what we initially thought as well. we did have one or two users request ListFlags in some of our other SDKs so we thought it would be good for parity. However we can also add that later if it's required specifically for this C# SDK.

Happy to just have the evaluation calls implemented for now!

@vgwizardx
Copy link
Contributor

@markphelps Cool, I'm working on auth now, and then I will take some time to test it all out.

@markphelps
Copy link
Contributor Author

@vgwizardx awesome! lmk if I can help with anything

@erka erka mentioned this issue Jun 13, 2024
2 tasks
@vgwizardx
Copy link
Contributor

vgwizardx commented Jun 15, 2024

@markphelps I got super busy, but I wanted to share what I have so far. I haven't had a chance to test this and might not until next week, but here is what I have so far: https://github.com/vgwizardx/flipt-server-sdks/tree/CSharp-Sdk. @erka If you have time to give this a try, feel free to do so and let me know.

@markphelps
Copy link
Contributor Author

This is looking great @vgwizardx !! thank you! do you want to open it up as a PR and we can give it a proper review?

@vgwizardx
Copy link
Contributor

@markphelps Yeah, I can do that today. Since I have yet to have a chance to test it and will be busy (My daughter graduated high school this year). So that can help if someone else can give it a try and make sure it is working properly.

@markphelps
Copy link
Contributor Author

@markphelps Yeah, I can do that today. Since I have yet to have a chance to test it and will be busy (My daughter graduated high school this year). So that can help if someone else can give it a try and make sure it is working properly.

Sounds great. thanks @vgwizardx ! and congrats to your daughter!! 🎓

vgwizardx pushed a commit to vgwizardx/flipt-server-sdks that referenced this issue Jun 19, 2024
flipt-io#86
- Add Authentication
- Add Evaluation (Boolean, Variant and Batch)
vgwizardx pushed a commit to vgwizardx/flipt-server-sdks that referenced this issue Jun 20, 2024
[FLI-783 - C# Server Side SDK](flipt-io#86)
- Add Authentication
- Add Evaluation (Boolean, Variant, and Batch)

Signed-off-by: vgwizardx <[email protected]>
vgwizardx pushed a commit to vgwizardx/flipt-server-sdks that referenced this issue Jun 20, 2024
[FLI-783 - C# Server Side SDK](flipt-io#86)
- Add Authentication
- Add Evaluation (Boolean, Variant, and Batch)

Signed-off-by: vgwizardx <[email protected]>
vgwizardx pushed a commit to vgwizardx/flipt-server-sdks that referenced this issue Jun 20, 2024
[FLI-783 - C# Server Side SDK](flipt-io#86)
- Add Authentication
- Add Evaluation (Boolean, Variant, and Batch)

Signed-off-by: vgwizardx <[email protected]>
vgwizardx pushed a commit to vgwizardx/flipt-server-sdks that referenced this issue Jun 20, 2024
[FLI-783 - C# Server Side SDK](flipt-io#86)
- Add Authentication
- Add Evaluation (Boolean, Variant, and Batch)

Signed-off-by: vgwizardx <[email protected]>
vgwizardx added a commit to vgwizardx/flipt-server-sdks that referenced this issue Jun 20, 2024
[FLI-783 - C# Server Side SDK](flipt-io#86)
- Add Authentication
- Add Evaluation (Boolean, Variant, and Batch)

Signed-off-by: vgwizardx <[email protected]>
vgwizardx added a commit to vgwizardx/flipt-server-sdks that referenced this issue Jun 20, 2024
[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]>
kodiakhq bot pushed a commit that referenced this issue Jun 20, 2024
[FLI-783 - C# Server Side SDK](#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

@markphelps don't forget to close this.

@markphelps
Copy link
Contributor Author

Yup, just waiting until we setup CD to push to nuget and will close. Thanks @vgwizardx !

@markphelps
Copy link
Contributor Author

@vgwizardx Im working on getting this SDK released to Nuget and I have a naming question for you (or others familiar with .NET/C# ecosystem)

Should we call this SDK flipt-dotnet or flipt-csharp? Is there a common idiom for naming?

I ask because we have an existing gRPC SDK that we named flipt-grpc-dotnet, so i'd prefer to stick with dotnet if it makes sense.

@markphelps
Copy link
Contributor Author

markphelps commented Jun 21, 2024

Actually.. nevermind it seems we just called it Flipt.grpc

dotnet add package Flipt.gRPC --version 0.x.x

so I'll just call this Flipt

@vgwizardx
Copy link
Contributor

vgwizardx commented Jun 21, 2024

@markphelps Yeah, I would just call it Flipt. Another good thing to do is to start with version 0.0.1 (if we are saying alpha) or 8.0.0 and let the first number match the .net version.

@markphelps
Copy link
Contributor Author

Published here: https://www.nuget.org/packages/Flipt/

Thanks for all your help @vgwizardx !! It really means a lot!

@vgwizardx
Copy link
Contributor

I'm happy to help. I will be using this sometime soon, so I will send PRs if I find any improvements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed new-language
Projects
None yet
Development

No branches or pull requests

3 participants