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

Add security APIs #3584

Merged
merged 20 commits into from
Mar 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
d1ed416
Update spec files to 6.5 and add Ccr API's
Mpdreamz Dec 18, 2018
9fa3764
update last_downloaded_version.txt
Mpdreamz Dec 18, 2018
8019468
Code formatting moved static initializers in an order that did not ev…
Mpdreamz Dec 18, 2018
a855504
base code generation for all the following PR's as we start to implem…
Mpdreamz Dec 18, 2018
05ade62
update tests dependencies to latest
Mpdreamz Dec 18, 2018
fd55bca
Improved json diff generation, we do not move into arrays to sort obj…
Mpdreamz Dec 19, 2018
c7f462c
<langversion>latest</langversion> on all projects
Mpdreamz Jan 2, 2019
c11b4d2
Started on generating security privileges API's
Mpdreamz Jan 14, 2019
cf0ce22
Started on mapping Privileges API's
Mpdreamz Jan 14, 2019
f366f5c
staging progress
Mpdreamz Jan 24, 2019
28c9eb4
Has Privileges API endpoint.
codebrain Feb 27, 2019
89bcfea
Remove VoidResponse call
codebrain Feb 28, 2019
ddd4b35
Additional integration tests and fix response body formats
codebrain Mar 1, 2019
7e5bfce
Add documentation
codebrain Mar 7, 2019
768e1c6
Address PR comments, changing response type for Has Privileges API calls
codebrain Mar 8, 2019
18da716
Remove ApplicationName type and move implementation to use existing N…
codebrain Mar 18, 2019
75d95dc
Merge branch '6.6' into v65/security-privileges.
codebrain Mar 18, 2019
0fbbb00
Implement JsonConverters on properties
codebrain Mar 18, 2019
db69de9
Use loops in ReadJson implementations
russcam Mar 18, 2019
76f376c
Mark TODO as fixable in 7.x
codebrain Mar 19, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions src/CodeGeneration/ApiGenerator/ApiGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,12 @@ public class ApiGenerator
"xpack.ml.delete_filter.json",
"xpack.ml.get_filters.json",
"xpack.ml.put_filter.json",
"xpack.ml.update_filter.json",
"rank_eval.json",

// these API's are new and need to be mapped
"xpack.ml.delete_forecast.json",
"xpack.ml.find_file_structure.json",

"xpack.ml.update_filter.json",
"xpack.security.delete_privileges.json",
"xpack.security.get_privileges.json",
"xpack.security.get_user_privileges.json",
"xpack.security.get_index_privileges.json",
"xpack.security.has_privileges.json",
"xpack.security.put_privilege.json",
"xpack.security.put_privileges.json",
};

public static void Generate(string downloadBranch, params string[] folders)
Expand Down
2 changes: 2 additions & 0 deletions src/CodeGeneration/ApiGenerator/Domain/ApiUrlPart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public string ClrTypeName
return "Metrics";
case "feature": return "Features";
case "action_id": return "ActionIds";
case "application":
case "repository":
case "snapshot":
case "lang":
Expand All @@ -71,6 +72,7 @@ public string ClrTypeName
case "alias":
case "context":
case "name":
case "user":
case "thread_pool_patterns":
return Type == "string" ? "Name" : "Names";
case "parent_task_id":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2685,6 +2685,16 @@ public partial class ClearCachedRolesRequestParameters : RequestParameters<Clear
{
public override HttpMethod DefaultHttpMethod => HttpMethod.POST;
}
///<summary>Request options for XpackSecurityDeletePrivileges<pre>TODO</pre></summary>
public partial class DeletePrivilegesRequestParameters : RequestParameters<DeletePrivilegesRequestParameters>
{
public override HttpMethod DefaultHttpMethod => HttpMethod.DELETE;
///<summary>
/// If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh
/// to make this operation visible to search, if `false` then do nothing with refreshes.
///</summary>
public Refresh? Refresh { get => Q<Refresh?>("refresh"); set => Q("refresh", value); }
}
///<summary>Request options for XpackSecurityDeleteRole<pre>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role.html</pre></summary>
public partial class DeleteRoleRequestParameters : RequestParameters<DeleteRoleRequestParameters>
{
Expand Down Expand Up @@ -2735,6 +2745,11 @@ public partial class EnableUserRequestParameters : RequestParameters<EnableUserR
///</summary>
public Refresh? Refresh { get => Q<Refresh?>("refresh"); set => Q("refresh", value); }
}
///<summary>Request options for XpackSecurityGetPrivileges<pre>TODO</pre></summary>
public partial class GetPrivilegesRequestParameters : RequestParameters<GetPrivilegesRequestParameters>
{
public override HttpMethod DefaultHttpMethod => HttpMethod.GET;
}
///<summary>Request options for XpackSecurityGetRole<pre>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role.html</pre></summary>
public partial class GetRoleRequestParameters : RequestParameters<GetRoleRequestParameters>
{
Expand All @@ -2755,11 +2770,31 @@ public partial class GetUserRequestParameters : RequestParameters<GetUserRequest
{
public override HttpMethod DefaultHttpMethod => HttpMethod.GET;
}
///<summary>Request options for XpackSecurityGetUserPrivileges<pre>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user-privileges.html</pre></summary>
public partial class GetUserPrivilegesRequestParameters : RequestParameters<GetUserPrivilegesRequestParameters>
{
public override HttpMethod DefaultHttpMethod => HttpMethod.GET;
}
///<summary>Request options for XpackSecurityHasPrivileges<pre>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges.html</pre></summary>
public partial class HasPrivilegesRequestParameters : RequestParameters<HasPrivilegesRequestParameters>
{
public override HttpMethod DefaultHttpMethod => HttpMethod.POST;
}
///<summary>Request options for XpackSecurityInvalidateToken<pre>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-token.html</pre></summary>
public partial class InvalidateUserAccessTokenRequestParameters : RequestParameters<InvalidateUserAccessTokenRequestParameters>
{
public override HttpMethod DefaultHttpMethod => HttpMethod.DELETE;
}
///<summary>Request options for XpackSecurityPutPrivileges<pre>TODO</pre></summary>
public partial class PutPrivilegesRequestParameters : RequestParameters<PutPrivilegesRequestParameters>
{
public override HttpMethod DefaultHttpMethod => HttpMethod.PUT;
///<summary>
/// If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh
/// to make this operation visible to search, if `false` then do nothing with refreshes.
///</summary>
public Refresh? Refresh { get => Q<Refresh?>("refresh"); set => Q("refresh", value); }
}
///<summary>Request options for XpackSecurityPutRole<pre>https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role.html</pre></summary>
public partial class PutRoleRequestParameters : RequestParameters<PutRoleRequestParameters>
{
Expand Down
Loading