Closed zxzharmlesszxz closed 9 months ago
Hi
Thank you for the report
I may look in the following weeks but do not use this lib anymore. You may also try with nono's PR as it was working in september with it. https://github.com/edas/bitwapi/pull/1
Could post me your test.rb
?
test.rb - contain strings from readme
require 'json'
require 'bitwapi'
api = Bitwapi::API.official()
api.register('puppet@mail.com.ua', 'PuppetServer', name: "puppet server")
api.login('puppet@mail.com.ua', 'PuppetServer', device_name: "puppet server")
credentials = api.credentials
File.write("mycredentials.json", credentials.to_json)
json_credentials = File.read("mycredentials.json")
credentials = JSON.parse(json_credentials, symbolize_names: true)
api = Bitwapi::API.new(credentials)
vault = api.get_vault
# all ciphers
ciphers = vault.ciphers.to_a
id = ciphers[0].id
# a cipher by its id
cipher = vault.cipher(id)
# access to data
# you should have all the accessors you need
cipher.name
cipher.login
cipher.id
cipher.fields
cipher.notes
Traceback (most recent call last): 12360: from test.rb:11:in
register' 12358: from /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/bitwapi-0.1.0/lib/bitwapi/api.rb:54:in
transport' 12357: from /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/bitwapi-0.1.0/lib/bitwapi/api.rb:54:intap' 12356: from /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/bitwapi-0.1.0/lib/bitwapi/api.rb:54:in
block in transport' 12355: from /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/bitwapi-0.1.0/lib/bitwapi/api.rb:117:inget_valid_token' 12354: from /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/bitwapi-0.1.0/lib/bitwapi/api.rb:146:in
refresh_token' 12353: from /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/bitwapi-0.1.0/lib/bitwapi/api.rb:54:intransport' ... 12348 levels... 4: from /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/bitwapi-0.1.0/lib/bitwapi/api.rb:146:in
refresh_token' 3: from /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/bitwapi-0.1.0/lib/bitwapi/api.rb:54:intransport' 2: from /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/bitwapi-0.1.0/lib/bitwapi/api.rb:54:in
tap' 1: from /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/bitwapi-0.1.0/lib/bitwapi/api.rb:54:inblock in transport' /opt/puppetlabs/puppet/lib/ruby/gems/2.5.0/gems/bitwapi-0.1.0/lib/bitwapi/api.rb:117:in
get_valid_token': stack level too deep (SystemStackError) `