The generator for the Kinde Ruby SDK.
This generator creates an SDK in Ruby that can authenticate to Kinde using the Authorization Code grant or the Authorization Code with PKCE grant via the OAuth 2.0 protocol. It can also access the Kinde Management API using the client credentials grant.
Also, see the SDKs section in Kinde’s contributing guidelines.
You will need the following tools to be able to generate the SDK.
This generator requires the Node Package Manager (NPM) to be installed and added to your path.
The generator also requires Ruby to be installed, in addition please ensure that you have the Rubocop gem installed
and available in your PATH
.
This generator makes use of the OpenAPI Generator CLI via the NPM package @openapitools/openapi-generator-cli, which
requires that you have OpenJDK installed and the JAVA_HOME
variable
added to your path.
-
Clone the repository to your machine:
git clone https://github.com/kinde-oss/kinde-ruby-generator.git
-
Go into the project:
cd kinde-ruby-generator
-
Install the OpenAPI Generator tool:
Run the following command to generate the SDK:
./generate.sh <path-to-kinde-api-spec>.yaml <path-to-generated-result>
The <path-to-kinde-api-spec>.yaml
and path-to-generated-result
are optional arguments whose default values are kinde-mgmt-api-specs.yaml
and ./kinde_api
respectively. kinde-mgmt-api-specs.yaml
will be automatically be downloaded from https://kinde.com/api/kinde-mgmt-api-specs.yaml.
The easiest way to use the generator is to just:
- Copy
generate.sh
andfiles
folder intokinde_sdk
gem filepath root - Run
./generate.sh
with no arguments. - After all you'll need to remove
generate.sh
andfiles
, then add all the new files if any withgit add .
and make a new commit intokinde_sdk
repo.
Be sure that SDK path in gemspec of kinde_sdk
gem is the same as path-to-generated-result
. If it is different from what it already is (default value is ./kinde-sdk
), the auto deletion from the generation script will not work and you will need to delete it manually first. After the generation step just copy the output folder with the generated result into kinde_sdk
root path and run rubocop -A
from kinde_sdk
directory. The only thing you'll probably want to do manually is just some kinde-sdk/README.md
edits - you don't need to keep the auto-generated installation part at all.
Note: The API specifications should always point to Kinde's hosted version: https://kinde.com/api/kinde-mgmt-api-specs.yaml. This is set via the -i
option in the OpenAPI Generator CLI, for example:
openapi-generator-cli generate -i https://kinde.com/api/kinde-mgmt-api-specs.yaml
The SDK gets outputted to: <path-to-generated-result>
, which you can enter via:
cd <path-to-generated-result>
The instructions provided in the "Usage" section above are sufficient to get you started.
Please refer to Kinde’s contributing guidelines.
By contributing to Kinde, you agree that your contributions will be licensed under its MIT License.