Skip to content

Add spec for bulk put roles #2682

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

Merged
merged 9 commits into from
Jul 10, 2024
Merged

Add spec for bulk put roles #2682

merged 9 commits into from
Jul 10, 2024

Conversation

jfreden
Copy link
Contributor

@jfreden jfreden commented Jul 5, 2024

This adds a new spec for the bulk put roles API added in 8.15 in elastic/elasticsearch#109339.

Copy link
Contributor

github-actions bot commented Jul 8, 2024

Following you can find the validation results for the APIs you have changed.

API Status Request Response
security.bulk_put_role 🔴 0/1 1/1

You can validate these APIs yourself by using the make validate target.

@jfreden jfreden force-pushed the add_spec_bulk_put_roles branch from 9cbaabe to 25975f4 Compare July 8, 2024 08:41

This comment was marked as outdated.

@jfreden jfreden requested a review from pquentin July 8, 2024 08:53
@jfreden
Copy link
Contributor Author

jfreden commented Jul 8, 2024

Hey @pquentin ! I've created a new PR here and can't run the failing validation locally because I don't have the needed vault permissions. Thanks!

@pquentin
Copy link
Member

pquentin commented Jul 8, 2024

Hey @jfreden, I'll reach to you privately about this. In the meantime, I can tell you that the error is that Elasticsearch YAML tests call the bulk put role API with a description but that field is missing from the RoleDescriptor class.

This comment was marked as outdated.

@jfreden
Copy link
Contributor Author

jfreden commented Jul 8, 2024

Great success! Thanks @pquentin ! I was able to run this locally too. 👍

This comment was marked as duplicate.

@pquentin pquentin requested review from flobernd and l-trotta July 8, 2024 11:43
Copy link
Contributor

github-actions bot commented Jul 8, 2024

Following you can find the validation results for the APIs you have changed.

API Status Request Response
security.activate_user_profile 🟢 9/9 9/9
security.authenticate 🟢 30/30 30/30
security.bulk_delete_role 🟠 Missing type Missing type
security.bulk_put_role 🟢 1/1 1/1
security.bulk_update_api_keys 🟠 Missing type Missing type
security.change_password 🟢 9/9 9/9
security.clear_api_key_cache 🟢 13/13 13/13
security.clear_cached_privileges 🟢 3/3 3/3
security.clear_cached_realms 🟢 1/1 1/1
security.clear_cached_roles 🟢 2/2 2/2
security.clear_cached_service_tokens 🟢 4/4 4/4
security.create_api_key 🔴 67/69 60/60
security.create_cross_cluster_api_key 🟠 Missing type Missing type
security.create_service_token 🟢 3/3 3/3
security.delete_privileges 🟢 6/6 6/6
security.delete_role_mapping 🟢 9/9 9/9
security.delete_role 🟢 8/8 8/8
security.delete_service_token Missing test Missing test
security.delete_user 🟢 9/9 9/9
security.disable_user_profile 🟢 1/1 1/1
security.disable_user 🟢 3/3 3/3
security.enable_user_profile 🟢 1/1 1/1
security.enable_user 🟢 4/4 4/4
security.enroll_kibana Missing test Missing test
security.enroll_node Missing test Missing test
security.get_api_key 🔴 38/38 15/38
security.get_builtin_privileges 🔴 2/2 1/2
security.get_privileges 🟢 12/12 12/12
security.get_role_mapping 🔴 18/18 10/18
security.get_role 🔴 24/24 21/24
security.get_service_accounts Missing test Missing test
security.get_service_credentials 🟢 1/1 1/1
security.get_settings 🟠 Missing type Missing type
security.get_token 🟢 25/25 24/24
security.get_user_privileges 🔴 8/8 7/8
security.get_user_profile 🟢 8/8 8/8
security.get_user 🟢 25/25 25/25
security.grant_api_key 🟢 7/7 7/7
security.has_privileges_user_profile 🟢 3/3 3/3
security.has_privileges 🟢 24/24 24/24
security.invalidate_api_key 🟢 12/12 12/12
security.invalidate_token 🟢 11/11 11/11
security.oidc_authenticate 🟠 Missing type Missing type
security.oidc_logout 🟠 Missing type Missing type
security.oidc_prepare_authentication 🟠 Missing type Missing type
security.put_privileges 🟢 10/10 10/10
security.put_role_mapping 🔴 2/11 11/11
security.put_role 🔴 38/40 39/39
security.put_user 🟢 49/49 48/48
security.query_api_keys 🔴 14/14 1/14
security.query_role 🟠 Missing type Missing type
security.query_user 🟠 Missing type Missing type
security.saml_authenticate Missing test Missing test
security.saml_complete_logout Missing test Missing test
security.saml_invalidate Missing test Missing test
security.saml_logout Missing test Missing test
security.saml_prepare_authentication Missing test Missing test
security.saml_service_provider_metadata Missing test Missing test
security.suggest_user_profiles 🟢 1/1 1/1
security.update_api_key 🟢 5/5 5/5
security.update_cross_cluster_api_key 🟠 Missing type Missing type
security.update_settings 🟠 Missing type Missing type
security.update_user_profile_data 🟢 1/1 1/1

You can validate these APIs yourself by using the make validate target.

@pquentin
Copy link
Member

pquentin commented Jul 8, 2024

(Sorry for the noise, I've been testing credential changes with this pull request.)

@l-trotta l-trotta self-assigned this Jul 9, 2024
@l-trotta
Copy link
Contributor

l-trotta commented Jul 9, 2024

sorry I know this is again something not strictly related to the PR, but since the cluster field in RoleDescriptor only accepts cluster privilege values, should we change it from string[] to ClusterPrivilege[]?

@l-trotta
Copy link
Contributor

l-trotta commented Jul 9, 2024

other than that, LGTM!

Copy link
Contributor

Following you can find the validation results for the APIs you have changed.

API Status Request Response
security.activate_user_profile 🟢 9/9 9/9
security.authenticate 🟢 30/30 30/30
security.bulk_delete_role 🟠 Missing type Missing type
security.bulk_put_role 🟢 1/1 1/1
security.bulk_update_api_keys 🟠 Missing type Missing type
security.change_password 🟢 9/9 9/9
security.clear_api_key_cache 🟢 13/13 13/13
security.clear_cached_privileges 🟢 3/3 3/3
security.clear_cached_realms 🟢 1/1 1/1
security.clear_cached_roles 🟢 2/2 2/2
security.clear_cached_service_tokens 🟢 4/4 4/4
security.create_api_key 🔴 67/69 60/60
security.create_cross_cluster_api_key 🟠 Missing type Missing type
security.create_service_token 🟢 3/3 3/3
security.delete_privileges 🟢 6/6 6/6
security.delete_role_mapping 🟢 9/9 9/9
security.delete_role 🟢 8/8 8/8
security.delete_service_token Missing test Missing test
security.delete_user 🟢 9/9 9/9
security.disable_user_profile 🟢 1/1 1/1
security.disable_user 🟢 3/3 3/3
security.enable_user_profile 🟢 1/1 1/1
security.enable_user 🟢 4/4 4/4
security.enroll_kibana Missing test Missing test
security.enroll_node Missing test Missing test
security.get_api_key 🔴 38/38 15/38
security.get_builtin_privileges 🔴 2/2 1/2
security.get_privileges 🟢 12/12 12/12
security.get_role_mapping 🔴 18/18 10/18
security.get_role 🔴 24/24 21/24
security.get_service_accounts Missing test Missing test
security.get_service_credentials 🟢 1/1 1/1
security.get_settings 🟠 Missing type Missing type
security.get_token 🟢 25/25 24/24
security.get_user_privileges 🔴 8/8 7/8
security.get_user_profile 🟢 8/8 8/8
security.get_user 🟢 25/25 25/25
security.grant_api_key 🟢 7/7 7/7
security.has_privileges_user_profile 🟢 3/3 3/3
security.has_privileges 🟢 24/24 24/24
security.invalidate_api_key 🟢 12/12 12/12
security.invalidate_token 🟢 11/11 11/11
security.oidc_authenticate 🟠 Missing type Missing type
security.oidc_logout 🟠 Missing type Missing type
security.oidc_prepare_authentication 🟠 Missing type Missing type
security.put_privileges 🟢 10/10 10/10
security.put_role_mapping 🔴 2/11 11/11
security.put_role 🔴 38/40 39/39
security.put_user 🟢 49/49 48/48
security.query_api_keys 🔴 14/14 1/14
security.query_role 🟢 3/3 3/3
security.query_user 🟠 Missing type Missing type
security.saml_authenticate Missing test Missing test
security.saml_complete_logout Missing test Missing test
security.saml_invalidate Missing test Missing test
security.saml_logout Missing test Missing test
security.saml_prepare_authentication Missing test Missing test
security.saml_service_provider_metadata Missing test Missing test
security.suggest_user_profiles 🟢 1/1 1/1
security.update_api_key 🟢 5/5 5/5
security.update_cross_cluster_api_key 🟠 Missing type Missing type
security.update_settings 🟠 Missing type Missing type
security.update_user_profile_data 🟢 1/1 1/1

You can validate these APIs yourself by using the make validate target.

@jfreden jfreden enabled auto-merge (squash) July 10, 2024 06:55
@jfreden
Copy link
Contributor Author

jfreden commented Jul 10, 2024

Thanks for the review @l-trotta ! I've updated the RoleDescriptor to use the enum for ClusterPrivilege.

@jfreden jfreden merged commit eeb4f18 into main Jul 10, 2024
6 checks passed
@jfreden jfreden deleted the add_spec_bulk_put_roles branch July 10, 2024 07:30
github-actions bot pushed a commit that referenced this pull request Jul 10, 2024
* Add spec for bulk put roles

(cherry picked from commit eeb4f18)
l-trotta pushed a commit that referenced this pull request Jul 10, 2024
* Add spec for bulk put roles

(cherry picked from commit eeb4f18)

Co-authored-by: Johannes Fredén <109296772+jfreden@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants