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

Recursive acl #14669

Merged
merged 19 commits into from
Sep 9, 2020
Merged

Conversation

rickle-msft
Copy link
Contributor

No description provided.

@ghost ghost added the Storage Storage Service (Queues, Blobs, Files) label Aug 31, 2020
@rickle-msft
Copy link
Contributor Author

I still need to add javadoc code snippets

@rickle-msft
Copy link
Contributor Author

We need to decide if recursiveAcl should go on path or directory and update some names accordingly.

@rickle-msft
Copy link
Contributor Author

Looks like it actually does belong on path, and there are some file tests I need to add. And also consequently some names to change

@kasobol-msft
Copy link
Contributor

Looks like it actually does belong on path, and there are some file tests I need to add. And also consequently some names to change

Calling recursive acl on file client is legit operation. after all it's 1 node tree.
The use case for that would be customer enumerating mixed directory/file result from previous (listing?) operation and wanted to apply new acls regardless it's a file or directory.

PathSetAccessControlRecursiveMode.SET, options.getBatchSize(), options.getMaxBatches(),
options.isContinuingOnFailure(), options.getContinuationToken(), context);

return StorageImplUtils.blockWithOptionalTimeout(response, timeout);
Copy link
Member

Choose a reason for hiding this comment

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

Should we do the try catch error thing here so we can log it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea idk why we don't do it on all the datalake methods. I'll add it to all the other ones, too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm. Looks like we don't do that for any of the methods in BlobClientBase either, so I think it'd be better to do that as a separate PR

* @return The POSIX access control list for the file or directory.
*/
public List<PathAccessControlEntry> getAccessControlList() {
return accessControlList;
Copy link
Member

Choose a reason for hiding this comment

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

return Collections.unmodifiable list here as well.

* @param accessControlList The POSIX access control list for the file or directory.
*/
public DirectoryUpdateAccessControlRecursiveOptions(List<PathAccessControlEntry> accessControlList) {
this.accessControlList = Collections.unmodifiableList(accessControlList);
Copy link
Member

Choose a reason for hiding this comment

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

Should we add a null check here? or protect the call to Collections.unmodifiable list

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea. And I think I need to add null checks to the internal implementation method, too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

* @param directory Whether entry is a directory.
* @return The updated object.
*/
public AccessControlChangeFailure setDirectory(boolean directory) {
Copy link
Member

Choose a reason for hiding this comment

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

This sounds kinda weird. Do we have other examples of this? It feels more normal to call this setIsDirectory

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree. But can we do setIsDirectory and isDirectory. I'm not sure if the guidelines ok with there being an extra "is" in the setter.

Copy link
Contributor

Choose a reason for hiding this comment

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

* @param defaultScope Whether this is the default entry for the ACL.
* @return The updated object.
*/
public PathRemoveAccessControlEntry setDefaultScope(boolean defaultScope) {
Copy link
Member

Choose a reason for hiding this comment

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

Same as with the isDirectory, this probably sounds better as setIsDefaultScope?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This one I'd rather keep because it follows the same pattern as PathAccessControlEntry

/**
* Code snippets for {@link DataLakePathAsyncClient#removeAccessControlRecursive(List)}
*/
public void removetAccessControlRecursiveCodeSnippets() {
Copy link
Member

Choose a reason for hiding this comment

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

typo - remove

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -434,6 +444,786 @@ class DirectoryAPITest extends APISpec {
thrown(DataLakeStorageException)
}

def "Set ACL recursive min"() {
Copy link
Member

Choose a reason for hiding this comment

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

Can we have some tests on File? Maybe just a min test?

Copy link
Member

Choose a reason for hiding this comment

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

Oh just read your other comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea they should be there now

@kasobol-msft
Copy link
Contributor

@amnguye could take a look on this PR ?

@gapra-msft gapra-msft merged commit 988e69b into Azure:feature/storage/stg74 Sep 9, 2020
gapra-msft added a commit that referenced this pull request Oct 1, 2020
* Updated all service versions to STG74 (#14079)

* Added code for get file range diff (#14140)

* Added code for smb multi channel (#14180)

* Added code to allow scheduling file expiry (#14319)

* Added support for arrow output serialization (#14431)

* Added support to read last access time  (#14342)

* Added support to lease shares (#14287)

* Updated file ranges to getFileRangesDiff (#14839)

* Added support for directory and delegation SAS (#14531)

* Recursive acl (#14669)

* Added missing error code (#14986)

* Added tests to ensure support for 4TB file (#15179)

Co-authored-by: Gauri Prasad <gapra@microsoft.com>

* Storage/file share error code (#15007)

* Fixed simple renames and doc issues from 74 (#15297)

Co-authored-by: Gauri Prasad <gapra@microsoft.com>

* Added back support for container undelete. (#15344)

* Regenerated code to address APIView comments (#15341)

* Minor changelog formatting issues

* Formatting - new lines and unused imports

* Fixed public API for file get range diff (#15562)

* Modified recursive acl tests to be able to play in live mode (#15815)

* Added support for live tests in the STG 74 branch (#15724)

* Added code to return batch failures in results for recursive ACL (#15842)

* Wrapped continuation token with Exception when recursive acl call is … (#15839)

Co-authored-by: Gauri Prasad <gapra@microsoft.com>
Co-authored-by: Rick Ley <frley@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants