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

Bulk Requests #107

Open
xjunior opened this issue Mar 11, 2024 · 0 comments
Open

Bulk Requests #107

xjunior opened this issue Mar 11, 2024 · 0 comments

Comments

@xjunior
Copy link
Contributor

xjunior commented Mar 11, 2024

Bulk Requests are intentionally omitted from Scimitar. I am willing to add them, but It would require some refactor on how we extend behavior to SCIM.

Scimitar currently exposes an extendable ResourcesController, and a generic implementation of ActiveRecordResourcesController to support ActiveRecord. To add a controller to your SCIM endpoint, you then extend this controller and replace the right methods. This implementation keeps at the controller level logic needed for the Bulk Requests, and my proposal is to extract what is in ActiveRecordResourceController into an adapter structure, where Scimitar would have a default mounted ResourcesController, which would handle the internal actions. This is how the configuration of Scimitar would look like:

Scimitar.engine_configuration = Scimitar::EngineConfiguration.new({
  # ...
  resource_types: {
    "Users" => ActiveRecordAdapter.new(User), # futher overrides as we have today can be easily done by subclassing this adapter class
    "Groups" => ActiveRecordAdapter.new(Group),
    "Departments" => ActiveRecordAdapter.new(Department),
  },
  # ...
})

Internally, the now directly mounted ResourcesController could delegate the handling of the request to each adapter exactly how it happens today. This would enable us to use the same mechanism to implement a Bulk Request, which would basically do the same mapping of resource type / HTTP verb to the adapters.

Since group memberships are only written to Group resources, syncing user groups becomes a huge bulk request that has to be supported by either the client or the server, and we could benefit from having it on Scimitar as an atomic transaction.

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

1 participant