Skip to content

backend: add error variant for access denied, handle when diffing#3785

Merged
martinvonz merged 2 commits into
mainfrom
push-ktvkyyrulzom
May 31, 2024
Merged

backend: add error variant for access denied, handle when diffing#3785
martinvonz merged 2 commits into
mainfrom
push-ktvkyyrulzom

Conversation

@martinvonz
Copy link
Copy Markdown
Member

@martinvonz martinvonz commented May 29, 2024

Checklist

If applicable:

  • I have updated CHANGELOG.md
  • I have updated the documentation (README.md, docs/, demos/)
  • I have updated the config schema (cli/src/config-schema.json)
  • I have added tests to cover my changes

@martinvonz martinvonz force-pushed the push-ktvkyyrulzom branch 5 times, most recently from 9741dcc to ae4f5f2 Compare May 29, 2024 19:07
Copy link
Copy Markdown
Contributor

@PhilipMetzger PhilipMetzger left a comment

Choose a reason for hiding this comment

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

Some backends, like the one we have at Google, can restrict access to
certain files. For such files, if they return a regular
BackendError::ReadObject, then that will terminate iteration in many
cases (e.g. when diffing or listing files). This patch adds a new
error variant for them to return instead, plus handling of such errors
in diff output.

Happy to see this feature, as better ACLs is something I really want for the native backend.

Comment thread lib/src/secret_backend.rs
Comment thread cli/tests/test_acls.rs Outdated
Comment thread lib/src/store.rs Outdated
@martinvonz martinvonz force-pushed the push-ktvkyyrulzom branch from ae4f5f2 to e4d9e24 Compare May 29, 2024 23:57
Comment thread cli/src/diff_util.rs Outdated
Comment thread cli/src/diff_util.rs Outdated
Copy link
Copy Markdown
Contributor

@PhilipMetzger PhilipMetzger left a comment

Choose a reason for hiding this comment

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

LG after addressing Yuya's nits.

@martinvonz martinvonz force-pushed the push-ktvkyyrulzom branch from e4d9e24 to a6aa6a6 Compare May 31, 2024 00:46
I'm going to add a similar message for access denied. That will want
an error message printed at the end. For consistency, let's do the
same for non-file paths.
@martinvonz martinvonz force-pushed the push-ktvkyyrulzom branch 4 times, most recently from 1480d70 to ff79a02 Compare May 31, 2024 01:13
@martinvonz martinvonz enabled auto-merge (rebase) May 31, 2024 01:16
Some backends, like the one we have at Google, can restrict access to
certain files. For such files, if they return a regular
`BackendError::ReadObject`, then that will terminate iteration in many
cases (e.g. when diffing or listing files). This patch adds a new
error variant for them to return instead, plus handling of such errors
in diff output and in the working copy.

In order to test the feature, I added a new commit backend that
returns the new `ReadAccessDenied` error when the caller tries to read
certain objects.
@martinvonz martinvonz force-pushed the push-ktvkyyrulzom branch from ff79a02 to 20816cf Compare May 31, 2024 01:18
@martinvonz martinvonz merged commit 404f31c into main May 31, 2024
@martinvonz martinvonz deleted the push-ktvkyyrulzom branch May 31, 2024 01:27
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.

3 participants