Skip to content

kinde-oss/python-sdk-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kinde Python generator

The generator for the Kinde Python SDK.

PRs Welcome Kinde Docs Kinde Community

Overview

This generator creates an SDK in Python 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.

Usage

Initial set up

  1. Clone the repository to your machine:

    git clone https://github.com/kinde-oss/python-sdk-generator.git
  2. Go into the project:

    cd python-sdk-generator
  3. Install the OpenAPI Generator tool:

    https://openapi-generator.tech/docs/installation

SDK generation

Run the following command to generate the SDK:

_JAVA_OPTIONS="--add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED"  openapi-generator-cli generate -g python -i https://kinde.com/api/kinde-mgmt-api-specs.yaml  --additional-properties=packageName=kinde_sdk -c config.yaml -o ../kinde-python-sdk/ --skip-validate-spec

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: kinde-python-sdk, which you can enter via:

cd ../kinde-python-sdk

Folder kinde-python-sdk in the parent directory contains our final SDK after build.

Note: Please replace {businessName} with domain name from Kinde in kinde_sdk/configuration.py after generating the SDK

...
    def get_host_settings(self):
        """Gets an array of host settings

        :return: An array of host settings
        """
        return [
            {
                'url': "https://{businessName}.kinde.com",
                'description': "No description provided",
                'variables': {
                    'businessName': {
                        'description': "Business Name created in the Kinde Console",
                        'default_value': "app",
                    }
                }
            }
        ]
...

SDK documentation

Python SDK

Development

The instructions provided in the "Usage → Initial set up" section above are sufficient to get you started.

Contributing

Please refer to Kinde’s contributing guidelines.

License

By contributing to Kinde, you agree that your contributions will be licensed under its MIT License.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published