@@ -17,6 +17,7 @@ public class SecurityApiKeyTests : CoordinatedIntegrationTestBase<XPackCluster>
1717 private const string CreateApiKeyWithRolesStep = nameof ( CreateApiKeyWithRolesStep ) ;
1818 private const string CreateApiKeyWithNoRolesStep = nameof ( CreateApiKeyWithNoRolesStep ) ;
1919 private const string GetApiKeyStep = nameof ( GetApiKeyStep ) ;
20+ private const string GetAllApiKeysStep = nameof ( GetAllApiKeysStep ) ;
2021 private const string InvalidateApiKeyStep = nameof ( InvalidateApiKeyStep ) ;
2122
2223 public SecurityApiKeyTests ( XPackCluster cluster , EndpointUsage usage ) : base ( new CoordinatedUsage ( cluster , usage )
@@ -120,6 +121,26 @@ public SecurityApiKeyTests(XPackCluster cluster, EndpointUsage usage) : base(new
120121 ( v , c , r ) => c . Security . CreateApiKeyAsync ( r )
121122 )
122123 } ,
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+ } ,
123144 {
124145 GetApiKeyStep , u =>
125146 u . Calls < GetApiKeyDescriptor , GetApiKeyRequest , IGetApiKeyRequest , GetApiKeyResponse > (
@@ -173,6 +194,11 @@ [I] public async Task SecurityCreateApiKeyResponse() => await Assert<CreateApiKe
173194 r . ApiKey . Should ( ) . NotBeNullOrEmpty ( ) ;
174195 } ) ;
175196
197+ [ I ] public async Task SecurityGetAllApiKeysResponse ( ) => await Assert < GetApiKeyResponse > ( GetAllApiKeysStep , r =>
198+ {
199+ r . IsValid . Should ( ) . BeTrue ( ) ;
200+ } ) ;
201+
176202 [ I ] public async Task SecurityGetApiKeyResponse ( ) => await Assert < GetApiKeyResponse > ( GetApiKeyStep , r =>
177203 {
178204 r . IsValid . Should ( ) . BeTrue ( ) ;
0 commit comments