@@ -17,6 +17,7 @@ public class SecurityApiKeyTests : CoordinatedIntegrationTestBase<XPackCluster>
17
17
private const string CreateApiKeyWithRolesStep = nameof ( CreateApiKeyWithRolesStep ) ;
18
18
private const string CreateApiKeyWithNoRolesStep = nameof ( CreateApiKeyWithNoRolesStep ) ;
19
19
private const string GetApiKeyStep = nameof ( GetApiKeyStep ) ;
20
+ private const string GetAllApiKeysStep = nameof ( GetAllApiKeysStep ) ;
20
21
private const string InvalidateApiKeyStep = nameof ( InvalidateApiKeyStep ) ;
21
22
22
23
public SecurityApiKeyTests ( XPackCluster cluster , EndpointUsage usage ) : base ( new CoordinatedUsage ( cluster , usage )
@@ -120,6 +121,26 @@ public SecurityApiKeyTests(XPackCluster cluster, EndpointUsage usage) : base(new
120
121
( v , c , r ) => c . Security . CreateApiKeyAsync ( r )
121
122
)
122
123
} ,
124
+ {
125
+ // This was fixed in 7.5.0
126
+ GetAllApiKeysStep , ">=7.5.0" , u =>
127
+ u . Calls < GetApiKeyDescriptor , GetApiKeyRequest , IGetApiKeyRequest , GetApiKeyResponse > (
128
+ v => new GetApiKeyRequest
129
+ {
130
+ RequestConfiguration = new RequestConfiguration
131
+ {
132
+ BasicAuthenticationCredentials = new BasicAuthenticationCredentials ( $ "user-{ v } ", "password" )
133
+ }
134
+ } ,
135
+ ( v , d ) => d
136
+ . RequestConfiguration ( r => r . BasicAuthentication ( $ "user-{ v } ", "password" ) )
137
+ ,
138
+ ( v , c , f ) => c . Security . GetApiKey ( f ) ,
139
+ ( v , c , f ) => c . Security . GetApiKeyAsync ( f ) ,
140
+ ( v , c , r ) => c . Security . GetApiKey ( r ) ,
141
+ ( v , c , r ) => c . Security . GetApiKeyAsync ( r )
142
+ )
143
+ } ,
123
144
{
124
145
GetApiKeyStep , u =>
125
146
u . Calls < GetApiKeyDescriptor , GetApiKeyRequest , IGetApiKeyRequest , GetApiKeyResponse > (
@@ -173,6 +194,11 @@ [I] public async Task SecurityCreateApiKeyResponse() => await Assert<CreateApiKe
173
194
r . ApiKey . Should ( ) . NotBeNullOrEmpty ( ) ;
174
195
} ) ;
175
196
197
+ [ I ] public async Task SecurityGetAllApiKeysResponse ( ) => await Assert < GetApiKeyResponse > ( GetAllApiKeysStep , r =>
198
+ {
199
+ r . IsValid . Should ( ) . BeTrue ( ) ;
200
+ } ) ;
201
+
176
202
[ I ] public async Task SecurityGetApiKeyResponse ( ) => await Assert < GetApiKeyResponse > ( GetApiKeyStep , r =>
177
203
{
178
204
r . IsValid . Should ( ) . BeTrue ( ) ;
0 commit comments