rbac-api-client

RBACApiClient - the Ruby gem for the Role Based Access Control

The API for Role Based Access Control.

This SDK is automatically generated by the OpenAPI Generator project:

  • API version: 1.0.0
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.RubyClientCodegen

Installation

Build a gem

To build the Ruby code into a gem:

gem build rbac-api-client.gemspec

Then either install the gem locally:

gem install ./rbac-api-client-1.0.0.gem

(for development, run gem install --dev ./rbac-api-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 'rbac-api-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 'rbac-api-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 'rbac-api-client'

# Setup authorization
RBACApiClient.configure do |config|
  # Configure HTTP basic authorization: basic_auth
  config.username = 'YOUR_USERNAME'
  config.password = 'YOUR_PASSWORD'
end

api_instance = RBACApiClient::AccessApi.new
application = 'application_example' # String | The application name to obtain access for the principal
opts = {
  username: 'username_example', # String | Unique username of the principal to obtain access for (only available for admins, and if supplied, takes precedence over the identity header).
  limit: 10, # Integer | Parameter for selecting the amount of data returned.
  offset: 0 # Integer | Parameter for selecting the offset of data.
}

begin
  #Get the permitted access for a principal in the tenant (defaults to principal from the identity header)
  result = api_instance.get_principal_access(application, opts)
  p result
rescue RBACApiClient::ApiError => e
  puts "Exception when calling AccessApi->get_principal_access: #{e}"
end

Documentation for API Endpoints

All URIs are relative to http://localhost/api/rbac/v1

Class Method HTTP request Description
RBACApiClient::AccessApi get_principal_access GET /access/ Get the permitted access for a principal in the tenant (defaults to principal from the identity header)
RBACApiClient::GroupApi add_principal_to_group POST /groups/uuid/principals/ Add a principal to a group in the tenant
RBACApiClient::GroupApi add_role_to_group POST /groups/uuid/roles/ Add a role to a group in the tenant
RBACApiClient::GroupApi create_group POST /groups/ Create a group in a tenant
RBACApiClient::GroupApi delete_group DELETE /groups/uuid/ Delete a group in the tenant
RBACApiClient::GroupApi delete_principal_from_group DELETE /groups/uuid/principals/ Remove a principal from a group in the tenant
RBACApiClient::GroupApi delete_role_from_group DELETE /groups/uuid/roles/ Remove a role from a group in the tenant
RBACApiClient::GroupApi get_group GET /groups/uuid/ Get a group in the tenant
RBACApiClient::GroupApi get_principals_from_group GET /groups/uuid/principals/ Get a list of principals from a group in the tenant
RBACApiClient::GroupApi list_groups GET /groups/ List the groups for a tenant
RBACApiClient::GroupApi list_roles_for_group GET /groups/uuid/roles/ List the roles for a group in the tenant
RBACApiClient::GroupApi update_group PUT /groups/uuid/ Udate a group in the tenant
RBACApiClient::PolicyApi create_policies POST /policies/ Create a policy in a tenant
RBACApiClient::PolicyApi delete_policy DELETE /policies/uuid/ Delete a policy in the tenant
RBACApiClient::PolicyApi get_policy GET /policies/uuid/ Get a policy in the tenant
RBACApiClient::PolicyApi list_policies GET /policies/ List the policies in the tenant
RBACApiClient::PolicyApi update_policy PUT /policies/uuid/ Update a policy in the tenant
RBACApiClient::PrincipalApi list_principals GET /principals/ List the principals for a tenant
RBACApiClient::RoleApi create_roles POST /roles/ Create a roles for a tenant
RBACApiClient::RoleApi delete_role DELETE /roles/uuid/ Delete a role in the tenant
RBACApiClient::RoleApi get_role GET /roles/uuid/ Get a role in the tenant
RBACApiClient::RoleApi get_role_access GET /roles/uuid/access/ Get access for a role in the tenant
RBACApiClient::RoleApi list_roles GET /roles/ List the roles for a tenant
RBACApiClient::RoleApi update_role PUT /roles/uuid/ Update a Role in the tenant
RBACApiClient::StatusApi get_status GET /status/ Obtain server status

Documentation for Models

Documentation for Authorization

basic_auth

  • Type: HTTP basic authentication