Skip to content
This repository has been archived by the owner on Feb 24, 2021. It is now read-only.

feat: add browser <-> nodejs test #30

Merged
merged 7 commits into from
Nov 11, 2016
Merged

feat: add browser <-> nodejs test #30

merged 7 commits into from
Nov 11, 2016

Conversation

daviddias
Copy link
Member

@daviddias daviddias commented Nov 8, 2016

wip

public: pid._pubKey,
private: pid._privKey
}, conn, (err, _encryptedConn) => {
expect(err).to.not.exist
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fails here with this error:

  1) secio browser <-> nodejs encrypt:
     AssertionError: expected { isTrusted: [Getter],
  NONE: 0,
  CAPTURING_PHASE: 1,
  AT_TARGET: 2,
  BUBBLING_PHASE: 3,
  MOUSEDOWN: 1,
  MOUSEUP: 2,
  MOUSEOVER: 4,
  MOUSEOUT: 8,
  MOUSEMOVE: 16,
  MOUSEDRAG: 32,
  CLICK: 64,
  DBLCLICK: 128,
  KEYDOWN: 256,
  KEYUP: 512,
  KEYPRESS: 1024,
  DRAGDROP: 2048,
  FOCUS: 4096,
  BLUR: 8192,
  SELECT: 16384,
  CHANGE: 32768,
  type: [Getter],
  target: [Getter],
  currentTarget: [Getter],
  eventPhase: [Getter],
  bubbles: [Getter],
  cancelable: [Getter],
  defaultPrevented: [Getter],
  timeStamp: [Getter],
  path: [Getter],
  srcElement: [Getter],
  returnValue: [Getter/Setter],
  cancelBubble: [Getter/Setter],
  stopPropagation: [Function: stopPropagation],
  stopImmediatePropagation: [Function: stopImmediatePropagation],
  preventDefault: [Function: preventDefault],
  initEvent: [Function: initEvent],
  composed: [Getter],
  composedPath: [Function: composedPath] } to not exist

done()
})
it('encrypt', () => {
secio.encrypt(pid, pid._privKey, conn)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wait, it doesn't yield a wrapped encrypted conn?


- `id: PeerId` - The id of the node.
- `key: RSAPrivateKey` - The private key of the node.
- `insecure: PullStream` - The insecure connection.
- `callback: Function` - Called if an error happens during the initialization.

Returns the `insecure` connection provided, wrapped with secio. This is a pull-stream.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is kind of misleading, saying it returns a 'insecure connection'

@daviddias
Copy link
Member Author

I was just very confused by seeing CI green but locally seeing tests failing. It seems aegir doesn't exist(1) when tests fail in the browser

https://travis-ci.org/libp2p/js-libp2p-secio/jobs/174449763#L1399

@dignifiedquire
Copy link
Member

doesn't exist(1) when tests fail in the browser

Yes that is what I had to do, to make Sauce Labs not make all CI red

@dignifiedquire
Copy link
Member

The underlying reason for the failure to communicate between node.js and the browser is found in libp2p/js-libp2p-crypto#29

@dignifiedquire
Copy link
Member

Ready for review and passing with libp2p/js-libp2p-crypto#29

@daviddias daviddias merged commit a03b760 into master Nov 11, 2016
@daviddias daviddias deleted the fix/browser-nodejs branch November 11, 2016 08:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants