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

fix acl query template #2102

Merged
merged 6 commits into from Feb 5, 2024
Merged

fix acl query template #2102

merged 6 commits into from Feb 5, 2024

Conversation

seanstory
Copy link
Member

Closes #1696

In a review of the DLS + Internal Knowledge Search blog, @xeraa had commented that our DLS query looked overly complex. This sent me down a rabbit hole, first figuring out that our example DLS app was using an overly-complex query, then wondering why we were having to create an explicit query at all, then finally realizing I'd had these thoughts before and filed #1696 to eventually address the issue.

The time has come.

This PR removes the outer bool: { filter: { clause that's no longer necessary (since Workplace Search) as we do not have a _deny_access_control pattern for any of our connectors (yet).

It also fixes the syntax of the output document so that the template contents can be directly taken and shoved into a role descriptor.

Checklists

Pre-Review Checklist

  • this PR has a meaningful title
  • this PR links to all relevant github issues that it fixes or partially addresses
  • this PR has a thorough description
  • Covered the changes with automated tests
  • Tested the changes locally
  • Added a label for each target release version (example: v7.13.2, v7.14.0, v8.0.0)
  • Considered corresponding documentation changes

Changes Requiring Extra Attention

  • Security-related changes

Related Pull Requests

Release Note

Changes the output structure of the documents created by ACL Syncs. Now these docs are appropriately structured to create Role Descriptors. The structure to access the identity and its permissions have not changed. This structure can take up to half as much space to store as the previous structure.

Copy link
Contributor

@navarone-feekery navarone-feekery left a comment

Choose a reason for hiding this comment

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

LGTM, just one question

tests/sources/test_google_drive.py Outdated Show resolved Hide resolved
},
{
"terms": {
"_allow_access_control.enum": {{#toJson}}access_control{{/toJson}}
Copy link
Contributor

Choose a reason for hiding this comment

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

TIL about the toJson search template. Nice implementation!

Copy link
Member Author

Choose a reason for hiding this comment

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

Credit goes to @ioanatia in her original DLS designs back in ~8.7

@seanstory
Copy link
Member Author

@navarone-feekery can I get a re-approval?

@seanstory seanstory force-pushed the seanstory/fix-acl-query-template branch from 242b10d to d2fc41c Compare February 1, 2024 21:01
@seanstory seanstory enabled auto-merge (squash) February 5, 2024 14:49
@seanstory seanstory merged commit 8e8f18f into main Feb 5, 2024
2 checks passed
@seanstory seanstory deleted the seanstory/fix-acl-query-template branch February 5, 2024 14:56
Copy link

github-actions bot commented Feb 5, 2024

💔 Failed to create backport PR(s)

The backport operation could not be completed due to the following error:
There are no branches to backport to. Aborting.

The backport PRs will be merged automatically after passing CI.

To backport manually run:
backport --pr 2102 --autoMerge --autoMergeMethod squash

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

Successfully merging this pull request may close these issues.

Use mustache templates for ACL filter documents
2 participants