> On March 21, 2016, 9:03 a.m., Adam B wrote:
> > Good start, but you're missing a few things. Are these coming in subsequent 
> > patches?
> > - Authentication for GET requests
> > - Tests for GETs
> > - Documentation updates

I will add a separated patch for GET requet test.


> On March 21, 2016, 9:03 a.m., Adam B wrote:
> > src/master/http.cpp, line 1178
> > <https://reviews.apache.org/r/44512/diff/1/?file=1291686#file1291686line1178>
> >
> >     Will you be adding authentication to GETs in a separate patch?

Currently, the GET request has supported the authentication:

```
$ curl -v -X GET http://localhost:5050/weights | python -mjson.tool
* Hostname was NOT found in DNS cache
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* 
  Trying ::1...
* connect to ::1 port 5050 failed: Connection refused
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 5050 (#0)
> GET /weights HTTP/1.1
> User-Agent: curl/7.37.1
> Host: localhost:5050
> Accept: */*
>
< HTTP/1.1 401 Unauthorized
< Date: Tue, 22 Mar 2016 08:53:09 GMT
< WWW-Authenticate: Basic realm="mesos"
< Content-Length: 0
<
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
* Connection #0 to host localhost left intact
No JSON object could be decoded
```


- Yongqiao


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/44512/#review124512
-----------------------------------------------------------


On March 9, 2016, 6:36 a.m., Yongqiao Wang wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/44512/
> -----------------------------------------------------------
> 
> (Updated March 9, 2016, 6:36 a.m.)
> 
> 
> Review request for mesos and Adam B.
> 
> 
> Bugs: MESOS-4316
>     https://issues.apache.org/jira/browse/MESOS-4316
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Support to get weights info by /weights.
> 
> 
> Diffs
> -----
> 
>   include/mesos/mesos.proto 3d22ec32655dca741169e1f0e382303e061c38b7 
>   src/master/http.cpp a3ad57a1c3f8a01aa609b28c12825670bb243387 
>   src/master/master.hpp ea26670e6c6c67314406fded510e8fdd46053dc8 
>   src/master/weights_handler.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/44512/diff/
> 
> 
> Testing
> -------
> 
> make && make check.
> 
> $ (./mesos-master.sh --ip=127.0.0.1 --work_dir=/tmp/mesos-master  
> --authenticate_http --credentials=/opt/credentials.json  >> 
> /tmp/mesos-master.log 2>&1 &)
> 
> $ curl --user framework1:secret_string1 http://localhost:5050/weights | 
> python -mjson.tool
> {}
> 
> $ curl --user framework1:secret_string1 --data 
> "[{\"weight\":1.8,\"role\":\"role1\"},{\"weight\":1.0,\"role\":\"role2\"},{\"weight\":3.4,\"role\":\"role3\"}]"
>  -X PUT http://127.0.0.1:5050/weights
> 
> $ curl --user framework1:secret_string1 http://localhost:5050/weights | 
> python -mjson.tool
> {
>     "infos": [
>         {
>             "role": "role3",
>             "weight": 3.4
>         },
>         {
>             "role": "role2",
>             "weight": 1.0
>         },
>         {
>             "role": "role1",
>             "weight": 1.8
>         }
>     ]
> }
> 
> Has updated all tests of /weights endpoint to check the update results with 
> /weights GET request.
> 
> 
> Thanks,
> 
> Yongqiao Wang
> 
>

Reply via email to