Skip to content
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

agent call to registrar /authorizations/requests returns critical error #10

Closed
GregTurner opened this issue Jan 19, 2013 · 4 comments
Closed

Comments

@GregTurner
Copy link
Contributor

Request from Agent:

POST http://registrar.local.a2p3.net:8080/authorizations/requests HTTP/1.1
Host: registrar.local.a2p3.net:8080
Connection: keep-alive
Content-Length: 91
Cache-Control: max-age=0
Accept: /
Origin: http://localhost
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Referer: http://localhost/a2p3_agent/index.html
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-GB,en-US;q=0.8,en;q=0.6
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: connect.sess=s%3Aj%3A%7B%7D.c7bsS5LCqDydkISNsF17rp9VHhQ1a4zcv9Fq7Y3Z5Pc

authorizations=email.local.a2p3.net%2Cregistrar.local.a2p3.net&token=nf1-Fv771smnEPSWlmVMiQ

Response from registrar:

HTTP/1.1 200 OK
X-Powered-By: Express
Content-Type: application/json; charset=utf-8
Content-Length: 850
Date: Sat, 19 Jan 2013 05:26:13 GMT
Connection: keep-alive

{
"error": {
"code": "UNKNOWN",
"message": "Object email.local.a2p3.net,registrar.local.a2p3.net has no method 'forEach'",
"stack": "TypeError: Object email.local.a2p3.net,registrar.local.a2p3.net has no method 'forEach'\n at Object.exports.getAnytimeAppKeys (C:\Users\gturner\Documents\GitHub\a2p3\app\lib\db_dev.js:267:8)\n at authorizationsRequests (C:\Users\gturner\Documents\GitHub\a2p3\app\registrar\registrar.js:77:6)\n at callbacks (C:\Users\gturner\Documents\GitHub\a2p3\node_modules\express\lib\router\index.js:161:37)\n at C:\Users\gturner\Documents\GitHub\a2p3\app\registrar\registrar.js:35:9\n at exports.validAgent (C:\Users\gturner\Documents\GitHub\a2p3\app\lib\db_dev.js:120:35)\n at process.startup.processNextTick.process._tickCallback (node.js:244:9)"
}
}

ServerConsole:

TypeError: Object email.local.a2p3.net,registrar.local.a2p3.net has no method 'forEach'
at Object.exports.getAnytimeAppKeys (C:\Users\gturner\Documents\GitHub\a2p3\app\lib\db_dev.js:267:8)
at authorizationsRequests (C:\Users\gturner\Documents\GitHub\a2p3\app\registrar\registrar.js:77:6)
at callbacks (C:\Users\gturner\Documents\GitHub\a2p3\node_modules\express\lib\router\index.js:161:37)
at C:\Users\gturner\Documents\GitHub\a2p3\app\registrar\registrar.js:35:9
at exports.validAgent (C:\Users\gturner\Documents\GitHub\a2p3\app\lib\db_dev.js:120:35)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)
registrar.local.a2p3.net POST /authorizations/requests 200 6 ms - -
Error: No 'token' parameter in POST
at checkValidAgent (C:\Users\gturner\Documents\GitHub\a2p3\app\registrar\registrar.js:21:13)
at callbacks (C:\Users\gturner\Documents\GitHub\a2p3\node_modules\express\lib\router\index.js:161:37)
at param (C:\Users\gturner\Documents\GitHub\a2p3\node_modules\express\lib\router\index.js:135:11)
at pass (C:\Users\gturner\Documents\GitHub\a2p3\node_modules\express\lib\router\index.js:142:5)
at Router._dispatch (C:\Users\gturner\Documents\GitHub\a2p3\node_modules\express\lib\router\index.js:170:5)
at Object.router (C:\Users\gturner\Documents\GitHub\a2p3\node_modules\express\lib\router\index.js:33:10)
at next (C:\Users\gturner\Documents\GitHub\a2p3\node_modules\express\node_modules\connect\lib\proto.js:199:15)
at Object.cookieSession [as handle](C:UsersgturnerDocumentsGitHuba2p3node_modulesexpressnode_modulesconnec
tlibmiddlewarecookieSession.js:113:5)
at next (C:\Users\gturner\Documents\GitHub\a2p3\node_modules\express\node_modules\connect\lib\proto.js:199:15)
at Object.cookieParser [as handle](C:UsersgturnerDocumentsGitHuba2p3node_modulesexpressnode_modulesconnect
libmiddlewarecookieParser.js:60:5)
registrar.local.a2p3.net POST /authorizations/requests 200 5 ms INVALID_API_CALL
No 'token' parameter in POST
TypeError: Object email.local.a2p3.net,registrar.local.a2p3.net has no method 'forEach'
at Object.exports.getAnytimeAppKeys (C:\Users\gturner\Documents\GitHub\a2p3\app\lib\db_dev.js:267:8)
at authorizationsRequests (C:\Users\gturner\Documents\GitHub\a2p3\app\registrar\registrar.js:77:6)
at callbacks (C:\Users\gturner\Documents\GitHub\a2p3\node_modules\express\lib\router\index.js:161:37)
at C:\Users\gturner\Documents\GitHub\a2p3\app\registrar\registrar.js:35:9
at exports.validAgent (C:\Users\gturner\Documents\GitHub\a2p3\app\lib\db_dev.js:120:35)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)
registrar.local.a2p3.net POST /authorizations/requests 200 5 ms - -
TypeError: Object email.local.a2p3.net,registrar.local.a2p3.net has no method 'forEach'
at Object.exports.getAnytimeAppKeys (C:\Users\gturner\Documents\GitHub\a2p3\app\lib\db_dev.js:267:8)
at authorizationsRequests (C:\Users\gturner\Documents\GitHub\a2p3\app\registrar\registrar.js:77:6)
at callbacks (C:\Users\gturner\Documents\GitHub\a2p3\node_modules\express\lib\router\index.js:161:37)
at C:\Users\gturner\Documents\GitHub\a2p3\app\registrar\registrar.js:35:9
at exports.validAgent (C:\Users\gturner\Documents\GitHub\a2p3\app\lib\db_dev.js:120:35)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)
registrar.local.a2p3.net POST /authorizations/requests 200 4 ms - -
TypeError: Object email.local.a2p3.net,registrar.local.a2p3.net has no method 'forEach'
at Object.exports.getAnytimeAppKeys (C:\Users\gturner\Documents\GitHub\a2p3\app\lib\db_dev.js:267:8)
at authorizationsRequests (C:\Users\gturner\Documents\GitHub\a2p3\app\registrar\registrar.js:77:6)
at callbacks (C:\Users\gturner\Documents\GitHub\a2p3\node_modules\express\lib\router\index.js:161:37)
at C:\Users\gturner\Documents\GitHub\a2p3\app\registrar\registrar.js:35:9
at exports.validAgent (C:\Users\gturner\Documents\GitHub\a2p3\app\lib\db_dev.js:120:35)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)
registrar.local.a2p3.net POST /authorizations/requests 200 10 ms - -

@dickhardt
Copy link
Owner

My bad, I changed the signature profile, updated docs I have on my machine, but did not share.

Since it is a JSON document being POSTed, it is an array, not a comma separated list for the resources

{ token: token
, authorizations: [ resource1, resource2]
}

On Jan 18, 2013, at 9:31 PM, GregTurner notifications@github.com wrote:

Request from Agent:

POST http://registrar.local.a2p3.net:8080/authorizations/requests HTTP/1.1
Host: registrar.local.a2p3.net:8080
Connection: keep-alive
Content-Length: 91
Cache-Control: max-age=0
Accept: /
Origin: http://localhost
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Referer: http://localhost/a2p3_agent/index.html
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-GB,en-US;q=0.8,en;q=0.6
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: connect.sess=s%3Aj%3A%7B%7D.c7bsS5LCqDydkISNsF17rp9VHhQ1a4zcv9Fq7Y3Z5Pc

authorizations=email.local.a2p3.net%2Cregistrar.local.a2p3.net&token=nf1-Fv771smnEPSWlmVMiQ

Response from registrar:

HTTP/1.1 200 OK
X-Powered-By: Express
Content-Type: application/json; charset=utf-8
Content-Length: 850
Date: Sat, 19 Jan 2013 05:26:13 GMT
Connection: keep-alive

{
"error": {
"code": "UNKNOWN",
"message": "Object email.local.a2p3.net,registrar.local.a2p3.net has no method 'forEach'",
"stack": "TypeError: Object email.local.a2p3.net,registrar.local.a2p3.net has no method 'forEach'\n at Object.exports.getAnytimeAppKeys (C:\Users\gturner\Documents\GitHub\a2p3\app\lib\db_dev.js:267:8)\n at authorizationsRequests (C:\Users\gturner\Documents\GitHub\a2p3\app\registrar\registrar.js:77:6)\n at callbacks (C:\Users\gturner\Documents\GitHub\a2p3\node_modules\express\lib\router\index.js:161:37)\n at C:\Users\gturner\Documents\GitHub\a2p3\app\registrar\registrar.js:35:9\n at exports.validAgent (C:\Users\gturner\Documents\GitHub\a2p3\app\lib\db_dev.js:120:35)\n at process.startup.processNextTick.process._tickCallback (node.js:244:9)"
}
}

ServerConsole:

TypeError: Object email.local.a2p3.net,registrar.local.a2p3.net has no method 'forEach'
at Object.exports.getAnytimeAppKeys (C:\Users\gturner\Documents\GitHub\a2p3\app\lib\db_dev.js:267:8)
at authorizationsRequests (C:\Users\gturner\Documents\GitHub\a2p3\app\registrar\registrar.js:77:6)
at callbacks (C:\Users\gturner\Documents\GitHub\a2p3\node_modules\express\lib\router\index.js:161:37)
at C:\Users\gturner\Documents\GitHub\a2p3\app\registrar\registrar.js:35:9
at exports.validAgent (C:\Users\gturner\Documents\GitHub\a2p3\app\lib\db_dev.js:120:35)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)
registrar.local.a2p3.net POST /authorizations/requests 200 6 ms - -
Error: No 'token' parameter in POST
at checkValidAgent (C:\Users\gturner\Documents\GitHub\a2p3\app\registrar\registrar.js:21:13)
at callbacks (C:\Users\gturner\Documents\GitHub\a2p3\node_modules\express\lib\router\index.js:161:37)
at param (C:\Users\gturner\Documents\GitHub\a2p3\node_modules\express\lib\router\index.js:135:11)
at pass (C:\Users\gturner\Documents\GitHub\a2p3\node_modules\express\lib\router\index.js:142:5)
at Router._dispatch (C:\Users\gturner\Documents\GitHub\a2p3\node_modules\express\lib\router\index.js:170:5)
at Object.router (C:\Users\gturner\Documents\GitHub\a2p3\node_modules\express\lib\router\index.js:33:10)
at next (C:\Users\gturner\Documents\GitHub\a2p3\node_modules\express\node_modules\connect\lib\proto.js:199:15)
at Object.cookieSession as handle
at next (C:\Users\gturner\Documents\GitHub\a2p3\node_modules\express\node_modules\connect\lib\proto.js:199:15)
at Object.cookieParser as handle
registrar.local.a2p3.net POST /authorizations/requests 200 5 ms INVALID_API_CALL
No 'token' parameter in POST
TypeError: Object email.local.a2p3.net,registrar.local.a2p3.net has no method 'forEach'
at Object.exports.getAnytimeAppKeys (C:\Users\gturner\Documents\GitHub\a2p3\app\lib\db_dev.js:267:8)
at authorizationsRequests (C:\Users\gturner\Documents\GitHub\a2p3\app\registrar\registrar.js:77:6)
at callbacks (C:\Users\gturner\Documents\GitHub\a2p3\node_modules\express\lib\router\index.js:161:37)
at C:\Users\gturner\Documents\GitHub\a2p3\app\registrar\registrar.js:35:9
at exports.validAgent (C:\Users\gturner\Documents\GitHub\a2p3\app\lib\db_dev.js:120:35)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)
registrar.local.a2p3.net POST /authorizations/requests 200 5 ms - -
TypeError: Object email.local.a2p3.net,registrar.local.a2p3.net has no method 'forEach'
at Object.exports.getAnytimeAppKeys (C:\Users\gturner\Documents\GitHub\a2p3\app\lib\db_dev.js:267:8)
at authorizationsRequests (C:\Users\gturner\Documents\GitHub\a2p3\app\registrar\registrar.js:77:6)
at callbacks (C:\Users\gturner\Documents\GitHub\a2p3\node_modules\express\lib\router\index.js:161:37)
at C:\Users\gturner\Documents\GitHub\a2p3\app\registrar\registrar.js:35:9
at exports.validAgent (C:\Users\gturner\Documents\GitHub\a2p3\app\lib\db_dev.js:120:35)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)
registrar.local.a2p3.net POST /authorizations/requests 200 4 ms - -
TypeError: Object email.local.a2p3.net,registrar.local.a2p3.net has no method 'forEach'
at Object.exports.getAnytimeAppKeys (C:\Users\gturner\Documents\GitHub\a2p3\app\lib\db_dev.js:267:8)
at authorizationsRequests (C:\Users\gturner\Documents\GitHub\a2p3\app\registrar\registrar.js:77:6)
at callbacks (C:\Users\gturner\Documents\GitHub\a2p3\node_modules\express\lib\router\index.js:161:37)
at C:\Users\gturner\Documents\GitHub\a2p3\app\registrar\registrar.js:35:9
at exports.validAgent (C:\Users\gturner\Documents\GitHub\a2p3\app\lib\db_dev.js:120:35)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)
registrar.local.a2p3.net POST /authorizations/requests 200 10 ms - -


Reply to this email directly or view it on GitHub.

@GregTurner
Copy link
Contributor Author

Makes it consistent, thank-you. After switching to JSON, critical error:

Request:

POST http://registrar.local.a2p3.net:8080/authorizations/requests HTTP/1.1
Host: registrar.local.a2p3.net:8080
Connection: keep-alive
Content-Length: 103
Cache-Control: max-age=0
Accept: /
Origin: http://localhost
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Referer: http://localhost/a2p3_agent/index.html
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-GB,en-US;q=0.8,en;q=0.6
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: connect.sess=s%3Aj%3A%7B%7D.c7bsS5LCqDydkISNsF17rp9VHhQ1a4zcv9Fq7Y3Z5Pc

{"token":"nf1-Fv771smnEPSWlmVMiQ","authorizations":["email.local.a2p3.net","registrar.local.a2p3.net"]}

Response:

HTTP/1.1 200 OK
X-Powered-By: Express
Content-Type: application/json; charset=utf-8
Content-Length: 98
Date: Sat, 19 Jan 2013 05:53:52 GMT
Connection: keep-alive

{
"error": {
"code": "INVALID_API_CALL",
"message": "No 'token' parameter in POST"
}
}

@dickhardt
Copy link
Owner

You have the wrong content type

application/x-www-form-urlencoded

must be

application/json

On Jan 18, 2013, at 9:58 PM, GregTurner notifications@github.com wrote:

Makes it consistent, thank-you. After switching to JSON, critical error:

Request:

POST http://registrar.local.a2p3.net:8080/authorizations/requests HTTP/1.1
Host: registrar.local.a2p3.net:8080
Connection: keep-alive
Content-Length: 103
Cache-Control: max-age=0
Accept: /
Origin: http://localhost
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Referer: http://localhost/a2p3_agent/index.html
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-GB,en-US;q=0.8,en;q=0.6
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: connect.sess=s%3Aj%3A%7B%7D.c7bsS5LCqDydkISNsF17rp9VHhQ1a4zcv9Fq7Y3Z5Pc

{"token":"nf1-Fv771smnEPSWlmVMiQ","authorizations":["email.local.a2p3.net","registrar.local.a2p3.net"]}

Response:

HTTP/1.1 200 OK
X-Powered-By: Express
Content-Type: application/json; charset=utf-8
Content-Length: 98
Date: Sat, 19 Jan 2013 05:53:52 GMT
Connection: keep-alive

{
"error": {
"code": "INVALID_API_CALL",
"message": "No 'token' parameter in POST"
}
}


Reply to this email directly or view it on GitHub.

@GregTurner
Copy link
Contributor Author

Doh, now its my bad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants