Skip to content

Support for encrypted UserDefinedAttributeView #156

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

Draft
wants to merge 6 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix for error in ae7cd06
  • Loading branch information
overheadhunter committed Jan 4, 2023
commit 8d22b3656eae250949c59cffba5d4837b387833a
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ final class CryptoFileOwnerAttributeView extends AbstractCryptoFileAttributeView
private final ReadonlyFlag readonlyFlag;

@Inject
public CryptoFileOwnerAttributeView(CryptoPath cleartextPath, CryptoPathMapper pathMapper, LinkOption[] linkOptions, Symlinks symlinks, OpenCryptoFiles openCryptoFiles, ReadonlyFlag readonlyFlag) {
super(cleartextPath, pathMapper, linkOptions, symlinks, openCryptoFiles);
public CryptoFileOwnerAttributeView(CryptoPath cleartextPath, CryptoPathMapper pathMapper, LinkOption[] linkOptions, Symlinks symlinks, ReadonlyFlag readonlyFlag) {
super(cleartextPath, pathMapper, linkOptions, symlinks);
this.readonlyFlag = readonlyFlag;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ public class CryptoFileOwnerAttributeViewTest {
private CryptoPath cleartextPath = mock(CryptoPath.class);
private CryptoPathMapper pathMapper = mock(CryptoPathMapper.class);
private Symlinks symlinks = mock(Symlinks.class);
private OpenCryptoFiles openCryptoFiles = mock(OpenCryptoFiles.class);
private ReadonlyFlag readonlyFlag = mock(ReadonlyFlag.class);

private CryptoFileOwnerAttributeView inTest;
Expand All @@ -61,7 +60,7 @@ public void setup() throws IOException {
when(linkCiphertextPath.getSymlinkFilePath()).thenReturn(linkCiphertextRawPath);
when(ciphertextPath.getFilePath()).thenReturn(ciphertextRawPath);

inTest = new CryptoFileOwnerAttributeView(cleartextPath, pathMapper, new LinkOption[]{}, symlinks, openCryptoFiles, readonlyFlag);
inTest = new CryptoFileOwnerAttributeView(cleartextPath, pathMapper, new LinkOption[]{}, symlinks, readonlyFlag);
}

@Test
Expand Down Expand Up @@ -91,7 +90,7 @@ public void testSetOwnerDelegates() throws IOException {
public void testSetOwnerOfSymlinkNoFollow() throws IOException {
UserPrincipal principal = mock(UserPrincipal.class);

CryptoFileOwnerAttributeView view = new CryptoFileOwnerAttributeView(link, pathMapper, new LinkOption[]{LinkOption.NOFOLLOW_LINKS}, symlinks, openCryptoFiles, readonlyFlag);
CryptoFileOwnerAttributeView view = new CryptoFileOwnerAttributeView(link, pathMapper, new LinkOption[]{LinkOption.NOFOLLOW_LINKS}, symlinks, readonlyFlag);
view.setOwner(principal);

verify(linkDelegate).setOwner(principal);
Expand All @@ -101,7 +100,7 @@ public void testSetOwnerOfSymlinkNoFollow() throws IOException {
public void testSetOwnerOfSymlinkFollow() throws IOException {
UserPrincipal principal = mock(UserPrincipal.class);

CryptoFileOwnerAttributeView view = new CryptoFileOwnerAttributeView(link, pathMapper, new LinkOption[]{}, symlinks, openCryptoFiles, readonlyFlag);
CryptoFileOwnerAttributeView view = new CryptoFileOwnerAttributeView(link, pathMapper, new LinkOption[]{}, symlinks, readonlyFlag);
view.setOwner(principal);

verify(delegate).setOwner(principal);
Expand Down