openziti / ziti

The parent project for OpenZiti. Here you will find the executables for a fully zero trust, application embedded, programmable network @OpenZiti
https://openziti.io
Apache License 2.0
2.84k stars 159 forks source link

Edge client current-identity endpoint returns null meta #1600

Open sabedevops opened 1 year ago

sabedevops commented 1 year ago

ziti version: v0.26.11

Description:

The Edge OpenAPI Spec specifies that GET /current-identity must return #/definitions/meta, of type: object in the #/definitions/currentIdentityDetailEnvelope.

In at least some circumstances, GET /current-identity may instead return meta: null.

This causes an error to be emitted from generated API clients.

Example result:

{
  "data": {
    "_links": {
      "mfa": {
        "href": "./current-identity/mfa"
      },
      "self": {
        "href": "./current-identity"
      }
    },
    "createdAt": "2022-12-28T20:24:12.965Z",
    "id": "hOxJBtOTL",
    "tags": {},
    "updatedAt": "2022-12-28T20:24:12.965Z",
    "appData": {},
    "authPolicyId": "default",
    "authenticators": {
      "cert": {
        "fingerprint": "e760a3d4ebba12293c0ff8e46be6fabd008603f5",
        "id": "opB8BvVTb"
      }
    },
    "defaultHostingCost": 0,
    "defaultHostingPrecedence": "default",
    "disabled": false,
    "enrollment": {},
    "envInfo": {},
    "externalId": null,
    "hasApiSession": true,
    "hasEdgeRouterConnection": false,
    "isAdmin": false,
    "isDefaultAdmin": false,
    "isMfaEnabled": false,
    "name": "test",
    "roleAttributes": [
      "sshClients"
    ],
    "sdkInfo": {},
    "serviceHostingCosts": {},
    "serviceHostingPrecedences": {},
    "type": {
      "_links": {
        "self": {
          "href": "./identity-types/User"
        }
      },
      "entity": "identity-types",
      "id": "User",
      "name": "User"
    },
    "typeId": "User"
  },
  "meta": null
}
plorenz commented 1 year ago

@andrewpmartinez can we remove meta as a field on non-list responses?