openziti / edge

Application-embedded connectivity and zero-trust components
Apache License 2.0
74 stars 19 forks source link

/network-sessions API inconsistency #23

Closed ekoby closed 4 years ago

ekoby commented 4 years ago

POST returns the following

{
  "meta": {},
  "data": {
    "_links": {
      "self": {
        "href": "./network-sessions/3cb13415-e376-42ba-b7ea-8342bce05e2c"
      }
    },
    "gateways": [
      {
        "hostname": "demo.ziti.netfoundry.io:3022",
        "name": "azure1",
        "urls": {
          "tls": "tls://demo.ziti.netfoundry.io:3022"
        }
      }
    ],
    "hosting": false,
    "id": "3cb13415-e376-42ba-b7ea-8342bce05e2c",
    "token": "bc0d1565-bf17-4ea9-945c-25adc50dd447"
  }
}

GET /network-sessions/3cb13415-e376-42ba-b7ea-8342bce05e2c returns something like this:


{
    "data": {
        "_links": {
            "self": {
                "href": "./network-sessions/3cb13415-e376-42ba-b7ea-8342bce05e2c"
            }
        }, 
        "createdAt": "2019-12-26T18:25:02.929708Z", 
        "edgeRouters": [
            {
                "hostname": "demo.ziti.netfoundry.io:3022", 
                "name": "azure1", 
                "urls": {
                    "tls": "tls://demo.ziti.netfoundry.io:3022"
                }
            }
        ], 
        "hosting": false, 
        "id": "3cb13415-e376-42ba-b7ea-8342bce05e2c", 
        "service": {
            "_links": {
                "self": {
                    "href": "./services/7a2e510a-4946-41e3-a52e-b3b47cb3956b"
                }
            }, 
            "entity": "", 
            "id": "7a2e510a-4946-41e3-a52e-b3b47cb3956b", 
            "name": "wttr.in"
        }, 
        "session": {
            "_links": {
                "self": {
                    "href": "./sessions/0272b759-de53-4d65-85f4-da0867b8e11b"
                }
            }, 
            "entity": "", 
            "id": "0272b759-de53-4d65-85f4-da0867b8e11b", 
            "name": null
        }, 
        "tags": {}, 
        "updatedAt": "2019-12-26T18:25:02.929708Z"
    }, 
    "meta": {}
}
ekoby commented 4 years ago

I believe the GET-version is preferable as it has service and session ids, and uses proper nomenclature (egdeRouters vs. gateways), but it does not have network session token.

plorenz commented 4 years ago

Fixed in 0.8