Sha256: b5f074dcaef2e73fbacf854d101d65338d8120181d21e9d804ae19bea31654c2

Contents?: true

Size: 1009 Bytes

Versions: 3

Compression:

Stored size: 1009 Bytes

Contents

require 'spec_helper'

describe Smartdc::Auth do
  let(:sdccfg) do
    {
      username: 'user',
      use_key:  '4c:02:f3:b2:09:fb:29:dd:41:97:da:80:bc:69:6c:f8',
      rsa_path: './spec/fixtures/ssh'
    }
  end

  let(:auth) { Smartdc::Auth.new(sdccfg) }

  describe ".fingerprint" do
    it "receives a key" do
      expect(auth.fingerprint(File.join(sdccfg[:rsa_path], 'id_rsa'))).to eq sdccfg[:use_key]
    end
  end

  describe ".signature" do
    it "receives a key" do
      expect(auth.signature('2014-03-21 12:34:56 UTC')).to eq "Signature keyId=\"/user/keys/4c:02:f3:b2:09:fb:29:dd:41:97:da:80:bc:69:6c:f8\",algorithm=\"rsa-sha256\" uy0srn/148hvxm6KH9tCjI0hFrJsrWDDR4+TEB4qzOmENc7pARxfFFU+eDQS9svrWVSJ84YsDu3Utdn4w7AtyucOeKB36fvxdgiFJFTxdYITlh+w7tKvEdjMzahjhFJmGzjgvWmHWyvE29O76lkXMDpPOp4F5QqjDGc3Qrs07RhHo2FlzPbOTc16yF/S/d7g+0spB/xO7gSyckRxgb3ngxk011eAvyJxsJMecrGWP7J65AfjI2bygI4GnXbeH2RxmGTX0g6iz8ez820rj11CaUoxxq47z/GQUDOuGixbCgEo1ORC/Smh8h4TS2phwe8g5j2d/5H5LJJAgtL4hN26iQ=="
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
smartdc-2.0.2 spec/smartdc/auth_spec.rb
smartdc-2.0.1 spec/smartdc/auth_spec.rb
smartdc-2.0.0 spec/smartdc/auth_spec.rb