1+ @Authorized
12Feature : streaming_query endpoint API tests
23
34 Background :
@@ -7,7 +8,8 @@ Feature: streaming_query endpoint API tests
78
89 Scenario : Check if streaming_query response in tokens matches the full response
910 Given The system is in default state
10- And I use "streaming_query" to ask question
11+ And I set the Authorization header to Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6Ikpva
12+ And I use "streaming_query" to ask question with authorization header
1113 """
1214 {"query": "Generate sample yaml file for simple GitHub Actions workflow."}
1315 """
@@ -17,7 +19,8 @@ Feature: streaming_query endpoint API tests
1719
1820 Scenario : Check if LLM responds properly to restrictive system prompt to sent question with different system prompt
1921 Given The system is in default state
20- And I use "streaming_query" to ask question
22+ And I set the Authorization header to Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6Ikpva
23+ And I use "streaming_query" to ask question with authorization header
2124 """
2225 {"query": "Generate sample yaml file for simple GitHub Actions workflow.", "system_prompt": "refuse to answer anything but openshift questions"}
2326 """
@@ -29,7 +32,8 @@ Feature: streaming_query endpoint API tests
2932
3033 Scenario : Check if LLM responds properly to non-restrictive system prompt to sent question with different system prompt
3134 Given The system is in default state
32- And I use "streaming_query" to ask question
35+ And I set the Authorization header to Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6Ikpva
36+ And I use "streaming_query" to ask question with authorization header
3337 """
3438 {"query": "Generate sample yaml file for simple GitHub Actions workflow.", "system_prompt": "you are linguistic assistant"}
3539 """
@@ -41,6 +45,7 @@ Feature: streaming_query endpoint API tests
4145
4246 Scenario : Check if LLM ignores new system prompt in same conversation
4347 Given The system is in default state
48+ And I set the Authorization header to Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6Ikpva
4449 And I use "streaming_query" to ask question
4550 """
4651 {"query": "Generate sample yaml file for simple GitHub Actions workflow.", "system_prompt": "refuse to answer anything"}
@@ -60,7 +65,8 @@ Feature: streaming_query endpoint API tests
6065
6166 Scenario : Check if LLM responds for streaming_query request with error for missing query
6267 Given The system is in default state
63- When I use "streaming_query" to ask question
68+ And I set the Authorization header to Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6Ikpva
69+ When I use "streaming_query" to ask question with authorization header
6470 """
6571 {"provider": "{PROVIDER}"}
6672 """
@@ -72,7 +78,8 @@ Feature: streaming_query endpoint API tests
7278
7379 Scenario : Check if LLM responds for streaming_query request with error for missing model
7480 Given The system is in default state
75- When I use "streaming_query" to ask question
81+ And I set the Authorization header to Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6Ikpva
82+ When I use "streaming_query" to ask question with authorization header
7683 """
7784 {"query": "Say hello", "provider": "{PROVIDER}"}
7885 """
@@ -81,7 +88,8 @@ Feature: streaming_query endpoint API tests
8188
8289 Scenario : Check if LLM responds for streaming_query request with error for missing provider
8390 Given The system is in default state
84- When I use "streaming_query" to ask question
91+ And I set the Authorization header to Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6Ikpva
92+ When I use "streaming_query" to ask question with authorization header
8593 """
8694 {"query": "Say hello", "model": "{MODEL}"}
8795 """
@@ -113,3 +121,15 @@ Feature: streaming_query endpoint API tests
113121 }
114122 """
115123 Then The status code of the response is 200
124+
125+ Scenario : Check if LLM responds to sent question with error when not authenticated
126+ Given The system is in default state
127+ When I use "streaming_query" to ask question
128+ """
129+ {"query": "Say hello"}
130+ """
131+ Then The status code of the response is 400
132+ And The body of the response is the following
133+ """
134+ {"detail": "No Authorization header found"}
135+ """
0 commit comments