Aserto::directory

Gem Version ci slack

Ruby generated GRPC client for Aserto directory

Installation

Add this line to your application's Gemfile:

gem 'aserto-directory'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install aserto-directory

Usage

require 'aserto/directory'

request = Aserto::Directory::Reader::V3::GetObjectRequest.new(
  object_type: "user",
  object_id: '[email protected]'
)

client = Aserto::Directory::Reader::V3::Reader::Stub.new(
  "directory.eng.aserto.com:8443",
  GRPC::Core::ChannelCredentials.new
)

begin
  resp = client.get_object(
    request,
    {
      metadata: {
        "authorization": 'my-bearer-token',
        "aserto-tenant-id": 'my-tenant-id'
      }
    }
  )

  # use response
  puts resp.inspect
rescue GRPC::BadStatus => e
  # handle error
  puts e.inspect
end

Development

Prerequisites: - Ruby >= 3.0.0 to run the code

After checking out the repo, run make buf-generate to generate Ruby code.

Run bundle install to install dependencies. Then, run bundle exec rspec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/aserto-dev/ruby-directory. This project is intended to be a safe, welcoming space for collaboration.

License

The gem is available as open source under the terms of the Apache-2.0 License.