Skip to content
This repository has been archived by the owner on Dec 14, 2023. It is now read-only.

AuthPolicyDetail is incompatible with API response #1584

Closed
sabedevops opened this issue Aug 15, 2023 · 2 comments
Closed

AuthPolicyDetail is incompatible with API response #1584

sabedevops opened this issue Aug 15, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@sabedevops
Copy link
Contributor

ziti version: v0.29.0

Attempting GET /auth-policies results in the below exception when using the python generated client to the edge management API.

openziti_edge_management.exceptions.ApiValueError: Invalid inputs given to generate an instance of 'AuthPolicyDetailAllOf'. The input data was invalid for the allOf schema 'AuthPolicyDetailAllOf' in the composed schema 'AuthPolicyDetail'. Error=Invalid type for variable 'allowed_signers'. Required value type is list and passed type was NoneType at ['received_data']['data']['value'][0]['primary']['ext_jwt']['allowed_signers']

The return values for the default auth policies is as follows:

                "extJwt": {
                    "allowed": true,
                    "allowedSigners": null
                }

null is not a list type, and the client is correctly rejecting the reponse as invalid with respect to the definition of allowedSigners here:

https://github.com/openziti/edge-api/blob/main/management.yml#L12905

@sabedevops sabedevops added the bug Something isn't working label Aug 15, 2023
@andrewpmartinez
Copy link
Member

andrewpmartinez commented Aug 15, 2023

Interesting. This isn't found in any tests or the CLI because Go treats nil/null as semi-equivalent (nil/null is an empty list), so the go generated client happily continues.

We will likely encounter more of these as every language+generator makes different assumptions for edge-case values and data types. The only way to find them preemptively is to use every langue+generator combo out there and test them - which is unfeasible.

We will take care of this.

@andrewpmartinez
Copy link
Member

I am transferring this issue to github.com/openziti/edge as this is an edge issue, not a spec issue.

@andrewpmartinez andrewpmartinez transferred this issue from openziti/edge-api Aug 16, 2023
andrewpmartinez added a commit that referenced this issue Aug 16, 2023
fix nil list on auth policy rest model, fixes #1584
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants