{"id":28403841,"url":"https://github.com/openfga/sdk-generator","last_synced_at":"2025-06-27T08:32:19.429Z","repository":{"id":37062368,"uuid":"490433309","full_name":"openfga/sdk-generator","owner":"openfga","description":"OpenFGA Client SDK Generator","archived":false,"fork":false,"pushed_at":"2025-06-24T04:15:27.000Z","size":4204,"stargazers_count":23,"open_issues_count":53,"forks_count":55,"subscribers_count":16,"default_branch":"main","last_synced_at":"2025-06-24T05:27:04.690Z","etag":null,"topics":["access-control","authorization","fga","fine-grained-authorization","hacktoberfest","openfga","security","zanzibar"],"latest_commit_sha":null,"homepage":"","language":"Mustache","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openfga.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-05-09T20:23:20.000Z","updated_at":"2025-06-24T04:15:30.000Z","dependencies_parsed_at":"2025-04-30T17:39:49.645Z","dependency_job_id":"5a9a7207-8353-4e94-8b63-65e9bd36d39a","html_url":"https://github.com/openfga/sdk-generator","commit_stats":{"total_commits":117,"total_committers":8,"mean_commits":14.625,"dds":0.2991452991452992,"last_synced_commit":"fbd23706f648259dd61382a57243d45d64eace09"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/openfga/sdk-generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfga%2Fsdk-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfga%2Fsdk-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfga%2Fsdk-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfga%2Fsdk-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openfga","download_url":"https://codeload.github.com/openfga/sdk-generator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfga%2Fsdk-generator/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262222541,"owners_count":23277454,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["access-control","authorization","fga","fine-grained-authorization","hacktoberfest","openfga","security","zanzibar"],"created_at":"2025-06-01T19:11:01.181Z","updated_at":"2025-06-27T08:32:19.145Z","avatar_url":"https://github.com/openfga.png","language":"Mustache","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenFGA Client SDK Generator\n\n[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](./LICENSE)\n[![Join our community](https://img.shields.io/badge/slack-cncf_%23openfga-40abb8.svg?logo=slack)](https://openfga.dev/community)\n[![Twitter](https://img.shields.io/twitter/follow/openfga?color=%23179CF0\u0026logo=twitter\u0026style=flat-square \"@openfga on Twitter\")](https://twitter.com/openfga)\n\nThis is the main generator responsible for generating the OpenFGA SDKs from the [OpenFGA OpenAPIv2 Document](https://github.com/openfga/api/blob/main/docs/openapiv2/apidocs.swagger.json).\n\n## Table of Contents\n\n- [OpenFGA Client SDK Generator](#openfga-client-sdk-generator)\n  - [Table of Contents](#table-of-contents)\n  - [About](#about)\n  - [Resources](#resources)\n  - [Currently Supported SDKs](#currently-supported-sdks)\n  - [Getting Started](#getting-started)\n    - [Requirements](#requirements)\n    - [Usage](#usage)\n    - [Adding a new SDK](#adding-a-new-sdk)\n      - [Using the setup script](#using-the-setup-script)\n      - [Manually](#manually)\n    - [Uploading the SDK](#uploading-the-sdk)\n    - [Publishing/Open Sourcing the SDK](#publishingopen-sourcing-the-sdk)\n    - [GitHub Action Secrets](#github-action-secrets)\n  - [Contributing](#contributing)\n  - [Author](#author)\n  - [License](#license)\n\n## About\n\n[OpenFGA](https://openfga.dev) is an open source Fine-Grained Authorization solution inspired by [Google's Zanzibar paper](https://research.google/pubs/pub48190/). It was created by the FGA team at [Auth0](https://auth0.com) based on [Auth0 Fine-Grained Authorization (FGA)](https://fga.dev), available under [a permissive license (Apache-2)](https://github.com/openfga/rfcs/blob/main/LICENSE) and welcomes community contributions.\n\nOpenFGA is designed to make it easy for application builders to model their permission layer, and to add and integrate fine-grained authorization into their applications. OpenFGA’s design is optimized for reliability and low latency at a high scale.\n\n## Resources\n\n- [OpenFGA Documentation](https://openfga.dev/docs)\n- [OpenFGA API Documentation](https://openfga.dev/api/service)\n- [Twitter](https://twitter.com/openfga)\n- [OpenFGA Community](https://openfga.dev/community)\n- [Zanzibar Academy](https://zanzibar.academy)\n- [Google's Zanzibar Paper (2019)](https://research.google/pubs/pub48190/)\n\n## Currently Supported SDKs\n\n| Language   | GitHub                                                      | Package Manager                                                                                                                                                                                      |\n|------------|-------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Javascript | [openfga/js-sdk](https://github.com/openfga/js-sdk)         | [![@openfga/sdk on npm](https://img.shields.io/npm/v/@openfga/sdk.svg?label=@openfga/sdk\u0026style=flat-square)](https://www.npmjs.com/package/@openfga/sdk)                                             |\n| Go         | [openfga/go-sdk](https://github.com/openfga/go-sdk)         | [![OpenFGA Go SDK on GitHub](https://img.shields.io/github/v/release/openfga/go-sdk?label=openfga-go-sdk\u0026style=flat-square)](https://github.com/openfga/go-sdk)                                      |\n| .NET       | [openfga/dotnet-sdk](https://github.com/openfga/dotnet-sdk) | [![OpenFga.Sdk on NuGet](https://img.shields.io/nuget/v/OpenFga.Sdk?label=OpenFga.Sdk\u0026style=flat-square)](https://www.nuget.org/packages/OpenFga.Sdk)                                                |\n| Python     | [openfga/python-sdk](https://github.com/openfga/python-sdk) | [![openfga-sdk on PyPi](https://img.shields.io/pypi/v/openfga_sdk.svg?label=openfga-sdk\u0026style=flat-square)](https://pypi.org/project/openfga_sdk)                                                    |\n| Java       | [openfga/java-sdk](https://github.com/openfga/java-sdk)     | [![openfga-sdk on Maven Central](https://img.shields.io/maven-central/v/dev.openfga/openfga-sdk?style=flat-square\u0026label=openfga-sdk)](https://central.sonatype.com/artifact/dev.openfga/openfga-sdk) |\n\n\n## Getting Started\n\n### Requirements\n1. Git\n2. Docker\n3. Make (Optional, but makes things much easier)\n4. curl\n5. Bash\n6. sed\n\n### Usage\n\n1. Clone this repo:\n\n```shell\ngit clone git@github.com:openfga/sdk-generator.git\n```\n\n2. Clone existing SDKs into the clients directory\n\n```shell\ngit clone git@github.com:openfga/go-sdk.git clients/fga-go-sdk\ngit clone git@github.com:openfga/js-sdk.git clients/fga-js-sdk\ngit clone git@github.com:openfga/dotnet-sdk.git clients/fga-dotnet-sdk\ngit clone git@github.com:openfga/python-sdk.git clients/fga-python-sdk\ngit clone git@github.com:openfga/java-sdk.git clients/fga-java-sdk\n```\n\n3. Build and test the client sdks\n```shell\nmake\n```\n\n### Adding a new SDK\n\n#### Using the setup script\nThere is a helpful script to setup a new SDK\n\n```shell\nmake setup-new-sdk\n```\n\n1. It will ask you for a an SDK ID, use something like: go, js, dotnet, java, etc...\n2. It will ask you for a [valid generator](https://github.com/OpenAPITools/openapi-generator/blob/master/docs/generators.md)\n3. Then in will initialize all the files, you will need to add the configuration specific to that sdk\n4. Now you can run `make build-client-${SDK_ID}` to generate the SDK\n\n#### Manually\n\n1. Create config dir in: `config/clients/{lang}/`. It should include:\n   * `CHANGELOG.md`: To be updated as new releases are generated\n   * `generator.txt`: the name of the generator to use. Must be a [valid generator](https://github.com/OpenAPITools/openapi-generator/blob/master/docs/generators.md)\n   * `config.overrides.json`: Custom config for this generator + overrides to the common config in `config/common/config.base.json`\n   * `.openapi-generator-ignore`: Any files that the generator should ignore and not built\n   * `template-source`: Newer SDKs should have this to mark what commit of the generator we branched off\n   * `template/` directory\n      * `LICENSE`: Apache-2.0 License\n      * `.github/workflows/main.yml`: Any CI checks that need to run\n      * The following files, each with the relevant section (look at the JS template for an example):\n         * `README_installation.mustache`\n         * `README_initializing.mustache`\n         * `README_calling_api.mustache`\n         * `README_api_endpoints.mustache`\n         * `README_models.mustache`\n         * `README_license_disclaimer.mustache`\n         * `README_custom_badges.mustache` (optional, any custom badges for this specific SDK)\n         * `gitignore_custom.mustache` (optional, any custom ignores for this specific SDK)\n         * `NOTICE_details.mustache` (optional, see [Updating the Notice files](#updating-the-notice-files))\n      * custom files according to the generator\n2. Update the `Makefile`.\n   1. add a target for the new sdk\n```makefile\n.PHONY: build-client-{{LANG}}\nbuild-client-{{LANG}}:\n\tmake build-client sdk_language={{LANG}} tmpdir=${TMP_DIR}\n\t# ... any other custom build steps ...\n```\n   2. add it as a dependency to the `build-all-clients`\n```makefile\n.PHONY: build-all-clients\nbuild-all-clients: build-client-js build-client-go ...  build-client-{{LANG}}\n```\n   3. add a target for the new sdk's tests that depend on the build target\n```makefile\n.PHONY: test-client-{{LANG}}\ntest-client-{{LANG}}: build-client-{{LANG}}\n\t# ... any custom test code ...\n```\n   4. add it as a dependency to the `test-all-clients`\n```makefile\n.PHONY: test-all-clients\ntest-all-clients: test-client-js test-client-go ...  test-client-{{LANG}}\n```\n\n\u003e Note: Try to ensure that the SDK is built through container files so that other contributors would not need to set up the full language framework/toolchain whenever they need to contribute. Checkout the [go sdk build steps](https://github.com/openfga/sdk-generator/blob/bf6709a5faba14ce260f4f8df019dddd54078df0/Makefile#L76) as an example.\n\n### Updating the Notice files\n1- Ensure that `fossaComplianceNoticeId` has been set in each SDK's config overrides.\n2- Run `make update-fossa-reports`\n\n### Uploading the SDK\n\nOnce the SDK is ready, you need to:\n* Create a repo under the [openfga](https://github.com/openfga) github org. Call it: `${SDK_ID}-sdk`\n* Add it to the generator's test and deploy actions\n* Add any necessary secrets to the generator's repo on github (and document them in the readme)\n\n### Publishing/Open Sourcing the SDK\n\nOnce the SDK is ready, you need to:\n1. Setup Snyk, and ensure no security issues are present\n2. Setup Fossa, and ensure no compliance issues are present\n3. Request a review from the team\n\nNote: Semgrep will be automatically enabled - there is nothing you need to do for that.\n\n### GitHub Action Secrets\n\n| Key                         | Comment                                                                     |\n|-----------------------------|-----------------------------------------------------------------------------|\n| `FOSSA_API_KEY`             | FOSSA API Key                                                               |\n| `SNYK_TOKEN`                | Snyk API Key                                                                |\n\n## Contributing\nPlease review the [Contributing Guidelines](https://github.com/openfga/.github/blob/main/CONTRIBUTING.md) before sending a PR or opening an issue.\n\nIn addition, we ask that the SDKs:\n\n* be generated from the [openapiv2 swagger document](https://github.com/openfga/api/blob/main/docs/openapiv2/apidocs.swagger.json) using the sdk-generator.\n\n* have roughly the same consistent interface for configuration, such as [JS](https://github.com/openfga/js-sdk), [GoLang](https://github.com/openfga/go-sdk), [.NET](https://github.com/openfga/dotnet-sdk), [Python](https://github.com/openfga/python-sdk) and [Java](https://github.com/openfga/java-sdk) SDKs.\n\n* support the same features with other existing SDKs, including: Retries, Error Handling, .\n\n* have a base set of functional tests.\n\n* have no tests that talk to an external service (external calls should be disallowed and mocked).\n\n* have building \u0026 publishing automated through GitHub actions.\n\n* be created and modified through pull requests to this sdk-generator repository instead of individual repositories. Most of the code will be in mustache files that will end up generating the resulting SDK for the appropriate language.\n\n## Author\n\n[OpenFGA](https://github.com/openfga)\n\n## License\n\nThis project is licensed under the Apache-2.0 license. See the [LICENSE](https://github.com/openfga/sdk-generator/blob/main/LICENSE) file for more info.\n\nThe template files in this repo are based on the original files from [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenfga%2Fsdk-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenfga%2Fsdk-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenfga%2Fsdk-generator/lists"}