File tree Expand file tree Collapse file tree 2 files changed +52
-1
lines changed 
modules/streams/src/yamlRestTest/resources/rest-api-spec/test/streams/logs 
server/src/main/java/org/elasticsearch/rest/action/document Expand file tree Collapse file tree 2 files changed +52
-1
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ teardown :
3+   - do :
4+       streams.logs_disable : { } 
5+ 
6+ ---
7+ " Check User Can't Use Restricted Params On Logs Endpoint " 
8+   - do :
9+       streams.logs_enable : { } 
10+   - is_true : acknowledged 
11+ 
12+   - do :
13+       streams.status : { } 
14+   - is_true : logs.enabled 
15+ 
16+   - do :
17+       bulk :
18+         refresh : true 
19+         body : | 
20+           { "index": { "_index": "logs"} } 
21+           { "foo": "bar" } 
22+           { "index": { "_index": "not-logs" } } 
23+           { "foo": "bar" } 
24+ match : { errors: true } 
25+   - match : { items.0.index.status: 400 } 
26+   - match : { items.0.index.error.type: "illegal_argument_exception" } 
27+   - match : { items.0.index.error.reason: "When writing to a stream, only the following parameters are allowed: [error_trace,timeout]" } 
28+   - match : { items.1.index.status: 201 } 
29+ 
30+ ---
31+ " Check User Can't Use Restricted Params On Logs Endpoint - Single Doc " 
32+   - do :
33+       streams.logs_enable : { } 
34+   - is_true : acknowledged 
35+ 
36+   - do :
37+       streams.status : { } 
38+   - is_true : logs.enabled 
39+ 
40+   - do :
41+       index :
42+         refresh : true 
43+         index : logs 
44+         body : { "foo": "bar" } 
45+       catch : bad_request 
Original file line number Diff line number Diff line change 4141import  java .io .IOException ;
4242import  java .util .ArrayDeque ;
4343import  java .util .ArrayList ;
44+ import  java .util .LinkedHashSet ;
4445import  java .util .List ;
4546import  java .util .Set ;
4647import  java .util .concurrent .TimeUnit ;
@@ -63,7 +64,12 @@ public class RestBulkAction extends BaseRestHandler {
6364
6465    public  static  final  String  TYPES_DEPRECATION_MESSAGE  = "[types removal] Specifying types in bulk requests is deprecated." ;
6566    public  static  final  String  FAILURE_STORE_STATUS_CAPABILITY  = "failure_store_status" ;
66-     public  static  final  Set <String > STREAMS_ALLOWED_PARAMS  = Set .of ("timeout" , "error_trace" );
67+     public  static  final  LinkedHashSet <String > STREAMS_ALLOWED_PARAMS  = new  LinkedHashSet <>(2 ) {
68+         {
69+             add ("error_trace" );
70+             add ("timeout" );
71+         }
72+     };
6773
6874    private  final  boolean  allowExplicitIndex ;
6975    private  final  IncrementalBulkService  bulkHandler ;
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments