Skip to content

Commit

Permalink
v2.3.0 re-add revokeTokenByQuery
Browse files Browse the repository at this point in the history
  • Loading branch information
redaphid / royvandewater committed Mar 3, 2017
1 parent eadc939 commit 7ca5eac
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "meshblu",
"description": "Meshblu IoT network and API",
"version": "2.2.9",
"version": "2.3.0",
"license": "MIT",
"homepage": "https://developer.octoblu.com",
"repository": "git://github.com/octoblu/meshblu-npm",
Expand Down
3 changes: 3 additions & 0 deletions src/connection.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ class Connection extends ProxySocket
revokeToken: (auth, callback) =>
@_socket.send 'revokeToken', auth, callback

revokeTokenByQuery: (data, callback) =>
@_socket.send 'revokeTokenByQuery', data, callback

sign: (data) =>
@_privateKey.sign stableStringify(data), 'base64'

Expand Down
10 changes: 10 additions & 0 deletions test/src/connection-spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,16 @@ describe 'Connection', ->
it 'should send revokeToken', ->
expect(@socket.send).to.have.been.calledWith 'revokeToken', {uuid: 'pat'}

describe '->revokeTokenByQuery', ->
describe 'when called', ->
beforeEach (done) ->
@socket.send.withArgs('revokeTokenByQuery', {uuid: 'pat', tag: 'hi'}).yields()
@sut.revokeTokenByQuery {uuid: 'pat', tag: 'hi'}, (@result) => done()

it 'should send revokeTokenByQuery', ->
expect(@socket.send).to.have.been.calledWith 'revokeTokenByQuery', {uuid: 'pat', tag: 'hi'}


describe '->sign', ->
describe 'when it is called with a string', ->
it 'should sign', ->
Expand Down

0 comments on commit 7ca5eac

Please sign in to comment.