Skip to content

Commit

Permalink
Add security APIs (#3584)
Browse files Browse the repository at this point in the history
Add security APIs
  • Loading branch information
Stuart Cam authored Mar 19, 2019
1 parent 021e0db commit 400b444
Show file tree
Hide file tree
Showing 40 changed files with 1,779 additions and 41 deletions.
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

0 comments on commit 400b444

Please sign in to comment.