OpenfgaClient - 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.8.0
- Build package: org.openapitools.codegen.languages.RubyClientCodegen For more information, please visit https://openfga.dev
To build the Ruby code into a gem:
gem build openfga_client.gemspec
Then either install the gem locally:
gem install ./openfga_client-1.0.0.gem
(for development, run gem install --dev ./openfga_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 'openfga_client', '~> 1.0.0'
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 'openfga_client', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
Include the Ruby code directly using -I
as follows:
ruby -Ilib script.rb
Please follow the installation procedure and then run the following code:
# Load the gem
require 'openfga_client'
api_instance = OpenfgaClient::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 OpenfgaClient::ApiError => e
puts "Exception when calling AssertionsApi->read_assertions: #{e}"
end
All URIs are relative to http://localhost
Class | Method | HTTP request | Description |
---|---|---|---|
OpenfgaClient::AssertionsApi | read_assertions | GET /stores/{store_id}/assertions/{authorization_model_id} | Read assertions for an authorization model ID |
OpenfgaClient::AssertionsApi | write_assertions | PUT /stores/{store_id}/assertions/{authorization_model_id} | Upsert assertions for an authorization model ID |
OpenfgaClient::AuthorizationModelsApi | read_authorization_model | GET /stores/{store_id}/authorization-models/{id} | Return a particular version of an authorization model |
OpenfgaClient::AuthorizationModelsApi | read_authorization_models | GET /stores/{store_id}/authorization-models | Return all the authorization models for a particular store |
OpenfgaClient::AuthorizationModelsApi | write_authorization_model | POST /stores/{store_id}/authorization-models | Create a new authorization model |
OpenfgaClient::RelationshipQueriesApi | check | POST /stores/{store_id}/check | Check whether a user is authorized to access an object |
OpenfgaClient::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 |
OpenfgaClient::RelationshipQueriesApi | list_objects | POST /stores/{store_id}/list-objects | List all objects of the given type that the user has a relation with |
OpenfgaClient::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. |
OpenfgaClient::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 |
OpenfgaClient::RelationshipTuplesApi | read | POST /stores/{store_id}/read | Get tuples from the store that matches a query, without following userset rewrite rules |
OpenfgaClient::RelationshipTuplesApi | read_changes | GET /stores/{store_id}/changes | Return a list of all the tuple changes |
OpenfgaClient::RelationshipTuplesApi | write | POST /stores/{store_id}/write | Add or delete tuples from the store |
OpenfgaClient::StoresApi | create_store | POST /stores | Create a store |
OpenfgaClient::StoresApi | delete_store | DELETE /stores/{store_id} | Delete a store |
OpenfgaClient::StoresApi | get_store | GET /stores/{store_id} | Get a store |
OpenfgaClient::StoresApi | list_stores | GET /stores | List all stores |
- OpenfgaClient::AbortedMessageResponse
- OpenfgaClient::Any
- OpenfgaClient::Assertion
- OpenfgaClient::AssertionTupleKey
- OpenfgaClient::AuthorizationModel
- OpenfgaClient::CheckRequest
- OpenfgaClient::CheckRequestTupleKey
- OpenfgaClient::CheckResponse
- OpenfgaClient::Computed
- OpenfgaClient::Condition
- OpenfgaClient::ConditionMetadata
- OpenfgaClient::ConditionParamTypeRef
- OpenfgaClient::ConsistencyPreference
- OpenfgaClient::ContextualTupleKeys
- OpenfgaClient::CreateStoreRequest
- OpenfgaClient::CreateStoreResponse
- OpenfgaClient::ErrorCode
- OpenfgaClient::ExpandRequest
- OpenfgaClient::ExpandRequestTupleKey
- OpenfgaClient::ExpandResponse
- OpenfgaClient::GetStoreResponse
- OpenfgaClient::InternalErrorCode
- OpenfgaClient::InternalErrorMessageResponse
- OpenfgaClient::Leaf
- OpenfgaClient::ListObjectsRequest
- OpenfgaClient::ListObjectsResponse
- OpenfgaClient::ListStoresResponse
- OpenfgaClient::ListUsersRequest
- OpenfgaClient::ListUsersResponse
- OpenfgaClient::Metadata
- OpenfgaClient::Node
- OpenfgaClient::Nodes
- OpenfgaClient::NotFoundErrorCode
- OpenfgaClient::NullValue
- OpenfgaClient::Object
- OpenfgaClient::ObjectRelation
- OpenfgaClient::PathUnknownErrorMessageResponse
- OpenfgaClient::ReadAssertionsResponse
- OpenfgaClient::ReadAuthorizationModelResponse
- OpenfgaClient::ReadAuthorizationModelsResponse
- OpenfgaClient::ReadChangesResponse
- OpenfgaClient::ReadRequest
- OpenfgaClient::ReadRequestTupleKey
- OpenfgaClient::ReadResponse
- OpenfgaClient::RelationMetadata
- OpenfgaClient::RelationReference
- OpenfgaClient::RelationshipCondition
- OpenfgaClient::SourceInfo
- OpenfgaClient::Status
- OpenfgaClient::Store
- OpenfgaClient::StreamResultOfStreamedListObjectsResponse
- OpenfgaClient::StreamedListObjectsResponse
- OpenfgaClient::Tuple
- OpenfgaClient::TupleChange
- OpenfgaClient::TupleKey
- OpenfgaClient::TupleKeyWithoutCondition
- OpenfgaClient::TupleOperation
- OpenfgaClient::TypeDefinition
- OpenfgaClient::TypeName
- OpenfgaClient::TypedWildcard
- OpenfgaClient::UnauthenticatedResponse
- OpenfgaClient::UnprocessableContentErrorCode
- OpenfgaClient::UnprocessableContentMessageResponse
- OpenfgaClient::User
- OpenfgaClient::UserTypeFilter
- OpenfgaClient::Users
- OpenfgaClient::Userset
- OpenfgaClient::UsersetTree
- OpenfgaClient::UsersetTreeDifference
- OpenfgaClient::UsersetTreeTupleToUserset
- OpenfgaClient::UsersetUser
- OpenfgaClient::Usersets
- OpenfgaClient::V1Difference
- OpenfgaClient::V1TupleToUserset
- OpenfgaClient::ValidationErrorMessageResponse
- OpenfgaClient::WriteAssertionsRequest
- OpenfgaClient::WriteAuthorizationModelRequest
- OpenfgaClient::WriteAuthorizationModelResponse
- OpenfgaClient::WriteRequest
- OpenfgaClient::WriteRequestDeletes
- OpenfgaClient::WriteRequestWrites
Endpoints do not require authorization.