Class: BitwardenSDKSecrets::BitwardenClient

Inherits:
Object
  • Object
show all
Defined in:
lib/bitwarden-sdk-secrets.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(bitwarden_settings) ⇒ BitwardenClient

Returns a new instance of BitwardenClient.



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/bitwarden-sdk-secrets.rb', line 32

def initialize(bitwarden_settings)
  client_settings = ClientSettings.new(
    api_url: bitwarden_settings.api_url,
    identity_url: bitwarden_settings.identity_url,
    user_agent: 'Bitwarden RUBY-SDK',
    device_type: nil
  )

  @bitwarden = BitwardenLib
  @handle = @bitwarden.init(client_settings.to_dynamic.compact.to_json)
  @command_runner = CommandRunner.new(@bitwarden, @handle)
  @projects = ProjectsClient.new(@command_runner)
  @secrets = SecretsClient.new(@command_runner)
  @auth = AuthClient.new(@command_runner)
end

Instance Attribute Details

#authObject (readonly)

Returns the value of attribute auth.



30
31
32
# File 'lib/bitwarden-sdk-secrets.rb', line 30

def auth
  @auth
end

#bitwardenObject (readonly)

Returns the value of attribute bitwarden.



30
31
32
# File 'lib/bitwarden-sdk-secrets.rb', line 30

def bitwarden
  @bitwarden
end

#projectsObject (readonly)

Returns the value of attribute projects.



30
31
32
# File 'lib/bitwarden-sdk-secrets.rb', line 30

def projects
  @projects
end

#secretsObject (readonly)

Returns the value of attribute secrets.



30
31
32
# File 'lib/bitwarden-sdk-secrets.rb', line 30

def secrets
  @secrets
end

Instance Method Details

#free_memObject



48
49
50
# File 'lib/bitwarden-sdk-secrets.rb', line 48

def free_mem
  @bitwarden.free_mem(@handle)
end