Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug when calling zon API - NetworkZoneClient.list_network_zones() - exception raised #416

Open
leha007 opened this issue Aug 11, 2024 · 2 comments

Comments

@leha007
Copy link

leha007 commented Aug 11, 2024

Calling zone API (list_network_zones()) on my OKTA preview tenant with default zones in it:
image
Getting exception from the API call:

okta_api.errors.okta_errors_generic.OktaGenericError: 0

From the debugging it's clearly seen that the method expects to get collection of type list but getting dictionary instead.
image

This line throws the error

if not OktaCollection.is_formed(collection[index], data_type):

Problem originates from here

class NetworkZone(
    OktaObject
)
...
self.asns = OktaCollection.form_list(
                config["asns"] if "asns"\
                    in config else [],
                str
            )

Data got from OKTA

{
   "type":"DYNAMIC_V2",
   "id":".<reducted>",
   "name":"DefaultEnhancedDynamicZone",
   "status":"INACTIVE",
   "usage":"BLOCKLIST",
   "created":"2024-08-09T01:16:38.000Z",
   "lastUpdated":"2024-08-11T15:31:59.000Z",
   "system":true,
   "locations":{
      "include":[
         
      ],
      "exclude":[
         
      ]
   },
   "ipServiceCategories":{
      "include":[
         "ALL_ANONYMIZERS"
      ],
      "exclude":[
         
      ]
   },
   "asns":{
      "include":[
         
      ],
      "exclude":[
         
      ]
   },
   "links":{
      "activate":{
         "href":"https://<reducted>.oktapreview.com/api/v1/zones/<reducted>/lifecycle/activate",
         "hints":{
            "allow":[
               "POST"
            ]
         }
      },
      "self":{
         "href":"https://<reducted>.oktapreview.com/api/v1/zones/<reducted>",
         "hints":{
            "allow":[
               "GET",
               "PUT",
               "DELETE"
            ]
         }
      }
   }
}

OKTA package version 2.9.7

@matayto
Copy link

matayto commented Oct 3, 2024

FWIW, I was able to work around this by using the response directly

_, resp, _ = await client.list_network_zones()
zones = resp._body

Not great...

@leha007
Copy link
Author

leha007 commented Oct 22, 2024

Feels like there is no support nor response from OKTA developers / maintainers, as a paying customer this is disappointing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants