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

More convenient pagination support in SCIM / Audit Logs API clients #1121

Open
1 of 9 tasks
ruberVulpes opened this issue Sep 21, 2021 · 1 comment
Open
1 of 9 tasks
Labels
discussion M-T: An issue where more input is needed to reach a decision good first issue scim-client Version: 3x
Milestone

Comments

@ruberVulpes
Copy link
Contributor

If it's possible I'd love for the SCIMClient's searches to be able to be paginated like the WebClient does with the SlackResponse. It looks like it could be done with the body returned.

Category (place an x in each of the [ ])

  • slack_sdk.web.WebClient (sync/async) (Web API client)
  • slack_sdk.webhook.WebhookClient (sync/async) (Incoming Webhook, response_url sender)
  • slack_sdk.models (UI component builders)
  • slack_sdk.oauth (OAuth Flow Utilities)
  • slack_sdk.socket_mode (Socket Mode client)
  • slack_sdk.audit_logs (Audit Logs API client)
  • slack_sdk.scim (SCIM API client)
  • slack_sdk.rtm (RTM client)
  • slack_sdk.signature (Request Signature Verifier)

Requirements

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.

@seratch seratch added scim-client Version: 3x discussion M-T: An issue where more input is needed to reach a decision and removed untriaged labels Sep 21, 2021
@seratch
Copy link
Member

seratch commented Sep 21, 2021

Hi @ruberVulpes, thanks for writing in! Indeed, that should be more convenient in some situations.

One challenge around the feature addition is that, if we enhance the response class as with the WebClient, the internals of the response/client classes can be a bit complex. The reason is that we have to properly support both the default and asyncio-based clients.

Thus, I am thinking that providing a kind of wrapper class (in other words, decorator in GoF design pattern) may be easier and cleaner. Here is pseudo code illustrating how it can work:

client = SCIMClient(token=os.environ["SLACK_ORG_ADMIN_USER_TOKEN"])
paginator = SCIMClientPaginator(client)
 
for page in paginator.search_users(filter="""filter=userName Eq "Carly""""):
    print(page.users) # list

Also, if we add this feature to the SCIM clients, we can do the same for the Audit Logs clients too.

@seratch seratch added this to the 3.x milestone Sep 21, 2021
@seratch seratch changed the title Add support for pagination via iteration for SCIMResponse More convenient pagination support in SCIM / Audit Logs API clients Sep 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion M-T: An issue where more input is needed to reach a decision good first issue scim-client Version: 3x
Projects
None yet
Development

No branches or pull requests

3 participants