-
Notifications
You must be signed in to change notification settings - Fork 25k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add permission checks before reading from HDFS stream (#26716)
Add checks for special permissions before reading hdfs stream data. Also adds test from readonly repository fix. MiniHDFS will now start with an existing repository with a single snapshot contained within. Readonly Repository is created in tests and attempts to list the snapshots within this repo.
- Loading branch information
Showing
8 changed files
with
111 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
...itory-hdfs/src/test/resources/rest-api-spec/test/hdfs_repository/30_snapshot_readonly.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Integration tests for HDFS Repository plugin | ||
# | ||
# Tests retrieving information about snapshot | ||
# | ||
--- | ||
"Get a snapshot - readonly": | ||
# Create repository | ||
- do: | ||
snapshot.create_repository: | ||
repository: test_snapshot_repository_ro | ||
body: | ||
type: hdfs | ||
settings: | ||
uri: "hdfs://localhost:9999" | ||
path: "/user/elasticsearch/existing/readonly-repository" | ||
readonly: true | ||
|
||
# List snapshot info | ||
- do: | ||
snapshot.get: | ||
repository: test_snapshot_repository_ro | ||
snapshot: "_all" | ||
|
||
- length: { snapshots: 1 } | ||
|
||
# Remove our repository | ||
- do: | ||
snapshot.delete_repository: | ||
repository: test_snapshot_repository_ro |
31 changes: 31 additions & 0 deletions
31
...dfs/src/test/resources/rest-api-spec/test/secure_hdfs_repository/30_snapshot_readonly.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Integration tests for HDFS Repository plugin | ||
# | ||
# Tests retrieving information about snapshot | ||
# | ||
--- | ||
"Get a snapshot - readonly": | ||
# Create repository | ||
- do: | ||
snapshot.create_repository: | ||
repository: test_snapshot_repository_ro | ||
body: | ||
type: hdfs | ||
settings: | ||
uri: "hdfs://localhost:9998" | ||
path: "/user/elasticsearch/existing/readonly-repository" | ||
security: | ||
principal: "elasticsearch@BUILD.ELASTIC.CO" | ||
readonly: true | ||
|
||
# List snapshot info | ||
- do: | ||
snapshot.get: | ||
repository: test_snapshot_repository_ro | ||
snapshot: "_all" | ||
|
||
- length: { snapshots: 1 } | ||
|
||
# Remove our repository | ||
- do: | ||
snapshot.delete_repository: | ||
repository: test_snapshot_repository_ro |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+1.28 KB
test/fixtures/hdfs-fixture/src/main/resources/readonly-repository.tar.gz
Binary file not shown.