Skip to content

onehub/openfga-generated

Repository files navigation

openapi_client

OpenapiClient - the Ruby gem for the OpenFGA

A high performance and flexible authorization/permission engine built for developers and inspired by Google Zanzibar.

This SDK is automatically generated by the OpenAPI Generator project:

  • API version: 1.x
  • Package version: 1.0.0
  • Generator version: 7.7.0
  • Build package: org.openapitools.codegen.languages.RubyClientCodegen For more information, please visit https://openfga.dev

Installation

Build a gem

To build the Ruby code into a gem:

gem build openapi_client.gemspec

Then either install the gem locally:

gem install ./openapi_client-1.0.0.gem

(for development, run gem install --dev ./openapi_client-1.0.0.gem to install the development dependencies)

or publish the gem to a gem hosting service, e.g. RubyGems.

Finally add this to the Gemfile:

gem 'openapi_client', '~> 1.0.0'

Install from Git

If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:

gem 'openapi_client', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'

Include the Ruby code directly

Include the Ruby code directly using -I as follows:

ruby -Ilib script.rb

Getting Started

Please follow the installation procedure and then run the following code:

# Load the gem
require 'openapi_client'

api_instance = OpenapiClient::AssertionsApi.new
store_id = 'store_id_example' # String | 
authorization_model_id = 'authorization_model_id_example' # String | 

begin
  #Read assertions for an authorization model ID
  result = api_instance.read_assertions(store_id, authorization_model_id)
  p result
rescue OpenapiClient::ApiError => e
  puts "Exception when calling AssertionsApi->read_assertions: #{e}"
end

Documentation for API Endpoints

All URIs are relative to http://localhost

Class Method HTTP request Description
OpenapiClient::AssertionsApi read_assertions GET /stores/{store_id}/assertions/{authorization_model_id} Read assertions for an authorization model ID
OpenapiClient::AssertionsApi write_assertions PUT /stores/{store_id}/assertions/{authorization_model_id} Upsert assertions for an authorization model ID
OpenapiClient::AuthorizationModelsApi read_authorization_model GET /stores/{store_id}/authorization-models/{id} Return a particular version of an authorization model
OpenapiClient::AuthorizationModelsApi read_authorization_models GET /stores/{store_id}/authorization-models Return all the authorization models for a particular store
OpenapiClient::AuthorizationModelsApi write_authorization_model POST /stores/{store_id}/authorization-models Create a new authorization model
OpenapiClient::RelationshipQueriesApi check POST /stores/{store_id}/check Check whether a user is authorized to access an object
OpenapiClient::RelationshipQueriesApi expand POST /stores/{store_id}/expand Expand all relationships in userset tree format, and following userset rewrite rules. Useful to reason about and debug a certain relationship
OpenapiClient::RelationshipQueriesApi list_objects POST /stores/{store_id}/list-objects List all objects of the given type that the user has a relation with
OpenapiClient::RelationshipQueriesApi list_users POST /stores/{store_id}/list-users List the users matching the provided filter who have a certain relation to a particular type.
OpenapiClient::RelationshipQueriesApi streamed_list_objects POST /stores/{store_id}/streamed-list-objects Stream all objects of the given type that the user has a relation with
OpenapiClient::RelationshipTuplesApi read POST /stores/{store_id}/read Get tuples from the store that matches a query, without following userset rewrite rules
OpenapiClient::RelationshipTuplesApi read_changes GET /stores/{store_id}/changes Return a list of all the tuple changes
OpenapiClient::RelationshipTuplesApi write POST /stores/{store_id}/write Add or delete tuples from the store
OpenapiClient::StoresApi create_store POST /stores Create a store
OpenapiClient::StoresApi delete_store DELETE /stores/{store_id} Delete a store
OpenapiClient::StoresApi get_store GET /stores/{store_id} Get a store
OpenapiClient::StoresApi list_stores GET /stores List all stores

Documentation for Models

Documentation for Authorization

Endpoints do not require authorization.

About

Auto-generated API for OpenFGA

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published