File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed 
plugins/discovery-ec2/src/javaRestTest/java/org/elasticsearch/discovery/ec2 
test/fixtures/aws-fixture-utils/src/main/java/fixture/aws Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 2828
2929public  class  DiscoveryEc2InstanceProfileIT  extends  DiscoveryEc2ClusterFormationTestCase  {
3030
31+     // Lazy-initialized so we can generate it randomly, which is not possible in static context. 
3132    private  static  final  Supplier <String > regionSupplier  = new  LazyInitializable <>(ESTestCase ::randomIdentifier )::getOrCompute ;
3233
3334    private  static  final  DynamicAwsCredentials  dynamicCredentials  = new  DynamicAwsCredentials (regionSupplier , "ec2" );
Original file line number Diff line number Diff line change 2323 */ 
2424public  class  DynamicAwsCredentials  {
2525
26+     /** 
27+      * Extra validation that requests are signed using the correct region. Lazy so it can be randomly generated after initialization, since 
28+      * randomness is not available in static context. 
29+      */ 
2630    private  final  Supplier <String > expectedRegionSupplier ;
31+ 
32+     /** 
33+      * Extra validation that requests are directed to the correct service. 
34+      */ 
2735    private  final  String  expectedServiceName ;
36+ 
37+     /** 
38+      * The set of access keys for each session token registered with {@link #addValidCredentials}. It's this way round because the session 
39+      * token is a separate header so it's easier to extract. 
40+      */ 
2841    private  final  Map <String , Set <String >> validCredentialsMap  = ConcurrentCollections .newConcurrentMap ();
2942
3043    /** 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments