security.feature 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. @llama.cpp
  2. Feature: Security
  3. Background: Server startup with an api key defined
  4. Given a server listening on localhost:8080
  5. And a model file stories260K.gguf
  6. And a server api key llama.cpp
  7. Then the server is starting
  8. Then the server is healthy
  9. Scenario Outline: Completion with some user api key
  10. Given a prompt test
  11. And a user api key <api_key>
  12. And 4 max tokens to predict
  13. And a completion request with <api_error> api error
  14. Examples: Prompts
  15. | api_key | api_error |
  16. | llama.cpp | no |
  17. | llama.cpp | no |
  18. | hackeme | raised |
  19. | | raised |
  20. Scenario Outline: OAI Compatibility
  21. Given a system prompt test
  22. And a user prompt test
  23. And a model test
  24. And 2 max tokens to predict
  25. And streaming is disabled
  26. And a user api key <api_key>
  27. Given an OAI compatible chat completions request with <api_error> api error
  28. Examples: Prompts
  29. | api_key | api_error |
  30. | llama.cpp | no |
  31. | llama.cpp | no |
  32. | hackme | raised |
  33. Scenario Outline: CORS Options
  34. When an OPTIONS request is sent from <origin>
  35. Then CORS header <cors_header> is set to <cors_header_value>
  36. Examples: Headers
  37. | origin | cors_header | cors_header_value |
  38. | localhost | Access-Control-Allow-Origin | localhost |
  39. | web.mydomain.fr | Access-Control-Allow-Origin | web.mydomain.fr |
  40. | origin | Access-Control-Allow-Credentials | true |
  41. | web.mydomain.fr | Access-Control-Allow-Methods | POST |
  42. | web.mydomain.fr | Access-Control-Allow-Headers | * |