Repository navigation
add session based authentication for rpc #175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
e1ce164
add comments, no functional changes
vaishnavachath b23b030
add session based authentication for rpc
vaishnavachath dc9f1e9
moved authentication to socket.io
vaishnavachath 93e6753
socket-io middleware authentication
vaishnavachath 8dd9386
add/modify test-cases
vaishnavachath 0dbbc62
fix: callback on analogwrite on DOUT
vaishnavachath 5f27270
add callback case to test-digitalwrite
vaishnavachath 118f3e9
fix: callback on digitalWrite on AOUT
vaishnavachath File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| var b = require('bonescript'); | ||
|
|
||
| var pinKeys = []; | ||
| for (var i = 1; i <= 36; i++) { | ||
| pinKeys.push("P1_" + i); | ||
| pinKeys.push("P2_" + i); | ||
| } | ||
| for (var i = 1; i <= 46; i++) { | ||
| pinKeys.push("P8_" + i); | ||
| pinKeys.push("P9_" + i); | ||
| } | ||
| exports.testanalogread1 = function (test) { | ||
| test.expect(pinKeys.length); | ||
| for (var x in pinKeys) { | ||
| var y = b.analogRead(pinKeys[x]); | ||
| test.ok(typeof y == 'number'); | ||
| } | ||
| test.done(); | ||
| } | ||
| exports.testanalogread2 = function (test) { | ||
| test.expect(pinKeys.length); | ||
| for (var x in pinKeys) { | ||
| b.analogRead(pinKeys[x], function (x) { | ||
| test.ok(typeof x.value == 'number' && !x.err); | ||
| }); | ||
| if (x == pinKeys.length - 1) | ||
| test.done(); | ||
| } | ||
| } | ||
| exports.testanalogread3 = function (test) { | ||
| test.expect(pinKeys.length); | ||
| for (var x in pinKeys) { | ||
| b.analogRead(pinKeys[x], function (err, value) { | ||
| test.ok(typeof value == 'number' && !err); | ||
| }); | ||
| if (x == pinKeys.length - 1) | ||
| test.done(); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| var b = require('bonescript'); | ||
|
|
||
| var pinKeys = []; | ||
| for (var i = 1; i <= 36; i++) { | ||
| pinKeys.push("P1_" + i); | ||
| pinKeys.push("P2_" + i); | ||
| } | ||
| for (var i = 1; i <= 46; i++) { | ||
| pinKeys.push("P8_" + i); | ||
| pinKeys.push("P9_" + i); | ||
| } | ||
| exports.testanalogwrite1 = function (test) { | ||
| test.expect(pinKeys.length); | ||
| for (var x in pinKeys) { | ||
| test.doesNotThrow(function () { | ||
| b.analogWrite(pinKeys[x], Math.random()); | ||
| }); | ||
| } | ||
| test.done(); | ||
| } | ||
| exports.testanalogwrite2 = function (test) { | ||
| test.expect(pinKeys.length); | ||
| for (var x in pinKeys) { | ||
| b.analogWrite(pinKeys[x], Math.random(), 2000, function (x) { | ||
| test.ok(true); | ||
| }); | ||
| if (x == pinKeys.length - 1) | ||
| test.done(); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| var b = require('bonescript'); | ||
|
|
||
| var pinKeys = []; | ||
| for (var i = 1; i <= 36; i++) { | ||
| pinKeys.push("P1_" + i); | ||
| pinKeys.push("P2_" + i); | ||
| } | ||
| for (var i = 1; i <= 46; i++) { | ||
| pinKeys.push("P8_" + i); | ||
| pinKeys.push("P9_" + i); | ||
| } | ||
| exports.testdigitalRead1 = function (test) { | ||
| test.expect(pinKeys.length); | ||
| for (var x in pinKeys) { | ||
| var y = b.digitalRead(pinKeys[x]); | ||
| test.ok(typeof y == 'number'); | ||
| } | ||
| test.done(); | ||
| } | ||
| exports.testdigitalRead2 = function (test) { | ||
| test.expect(pinKeys.length); | ||
| for (var x in pinKeys) { | ||
| b.digitalRead(pinKeys[x], function (x) { | ||
| test.ok(typeof x.value == 'number' && !x.err); | ||
| }); | ||
| if (x == pinKeys.length - 1) | ||
| test.done(); | ||
| } | ||
| } | ||
| exports.testdigitalRead3 = function (test) { | ||
| test.expect(pinKeys.length); | ||
| for (var x in pinKeys) { | ||
| b.digitalRead(pinKeys[x], function (err, value) { | ||
| test.ok(typeof value == 'number' && !err); | ||
| }); | ||
| if (x == pinKeys.length - 1) | ||
| test.done(); | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This runs asynchronously on load when loaded by a browser? How do we catch this error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not very sure how we will be able to catch this error from the browser , however if the current implementation is used, then a 401 Unauthorized response could be sent for unauthorized sessions from browser.