@@ -483,16 +483,14 @@ describe('API Keys', () => {
483
483
} ) ;
484
484
expect ( mockValidateKibanaPrivileges ) . not . toHaveBeenCalled ( ) ; // this is only called if kibana_role_descriptors is defined
485
485
expect ( mockClusterClient . asInternalUser . security . grantApiKey ) . toHaveBeenCalledWith ( {
486
- body : {
487
- api_key : {
488
- name : 'test_api_key' ,
489
- role_descriptors : { foo : true } ,
490
- expiration : '1d' ,
491
- } ,
492
- grant_type : 'password' ,
493
- username : 'foo' ,
494
- password : 'bar' ,
486
+ api_key : {
487
+ name : 'test_api_key' ,
488
+ role_descriptors : { foo : true } ,
489
+ expiration : '1d' ,
495
490
} ,
491
+ grant_type : 'password' ,
492
+ username : 'foo' ,
493
+ password : 'bar' ,
496
494
} ) ;
497
495
} ) ;
498
496
@@ -522,15 +520,13 @@ describe('API Keys', () => {
522
520
} ) ;
523
521
expect ( mockValidateKibanaPrivileges ) . not . toHaveBeenCalled ( ) ; // this is only called if kibana_role_descriptors is defined
524
522
expect ( mockClusterClient . asInternalUser . security . grantApiKey ) . toHaveBeenCalledWith ( {
525
- body : {
526
- api_key : {
527
- name : 'test_api_key' ,
528
- role_descriptors : roleDescriptors ,
529
- expiration : '1d' ,
530
- } ,
531
- grant_type : 'access_token' ,
532
- access_token : 'foo-access-token' ,
523
+ api_key : {
524
+ name : 'test_api_key' ,
525
+ role_descriptors : roleDescriptors ,
526
+ expiration : '1d' ,
533
527
} ,
528
+ grant_type : 'access_token' ,
529
+ access_token : 'foo-access-token' ,
534
530
} ) ;
535
531
} ) ;
536
532
@@ -563,18 +559,16 @@ describe('API Keys', () => {
563
559
} ) ;
564
560
expect ( mockValidateKibanaPrivileges ) . not . toHaveBeenCalled ( ) ; // this is only called if kibana_role_descriptors is defined
565
561
expect ( mockClusterClient . asInternalUser . security . grantApiKey ) . toHaveBeenCalledWith ( {
566
- body : {
567
- api_key : {
568
- name : 'test_api_key' ,
569
- role_descriptors : { foo : true } ,
570
- expiration : '1d' ,
571
- } ,
572
- grant_type : 'access_token' ,
573
- access_token : 'foo-access-token' ,
574
- client_authentication : {
575
- scheme : 'SharedSecret' ,
576
- value : 'secret' ,
577
- } ,
562
+ api_key : {
563
+ name : 'test_api_key' ,
564
+ role_descriptors : { foo : true } ,
565
+ expiration : '1d' ,
566
+ } ,
567
+ grant_type : 'access_token' ,
568
+ access_token : 'foo-access-token' ,
569
+ client_authentication : {
570
+ scheme : 'SharedSecret' ,
571
+ value : 'secret' ,
578
572
} ,
579
573
} ) ;
580
574
} ) ;
@@ -857,29 +851,27 @@ describe('API Keys', () => {
857
851
name : 'key-name' ,
858
852
} ) ;
859
853
expect ( mockClusterClient . asInternalUser . security . grantApiKey ) . toHaveBeenCalledWith ( {
860
- body : {
861
- api_key : {
862
- name : 'key-name' ,
863
- role_descriptors : {
864
- synthetics_writer : {
865
- applications : [
866
- {
867
- application : 'kibana-.kibana' ,
868
- privileges : [ 'feature_uptime.all' ] ,
869
- resources : [ '*' ] ,
870
- } ,
871
- ] ,
872
- cluster : [ 'manage' ] ,
873
- indices : [ ] ,
874
- run_as : [ ] ,
875
- } ,
854
+ api_key : {
855
+ name : 'key-name' ,
856
+ role_descriptors : {
857
+ synthetics_writer : {
858
+ applications : [
859
+ {
860
+ application : 'kibana-.kibana' ,
861
+ privileges : [ 'feature_uptime.all' ] ,
862
+ resources : [ '*' ] ,
863
+ } ,
864
+ ] ,
865
+ cluster : [ 'manage' ] ,
866
+ indices : [ ] ,
867
+ run_as : [ ] ,
876
868
} ,
877
- expiration : '1d' ,
878
869
} ,
879
- grant_type : 'password' ,
880
- password : 'bar' ,
881
- username : 'foo' ,
870
+ expiration : '1d' ,
882
871
} ,
872
+ grant_type : 'password' ,
873
+ password : 'bar' ,
874
+ username : 'foo' ,
883
875
} ) ;
884
876
} ) ;
885
877
0 commit comments