Giter VIP home page Giter VIP logo

fusionauth-client-builder's Introduction

FusionAuth Client Builder semver 2.0.0 compliant

Credits

Thanks to the following folks for your most excellent contributions!

Contributing

If you want to help us directly support and publish this library, there are a few ways you can help.

We start with a JSON DSL to define each API ( https://github.com/FusionAuth/fusionauth-client-builder/tree/master/src/main/api ).

We then build the code using a template, for example, here is the ruby template : https://github.com/FusionAuth/fusionauth-client-builder/blob/master/src/main/client/ruby.client.ftl

This ruby template then produces the ruby client.

https://github.com/FusionAuth/fusionauth-ruby-client

https://github.com/FusionAuth/fusionauth-ruby-client/blob/master/lib/fusionauth/fusionauth_client.rb

You can pick the current client library template for the language closest to the language you want to support. Let's say it is ruby. You will copy the ruby client template (https://github.com/FusionAuth/fusionauth-client-builder/blob/master/src/main/client/ruby.client.ftl) to .client.ftl and then start hacking on it.

With that template we can then build the client each time we release.

You can also build a library any other way; the chances of us supporting custom builds are low, but you can add your library to the contrib repo: https://github.com/FusionAuth/fusionauth-contrib/

Build a client library

Setup Savant

Linux or macOS

mkdir ~/savant
cd ~/savant
wget http://savant.inversoft.org/org/savantbuild/savant-core/2.0.0-RC.7/savant-2.0.0-RC.7.tar.gz
tar xvfz savant-2.0.0-RC.7.tar.gz
ln -s ./savant-2.0.0-RC.7 current
export PATH=$PATH:~/savant/current/bin/

You may optionally want to add ~/savant/current/bin to your PATH that is set in your profile so that this change persists. You'll also need to ensure that you have Java >= 8 installed and the environment variable JAVA_HOME is set.

Building

Listing each client library build targets

sb --listTargets

Building a single library

To build a single client library, you'll want to have the corresponding repo checked out in the same parent directory.

For example, your directory structure should look something like the following:

fusionauth
├── fusionauth-client-builder
├── fusionauth-android-client
├── fusionauth-csharp-client
├── fusionauth-java-client
├── fusionauth-openapi
├── fusionauth-php-client
├── fusionauth-python-client
├── fusionauth-ruby-client
├── fusionauth-swift-client
├── fusionauth-typescript-client
└── go-client

The client builder will assume the project is in the same parent directory.

sb build-java

Building all clients

sb build-all

For more information on the Savant build tool, checkout savantbuild.org.

Adding a new language

If you want to help us directly support and publish a new language, there are a few ways you can help.

We start with a JSON DSL to define each API operation.

We then build the code using a template. For example, here is the ruby template

This ruby template then produces the ruby client:

https://github.com/FusionAuth/fusionauth-ruby-client

https://github.com/FusionAuth/fusionauth-ruby-client/blob/master/lib/fusionauth/fusionauth_client.rb

So if you wanted to add support for a new language, such as elixir, you want to:

  • Find an existing supported language which is close to it in terms of syntax and style. In this case, ruby would be a good candidate.
  • Copy the ruby client template to elixir.client.ftl
  • Start hacking on it.

With that template complete, we can then build the Elixir client each time we release.

Feel free to open an issue in our issues tracker, either here or in the central one to let us know about your efforts or to ask for help.

fusionauth-client-builder's People

Contributors

alex-fusionauth avatar alexeyraga avatar andrewpai avatar andystanley avatar codercatdev avatar eitan1112 avatar eprenaud avatar fusionandy avatar grimthereaper avatar jfairley avatar johnjeffers avatar lyleschemmerling avatar markschmid avatar matthew-altman avatar matthewhartstonge avatar mcbrandenburg avatar medhir avatar mmanes avatar mooreds avatar rdvanbuuren avatar robfusion avatar robotdan avatar spwitt avatar tjpeden avatar trex avatar tyduptyler13 avatar varun7387 avatar vcampitelli avatar voidmain avatar zac300 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fusionauth-client-builder's Issues

Userinfo endpoint

It would be great if someone could implement OIDC Userinfo endpoint in the clients, since it's a common one to call.
I tried to fork the client builder and implement it myself to open a pull request but I couldn't figure out how authorization headers are specified in the builder's specification language.

Repository Stutter

I've noticed that all of the client library repositories start with fusionauth. In languages like go, this leads to package stuttering (fusionauth/fusionauth-go-client). Any reason why it shouldn't just be {language}-client?

Crystal language support?

https://crystal-lang.org/

I know it's a small language popularity wise, but it's something I'm currently using for FusionAuth. I'm just using REST calls to FusionAuth, but would like know if it's an option for FusionAuth to just support it directly. Crystal has a very similar syntax to Ruby, so I would hope that makes it easier.

I'm also open to contribute by adding the implementation as well.

Class Generation

Hey, I am currently trying to implement the Rust Package. But I am not 100% sure how this package is intended to work.
As far as I am able to understand you can generate the Request functions. But sometimes you are using generated Classes? How are they generated? What is the Purpose of it? Is it some kind of Request Body? Can I autogenerate them?
Are the responses Autogenerated?

As far as I am able to tell this is the last thing for me to do.

Bildschirmfoto 2024-01-04 um 19 15 08

go-client: run `go fmt` after code generation.

Hey team,

As a nice to have, it would be great to conform to standard Go code formatting by running go fmt on both files after generation 😄

Makes it more uniform when reading/reviewing Go code 👍

For example:
image

Becomes:
image

(I would imagine this to be a similar thing with dart and dart format)

Savant won't generate client code on Windows

I've setup Savant on Windows, but run into a problem when I try to generate the netcore client.
I've downloaded the compiled version of Savant from http://savant.inversoft.org/org/savantbuild/savant-core/1.0.0/savant-1.0.0.tar.gz and extracted it. So far so good. I've added the bin folder to my path. First problem I ran into was that the org.savantbuild.run.Main wasn't found. After some research I found out that it had to be org.savantbuild.runtime.Main. So after setting this up correctly I run into the following error, which I can't resolve:

Build failed due to an exception or error. freemarker.template.TemplateNotFoundException: Template not found for name "C:\\Projects\\fusionauth\\fusionauth-client-builder\\src\\main\\client\\netcore.client.ftl". The name was interpreted by this TemplateLoader: FileTemplateLoader(baseDir="C:\", canonicalBasePath="C:\"). Warning: The name contains backslash ("\") instead of slash ("/"); template names should use slash only. at freemarker.template.Configuration.getTemplate(Configuration.java:2797) at freemarker.template.Configuration.getTemplate(Configuration.java:2599) at freemarker.template.Configuration$getTemplate$3.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125) at com.inversoft.savant.plugin.clientLibrary.ClientLibraryPlugin.outputFile(ClientLibraryPlugin.groovy:101) at com.inversoft.savant.plugin.clientLibrary.ClientLibraryPlugin$outputFile$0.callCurrent(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:154) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:190) at com.inversoft.savant.plugin.clientLibrary.ClientLibraryPlugin.buildClient(ClientLibraryPlugin.groovy:97) at com.inversoft.savant.plugin.clientLibrary.ClientLibraryPlugin$buildClient.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125) at build$_run_closure13.doCall(build.savant:125) at build$_run_closure13.doCall(build.savant) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325) at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1021) at groovy.lang.Closure.call(Closure.java:426) at groovy.lang.Closure.call(Closure.java:420) at groovy.lang.Closure.run(Closure.java:507) at org.savantbuild.runtime.DefaultProjectRunner.runTarget(DefaultProjectRunner.java:95) at org.savantbuild.runtime.DefaultProjectRunner.lambda$run$5(DefaultProjectRunner.java:89) at java.util.ArrayList.forEach(Unknown Source) at org.savantbuild.runtime.DefaultProjectRunner.run(DefaultProjectRunner.java:72) at org.savantbuild.runtime.DefaultBuildRunner.run(DefaultBuildRunner.java:81) at org.savantbuild.runtime.Main.main(Main.java:81)

Any ideas on how to fix this issue?
Best regards,
Rick

src/main/domain/io.fusionauth.domain.User.json missing username field

I'm using https://github.com/FusionAuth/go-client and it seems that newest versions no longer have Username field in User struct (current code uses something from 2020).
Upon some digging I've landed here & found out that it was removed in c9a82b0#diff-944105f2fe047707376c0d76f2d9c69625e6c7f65f21fb6d0ba159e889282077
Could this field be restored?
It's still listed in https://fusionauth.io/docs/v1/tech/apis/users#create-a-user & https://fusionauth.io/docs/v1/tech/apis/registrations#create-a-user-and-registration-combined

Support anonymous resend of email verification

This issue popped up here: FusionAuth/go-client#55

We support resending the email with an API key: https://github.com/FusionAuth/fusionauth-client-builder/blob/master/src/main/api/resendEmailVerification.json

But not resending without an API key, though that is supported via the API: https://fusionauth.io/docs/v1/tech/apis/users/#resend-verification-email

We should create an anonymous client library call, the same way we have an anonymous changePassword call: https://github.com/FusionAuth/fusionauth-client-builder/blob/master/src/main/api/changePassword.json

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.