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

Add limit and context cancellation handling to current tables. Closes #62 #63

Merged
merged 5 commits into from
Jan 27, 2022

Conversation

c0d3r-arnab
Copy link
Contributor

@c0d3r-arnab c0d3r-arnab commented Jan 27, 2022

Tables updated:

  • okta_app_assigned_group
  • okta_app_assigned_user
  • okta_auth_server
  • okta_factor
  • okta_group
  • okta_idp_discovery_policy
  • okta_network_zone
  • okta_password_policy
  • okta_signon_policy
  • okta_trusted_origin
  • okta_user
  • okta_user_type

Example query results

output.txt

@c0d3r-arnab c0d3r-arnab self-assigned this Jan 27, 2022
@c0d3r-arnab c0d3r-arnab linked an issue Jan 27, 2022 that may be closed by this pull request
Copy link
Contributor

@cbruno10 cbruno10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@c0d3r-arnab Please see comments, thanks!

okta_application app
left join okta_app_assigned_group ag on app.id = ag.app_id
left join okta_group grp on ag.id = grp.id;
from
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
from
from

@c0d3r-arnab Why do we have extra spaces here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed it. I have removed it now.

// Maximum limit isn't mentioned in the documentation
// Default maximum limit is set as 1000
input := query.Params{
Limit: 1000,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reasoning for picking 1000 as the default?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the other plugins, it was decided to set 1000 as the maximum limit when it is not mentioned in the documentation. Then we will test the query manually and reduce the number if the API doesn't support it. I have followed the same pattern in this case.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's good to look at other plugins, but we should probably look at Okta's other limits, not other plugins, to base a default off of. What are most defaults for other Okta APIs? 200?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In most of the cases that I have come across so far, it's 200. I have 10000 and 500 in 2 tables.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's go with 200 then, it feels like a safe bet based on other APIs - if we come across different information later on, we can update the default.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have updated the default limits of both okta_network_zone and okta_trusted_origin to 200.

@cbruno10 cbruno10 merged commit 0903eea into main Jan 27, 2022
@cbruno10 cbruno10 deleted the issue-62 branch January 27, 2022 14:10
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

Successfully merging this pull request may close these issues.

Add limit and context cancellation handling to current tables
2 participants