Sha256: 05d8a5604134c37ed45e134995ae87d000c0bfbe8473a0170ba29c2e970e9c38

Contents?: true

Size: 1.25 KB

Versions: 8

Compression:

Stored size: 1.25 KB

Contents

# frozen_string_literal: true

require_relative "v2/client"

module Aserto
  module Directory
    class Client
      # Creates a new Directory Client
      #
      # @param url [String] the gRpc url of the directory server
      # @param api_key [String] the api key of the directory server(for hosted directory)
      # @param tenant_id [String] the tenant id of the directory server(for hosted directory)
      # @param cert_path [String] the path to the certificates folder
      #
      # @return [Aserto::Directory::Client] the new Directory Client

      def initialize(url: "directory.prod.aserto.com:8443", api_key: nil, tenant_id: nil, cert_path: nil)
        warn WARN_MESSAGE

        @v2_client = Aserto::Directory::V2::Client.new(
          url: url, api_key: api_key, tenant_id: tenant_id, cert_path: cert_path
        )
      end

      def method_missing(method, args)
        @v2_client.send(method, **args)
      end

      def respond_to_missing?(_name, _include_private)
        true
      end

      WARN_MESSAGE = <<~TEXT
        Aserto::Directory::Client is deprecated and will be removed.
        Use Aserto::Directory::V3::Client for the latest Directory Client.
        If you need Directory V2, use Aserto::Directory::V2::Client
      TEXT
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
aserto-0.31.3 lib/aserto/directory/client.rb
aserto-0.31.2 lib/aserto/directory/client.rb
aserto-0.31.1 lib/aserto/directory/client.rb
aserto-0.31.0 lib/aserto/directory/client.rb
aserto-0.30.6 lib/aserto/directory/client.rb
aserto-0.30.5 lib/aserto/directory/client.rb
aserto-0.30.4 lib/aserto/directory/client.rb
aserto-0.30.1 lib/aserto/directory/client.rb