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

put mapping authorization for alias with write-index and multiple read indices #40834

Merged
merged 8 commits into from Apr 17, 2019

Conversation

Projects
None yet
6 participants
@bizybot
Copy link
Contributor

bizybot commented Apr 4, 2019

When the same alias points to multiple indices we can write to only one index
with is_write_index value true. The special handling in case of the put
mapping request(to resolve authorized indices) has a check on indices size
for a concrete index. If multiple indices existed then it marked the request
as unauthorized.

The check has been modified to consider write index flag and only when the
requested index matches with the one with write index alias, the alias is considered
for authorization.

Closes #40831

Consider write index when authorizing on alias for multiple indices
When same alias points to multiple indices we can write to only one index
with `is_write_index` value `true`. The special handling in case of put
mapping request to resolve authorized indices had a check on indices size.
If multiple indices existed then it marks request unauthorized.

The check has been modified to consider write index flag and only when the
requested index matches with the one with write index alias.

Closes #40831
@elasticmachine

This comment has been minimized.

Copy link

elasticmachine commented Apr 4, 2019

bizybot added some commits Apr 7, 2019

Address review comments
- Split unit test with clear purpose
- Move to integ tests instead of rest api test
- filter authorized indices before other tests in resolver
@bizybot

This comment has been minimized.

Copy link
Contributor Author

bizybot commented Apr 8, 2019

Hi @talevy, I have added a new test case in PermissionsIT. I see you last worked on PermissionsIT.
Could you please take a look at this change? Thank you.

@bizybot bizybot requested a review from talevy Apr 8, 2019

@polyfractal polyfractal removed the v7.0.0 label Apr 9, 2019

bizybot added some commits Apr 10, 2019

@talevy

talevy approved these changes Apr 10, 2019

@bizybot

This comment has been minimized.

Copy link
Contributor Author

bizybot commented Apr 11, 2019

@elasticmachine run elasticsearch-ci/2

@albertzaharovits
Copy link
Contributor

albertzaharovits left a comment

LGTM, sorry for the delay!

I suggest when merging to change the name of the commit/PR, to something more representative such as: "put mapping authorization for aliases with write-index"

@bizybot

This comment has been minimized.

Copy link
Contributor Author

bizybot commented Apr 12, 2019

Hi @tvernum I have addressed your review comments, please review when you get some time. Thank you.

@tvernum
Copy link
Contributor

tvernum left a comment

LGTM, but I have 1 suggestion.

bizybot added some commits Apr 16, 2019

@bizybot bizybot added the v7.0.1 label Apr 16, 2019

@bizybot bizybot changed the title Consider write index when authorizing on alias for multiple indices put mapping authorization for alias with write-index and multiple read indices Apr 16, 2019

@bizybot bizybot merged commit ebf7920 into elastic:master Apr 17, 2019

8 checks passed

CLA All commits in pull request signed
Details
elasticsearch-ci/1 Build finished.
Details
elasticsearch-ci/2 Build finished.
Details
elasticsearch-ci/bwc Build finished.
Details
elasticsearch-ci/default-distro Build finished.
Details
elasticsearch-ci/docbldesx Build finished.
Details
elasticsearch-ci/oss-distro-docs Build finished.
Details
elasticsearch-ci/packaging-sample Build finished.
Details

bizybot added a commit to bizybot/elasticsearch that referenced this pull request Apr 17, 2019

put mapping authorization for alias with write-index and multiple rea…
…d indices (elastic#40834)

When the same alias points to multiple indices we can write to only one index
with `is_write_index` value `true`. The special handling in case of the put
mapping request(to resolve authorized indices) has a check on indices size
for a concrete index. If multiple indices existed then it marked the request
as unauthorized.

The check has been modified to consider write index flag and only when the
requested index matches with the one with write index alias, the alias is considered
for authorization.

Closes elastic#40831

bizybot added a commit to bizybot/elasticsearch that referenced this pull request Apr 17, 2019

put mapping authorization for alias with write-index and multiple rea…
…d indices (elastic#40834)

When the same alias points to multiple indices we can write to only one index
with `is_write_index` value `true`. The special handling in case of the put
mapping request(to resolve authorized indices) has a check on indices size
for a concrete index. If multiple indices existed then it marked the request
as unauthorized.

The check has been modified to consider write index flag and only when the
requested index matches with the one with write index alias, the alias is considered
for authorization.

Closes elastic#40831

bizybot added a commit to bizybot/elasticsearch that referenced this pull request Apr 17, 2019

put mapping authorization for alias with write-index and multiple rea…
…d indices (elastic#40834)

When the same alias points to multiple indices we can write to only one index
with `is_write_index` value `true`. The special handling in case of the put
mapping request(to resolve authorized indices) has a check on indices size
for a concrete index. If multiple indices existed then it marked the request
as unauthorized.

The check has been modified to consider write index flag and only when the
requested index matches with the one with write index alias, the alias is considered
for authorization.

Closes elastic#40831

bizybot added a commit that referenced this pull request Apr 17, 2019

put mapping authorization for alias with write-index and multiple rea…
…d indices (#40834) (#41288)

When the same alias points to multiple indices we can write to only one index
with `is_write_index` value `true`. The special handling in case of the put
mapping request(to resolve authorized indices) has a check on indices size
for a concrete index. If multiple indices existed then it marked the request
as unauthorized.

The check has been modified to consider write index flag and only when the
requested index matches with the one with write index alias, the alias is considered
for authorization.

Closes #40831

bizybot added a commit that referenced this pull request Apr 17, 2019

put mapping authorization for alias with write-index and multiple rea…
…d indices (#40834) (#41287)

When the same alias points to multiple indices we can write to only one index
with `is_write_index` value `true`. The special handling in case of the put
mapping request(to resolve authorized indices) has a check on indices size
for a concrete index. If multiple indices existed then it marked the request
as unauthorized.

The check has been modified to consider write index flag and only when the
requested index matches with the one with write index alias, the alias is considered
for authorization.

Closes #40831

bizybot added a commit to bizybot/elasticsearch that referenced this pull request Apr 17, 2019

put mapping authorization for alias with write-index and multiple rea…
…d indices (elastic#40834)

When the same alias points to multiple indices we can write to only one index
with `is_write_index` value `true`. The special handling in case of the put
mapping request(to resolve authorized indices) has a check on indices size
for a concrete index. If multiple indices existed then it marked the request
as unauthorized.

The check has been modified to consider write index flag and only when the
requested index matches with the one with write index alias, the alias is considered
for authorization.

Closes elastic#40831

bizybot added a commit that referenced this pull request Apr 17, 2019

put mapping authorization for alias with write-index and multiple rea…
…d indices (#40834) (#41289)

When the same alias points to multiple indices we can write to only one index
with `is_write_index` value `true`. The special handling in case of the put
mapping request(to resolve authorized indices) has a check on indices size
for a concrete index. If multiple indices existed then it marked the request
as unauthorized.

The check has been modified to consider write index flag and only when the
requested index matches with the one with write index alias, the alias is considered
for authorization.

Closes #40831
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.