-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Recursive acl #14669
Conversation
I still need to add javadoc code snippets |
...c/main/java/com/azure/storage/file/datalake/options/RemoveAccessControlRecursiveOptions.java
Outdated
Show resolved
Hide resolved
...age-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakePathAsyncClient.java
Outdated
Show resolved
Hide resolved
We need to decide if recursiveAcl should go on path or directory and update some names accordingly. |
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. |
PathSetAccessControlRecursiveMode.SET, options.getBatchSize(), options.getMaxBatches(), | ||
options.isContinuingOnFailure(), options.getContinuationToken(), context); | ||
|
||
return StorageImplUtils.blockWithOptionalTimeout(response, timeout); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
...va/com/azure/storage/file/datalake/options/DirectoryUpdateAccessControlRecursiveOptions.java
Outdated
Show resolved
Hide resolved
* @return The POSIX access control list for the file or directory. | ||
*/ | ||
public List<PathAccessControlEntry> getAccessControlList() { | ||
return accessControlList; |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo - remove
There was a problem hiding this comment.
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"() { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
@amnguye could take a look on this PR ? |
...file-datalake/src/main/java/com/azure/storage/file/datalake/models/AccessControlChanges.java
Show resolved
Hide resolved
* 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 <[email protected]> * Storage/file share error code (#15007) * Fixed simple renames and doc issues from 74 (#15297) Co-authored-by: Gauri Prasad <[email protected]> * 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 <[email protected]> Co-authored-by: Rick Ley <[email protected]>
No description provided.