Skip to content

Commit aa1b967

Browse files
committed
Security API changes to add owner flag #4178
1 parent 2035dee commit aa1b967

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"security.get_api_key": {
3+
"url": {
4+
"params": {
5+
"owner": {
6+
"type": "boolean",
7+
"default": false,
8+
"description": "flag to query API keys owned by the currently authenticated user"
9+
}
10+
}
11+
}
12+
}
13+
}

src/Nest/XPack/Security/ApiKey/InvalidateApiKey/InvalidateApiKeyRequest.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ public partial interface IInvalidateApiKeyRequest
2828
/// </summary>
2929
[DataMember(Name = "username")]
3030
string Username { get; set; }
31+
32+
/// <summary>
33+
/// A boolean flag that can be used to query API keys owned by the currently authenticated user. Defaults to false.
34+
/// The RealmName or Username parameters cannot be specified when this parameter is set to true as they are
35+
/// assumed to be the currently authenticated ones.
36+
/// </summary>
37+
[DataMember(Name = "owner")]
38+
bool? Owner { get; set; }
3139
}
3240

3341
public partial class InvalidateApiKeyRequest
@@ -43,6 +51,9 @@ public partial class InvalidateApiKeyRequest
4351

4452
/// <inheritdoc />
4553
public string Username { get; set; }
54+
55+
/// <inheritdoc />
56+
public bool? Owner { get; set; }
4657
}
4758

4859
public partial class InvalidateApiKeyDescriptor
@@ -59,6 +70,9 @@ public partial class InvalidateApiKeyDescriptor
5970
/// <inheritdoc />
6071
string IInvalidateApiKeyRequest.Username { get; set; }
6172

73+
/// <inheritdoc />
74+
bool? IInvalidateApiKeyRequest.Owner { get; set; }
75+
6276
/// <inheritdoc cref="IInvalidateApiKeyRequest.Id" />
6377
public InvalidateApiKeyDescriptor Id(string id) => Assign(id, (a, v) => a.Id = v);
6478

@@ -70,5 +84,8 @@ public partial class InvalidateApiKeyDescriptor
7084

7185
/// <inheritdoc cref="IInvalidateApiKeyRequest.Username" />
7286
public InvalidateApiKeyDescriptor Username(string username) => Assign(username, (a, v) => a.Username = v);
87+
88+
/// <inheritdoc cref="IInvalidateApiKeyRequest.Owner" />
89+
public InvalidateApiKeyDescriptor Owner(bool? owner = true) => Assign(owner, (a, v) => a.Owner = v);
7390
}
7491
}

0 commit comments

Comments
 (0)