{"action":"closed","issue":{"url":"https://api.github.com/repos/JincorTech/backend-auth/issues/46","repository_url":"https://api.github.com/repos/JincorTech/backend-auth","labels_url":"https://api.github.com/repos/JincorTech/backend-auth/issues/46/labels{/name}","comments_url":"https://api.github.com/repos/JincorTech/backend-auth/issues/46/comments","events_url":"https://api.github.com/repos/JincorTech/backend-auth/issues/46/events","html_url":"https://github.com/JincorTech/backend-auth/issues/46","id":317472145,"node_id":"MDU6SXNzdWUzMTc0NzIxNDU=","number":46,"title":"curl: (52) Empty reply from server","user":{"login":"inix","id":2264291,"node_id":"MDQ6VXNlcjIyNjQyOTE=","avatar_url":"https://avatars2.githubusercontent.com/u/2264291?v=4","gravatar_id":"","url":"https://api.github.com/users/inix","html_url":"https://github.com/inix","followers_url":"https://api.github.com/users/inix/followers","following_url":"https://api.github.com/users/inix/following{/other_user}","gists_url":"https://api.github.com/users/inix/gists{/gist_id}","starred_url":"https://api.github.com/users/inix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inix/subscriptions","organizations_url":"https://api.github.com/users/inix/orgs","repos_url":"https://api.github.com/users/inix/repos","events_url":"https://api.github.com/users/inix/events{/privacy}","received_events_url":"https://api.github.com/users/inix/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-04-25T04:06:13Z","updated_at":"2018-07-18T11:51:05Z","closed_at":"2018-07-18T11:51:05Z","author_association":"NONE","body":"I send post request and got message _'curl: (52) Empty reply from server'_.\r\nI have built successfully and related container is up running, testing process should be OK.\r\nThis is environment and build process info.\r\n\r\n1.dev environment\r\n```\r\nOS:Mac OS Sierra\r\nDocker: Version 18.03.0-ce-mac60 (23751)\r\n```\r\n\r\n2./etc/hosts DNS.\r\n```\r\n127.0.0.1\tauth\r\n127.0.0.1\tverify\r\n```\r\n\r\n2.docker compose ps\r\n```\r\n       Name                      Command               State                        Ports                      \r\n---------------------------------------------------------------------------------------------------------------\r\nbackendauth_auth_1    /bin/sh -c npm start             Up      0.0.0.0:32782->3000/tcp, 0.0.0.0:32781->4000/tcp\r\nbackendauth_redis_1   docker-entrypoint.sh redis ...   Up      0.0.0.0:32780->6379/tcp    \r\n```   \r\n\r\n3.docker-compose exec auth npm test\r\n```\r\n> auth@0.0.0 test /usr/src/app\r\n> nyc mocha ./src/**/*.spec.ts\r\n\r\n(node:91) Warning: process.on(SIGPROF) is reserved while debugging\r\n\r\n\r\n  Application\r\n    ✓ should return 404 and not contain X-Powered-By header\r\n    ✓ should return 406 for unsupported Accept header\r\n    ✓ should return 406 for unsupported Content-Type header\r\n\r\n  Authenticate\r\n    POST /auth\r\n      ✓ should return 404 (54ms)\r\n      ✓ should require login\r\n      ✓ should require password\r\n      ✓ should require deviceId\r\n      ✓ should authenticate user (421ms)\r\n      ✓ should respond with 403 error code when password is incorrect (416ms)\r\n    POST /auth/logout\r\n      ✓ should logout\r\n      ✓ should respond with 400 code when logout with incorrect token\r\n      ✓ should require token\r\n    POST /auth/verify\r\n      ✓ should be valid token\r\n      ✓ should be invalid token\r\n      ✓ should require token\r\n\r\n  Tenants\r\n    POST /tenant\r\n      ✓ should create tenant (233ms)\r\n      ✓ should not create tenant when email already exists (429ms)\r\n      ✓ should require email\r\n      ✓ should validate email \r\n      ✓ should require password\r\n      ✓ should validate password length\r\n      ✓ should validate password format\r\n      ✓ should use tenant IP whitelist\r\n    POST /tenant/login\r\n      ✓ should authenticate tenant (425ms)\r\n      ✓ should not authenticate tenant with incorrect password (421ms)\r\n      ✓ should not authenticate tenant with incorrect email (216ms)\r\n      ✓ should require email\r\n      ✓ should validate email \r\n      ✓ should require password\r\n      ✓ should validate password length\r\n      ✓ should validate password format\r\n    POST /tenant/logout\r\n      ✓ should logout (424ms)\r\n      ✓ should respond with error for incorrect token (429ms)\r\n      ✓ should require token\r\n    POST /tenant/verify\r\n      ✓ should verify valid token (422ms)\r\n      ✓ should respond with error for incorrect token (427ms)\r\n      ✓ should require token\r\n\r\n  Users\r\n    POST /user\r\n      ✓ should create user (210ms)\r\n      ✓ should create user when additional fields are present in request (209ms)\r\n      ✓ should create user when additional fields are present in request (209ms)\r\n      ✓ should validate email\r\n      ✓ should require email\r\n      ✓ should require login\r\n      ✓ should require password\r\n      ✓ should require sub\r\n    DELETE /user\r\n      ✓ should delete user (209ms)\r\n      ✓ should respond with 404 code if login is not found (42ms)\r\n      ✓ should require login\r\n\r\n  Auth Middleware\r\n    Test Auth\r\n      ✓ should require Authorization header\r\n      ✓ should require Bearer\r\n      ✓ should not auth incorrect token\r\n      ✓ should not authorize non-tenant user\r\n      ✓ should authorize tenant\r\n\r\n  IP whitelist filter\r\n    Test filter\r\n      ✓ should respond with 403 if IP is not in whitelist\r\n      ✓ should allow request if IP is in whitelist\r\n\r\n  Request Throttler\r\n    Test throttler\r\n      ✓ should throttle\r\n      ✓ should throttle white list IP\r\n\r\n  jwtService\r\n    #generate\r\n      ✓ should return token\r\n    #verify\r\n      ✓ should verify token\r\n      ✓ should verify token\r\n\r\n  keyService\r\n    #set\r\n      ✓ should create session\r\n    #get\r\n      ✓ should return session\r\n    #delete\r\n      ✓ should delete session\r\n\r\n  storageService\r\n    #set\r\n      ✓ should return \"OK\"\r\n    #get\r\n      ✓ should return value\r\n      ✓ should return null\r\n    #expire\r\n      ✓ should return 1\r\n      ✓ should return 0\r\n    #del\r\n      ✓ should return 1\r\n      ✓ should return 0\r\n\r\n  tenantService\r\n    #create\r\n      ✓ should create new tenant (220ms)\r\n    #login\r\n      ✓ should login tenant and return valid token (424ms)\r\n\r\n  userService\r\n    #create\r\n      ✓ should create new user (221ms)\r\n    #get\r\n      ✓ should return user\r\n\r\n\r\n  74 passing (16s)\r\n\r\n------------------------|----------|----------|----------|----------|----------------|\r\nFile                    |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |\r\n------------------------|----------|----------|----------|----------|----------------|\r\nAll files               |    98.47 |    81.73 |      100 |    98.37 |                |\r\n src                    |    95.77 |    73.33 |      100 |    95.71 |                |\r\n  app.ts                |       90 |     62.5 |      100 |    89.66 |       16,17,20 |\r\n  config.ts             |      100 |    77.27 |      100 |      100 |                |\r\n  ioc.container.ts      |      100 |      100 |      100 |      100 |                |\r\n src/controllers        |    98.94 |       90 |      100 |    98.86 |                |\r\n  jwt.controller.ts     |    97.56 |       90 |      100 |    97.44 |             67 |\r\n  tenant.controller.ts  |      100 |     87.5 |      100 |      100 |                |\r\n  user.controller.ts    |      100 |      100 |      100 |      100 |                |\r\n src/middlewares        |    97.53 |    88.24 |      100 |    97.53 |                |\r\n  auth.ts               |      100 |      100 |      100 |      100 |                |\r\n  ip.whitelist.ts       |    91.67 |    66.67 |      100 |    91.67 |             28 |\r\n  request.throttler.ts  |    95.65 |       80 |      100 |    95.65 |             57 |\r\n  request.validation.ts |      100 |      100 |      100 |      100 |                |\r\n src/services           |      100 |       75 |      100 |      100 |                |\r\n  jwt.service.ts        |      100 |      100 |      100 |      100 |                |\r\n  key.service.ts        |      100 |      100 |      100 |      100 |                |\r\n  storage.service.ts    |      100 |       50 |      100 |      100 |                |\r\n  tenant.service.ts     |      100 |      100 |      100 |      100 |                |\r\n  user.service.ts       |      100 |      100 |      100 |      100 |                |\r\n------------------------|----------|----------|----------|----------|----------------|\r\n\r\n=============================== Coverage summary ===============================\r\nStatements   : 98.47% ( 385/391 )\r\nBranches     : 81.73% ( 85/104 )\r\nFunctions    : 100% ( 74/74 )\r\nLines        : 98.37% ( 363/369 )\r\n================================================================================\r\n```\r\n\r\n4.send curl request.\r\n```\r\ncurl --include \\\r\n     --request POST \\\r\n     --header \"Content-Type: application/json\" \\\r\n     --header \"Accept: application/json\" \\\r\n     --data-binary \"{\r\n    \\\"email\\\": \\\"test2@test.com\\\",\r\n    \\\"password\\\": \\\"Password2\\\"\r\n}\" \\\r\n'http://auth:3000/tenant'\r\n```\r\n\r\nI got 'curl: (52) Empty reply from server'.\r\n\r\nBy the way, the docs say the API endpoint is: `http://auth:3000/`,is my DNS setup steps correct?\r\n\r\nThanks"}}
{"actor":{"display_login":"hlogeon"}}