Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions examples/acl/_3.11.x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: acl
config:
allow:
- group1
- group2
hide_groups_header: true
3 changes: 3 additions & 0 deletions examples/acme/_3.11.x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: acme
config:
account_email: example@example.com
9 changes: 9 additions & 0 deletions examples/ai-azure-content-safety/_3.11.x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: ai-azure-content-safety
config:
content_safety_url: http//<host>:<port>
azure_use_managed_identity: false
reveal_failure_reason: true
content_safety_key: anything
categories:
- { name: "Hate", rejection_level: 2 }
- { name: "Violence", rejection_level: 2 }
13 changes: 13 additions & 0 deletions examples/ai-prompt-decorator/_3.11.x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: ai-prompt-decorator
config:
prompts:
prepend:
- role: "system"
content: "You are data scientist, specialising in survey analytics."
- role: "user"
content: "Classify this test result set as positive, negative, or neutral."
- role: "assistant"
content: "These tests are NEUTRAL."
append:
- role: "user"
content: "Do not mention any real participants name in your justification."
9 changes: 9 additions & 0 deletions examples/ai-prompt-guard/_3.11.x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: ai-prompt-guard
config:
allow_all_conversation_history: true
allow_patterns:
- ".*(P|p)ears.*"
- ".*(P|p)eaches.*"
deny_patterns:
- ".*(A|a)pples.*"
- ".*(O|o)ranges.*"
23 changes: 23 additions & 0 deletions examples/ai-prompt-template/_3.11.x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: ai-prompt-template
config:
allow_untemplated_requests: true
templates:
- name: "developer-chat"
template: |-
{
"messages": [
{
"role": "system",
"content": "You are a {{program}} expert, in {{language}} programming language."
},
{
"role": "user",
"content": "Write me a {{program}} program."
}
]
}
- name: "summarize-prompt"
template: |-
{
"prompt": "Summarize the following text for me: {{text}}"
}
15 changes: 15 additions & 0 deletions examples/ai-proxy-advanced/_3.11.x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: ai-proxy-advanced
config:
targets:
- route_type: llm/v1/chat
auth:
header_name: Authorization
header_value: Bearer token
model:
provider: openai
- route_type: llm/v1/chat
model:
provider: llama2
options:
llama2_format: openai
upstream_url: http://httpbin
12 changes: 12 additions & 0 deletions examples/ai-proxy/_3.11.x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: ai-proxy
config:
route_type: "llm/v1/chat"
auth:
header_name: "Authorization"
header_value: "Bearer <OPENAI_API_TOKEN>"
model:
provider: "openai"
name: "gpt-4"
options:
max_tokens: 512
temperature: 1.0
20 changes: 20 additions & 0 deletions examples/ai-rag-injector/_3.11.x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: ai-rag-injector
config:
inject_template: |
Only use the following information surrounded by <CONTEXT></CONTEXT> and your existing knowledge to provide the best possible answer to the user.
<CONTEXT><RAG RESPONSE></CONTEXT>
User's question: <PROMPT>
embeddings:
auth:
header_name: Authorization
header_value: Bearer <openai_key>
model:
provider: openai
name: text-embedding-3-large
vectordb:
strategy: redis
redis:
host: exampleredis.com
port: 80
distance_metric: cosine
dimensions: 76
9 changes: 9 additions & 0 deletions examples/ai-rate-limiting-advanced/_3.11.x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: ai-rate-limiting-advanced
config:
llm_providers:
- name: openai
limit: 1000
window_size: 3600
- name: mistral
limit: 100
window_size: 60
18 changes: 18 additions & 0 deletions examples/ai-request-transformer/_3.11.x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: ai-request-transformer
config:
prompt: "Mask any credit card numbers in my JSON message. Reply with only the JSON result."
transformation_extract_pattern: '\\{((.|\n)*)\\}'
llm:
route_type: "llm/v1/chat"
auth:
header_name: "Authorization"
header_value: "Bearer <OPENAI_API_TOKEN>"
logging:
log_statistics: true
log_payloads: false
model:
provider: "openai"
name: "gpt-4"
options:
max_tokens: 1024
temperature: 1.0
21 changes: 21 additions & 0 deletions examples/ai-response-transformer/_3.11.x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: ai-response-transformer
config:
prompt: "For any city name, put the country that it's in, in brackets next to it. Reply with only the JSON result."
transformation_extract_pattern: '\\{((.|\n)*)\\}'
parse_llm_response_json_instructions: false
llm:
route_type: "llm/v1/chat"
auth:
header_name: "api-key"
header_value: "<AZURE_OPENAI_TOKEN>"
logging:
log_statistics: true
log_payloads: false
model:
provider: "azure"
name: "gpt-35-turbo"
options:
max_tokens: 1024
temperature: 1.0
azure_instance: "azure-openai-instance-name"
azure_deployment_id: "gpt-3-5-deployment"
8 changes: 8 additions & 0 deletions examples/ai-sanitizer/_3.11.x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: ai-sanitizer
config:
port: 9000
anonymize:
- phone
- general
recover_redacted: false
redact_type: synthetic
14 changes: 14 additions & 0 deletions examples/ai-semantic-cache/_3.11.x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: ai-semantic-cache
config:
embeddings:
model:
provider: openai
name: text-embedding-3-large
vectordb:
strategy: redis
dimensions: 3072
threshold: 0.1
distance_metric: cosine
redis:
host: exampleredis.com
port: 80
23 changes: 23 additions & 0 deletions examples/ai-semantic-prompt-guard/_3.11.x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: ai-semantic-prompt-guard
config:
embeddings:
auth:
header_name: Authorization
header_value: Bearer <OPENAI_API_TOKEN>
model:
name: text-embedding-3-small
provider: openai
search:
threshold: 0.7
vectordb:
strategy: redis
distance_metric: cosine
threshold: 0.5
dimensions: 1024
redis:
host: localhost
port: 6379
rules:
match_all_conversation_history: true
allow_prompts:
- Questions about Kong
2 changes: 2 additions & 0 deletions examples/app-dynamics/_3.11.x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name: app-dynamics
config: {}
7 changes: 7 additions & 0 deletions examples/application-registration/_3.11.x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: application-registration
service: SERVICE_NAME
config:
auto_approve: false
description: <my_service_description>
display_name: <my_service_display_name>
show_issuer: false
9 changes: 9 additions & 0 deletions examples/aws-lambda/_3.11.x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: aws-lambda
config:
aws_key: <AWS_KEY>
aws_secret: <AWS_SECRET>
aws_region: <AWS_REGION>
aws_assume_role_arn: <AWS_ASSUME_ROLE_ARN>
aws_role_session_name: <AWS_ROLE_SESSION_NAME>
function_name: <LAMBDA_FUNCTION_NAME>
proxy_url: http://my-proxy-server:3128
6 changes: 6 additions & 0 deletions examples/azure-functions/_3.11.x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: azure-functions
config:
functionname: <AZURE_FUNCTIONNAME>
appname: <AZURE_APPNAME>
hostdomain: azurewebsites.net
apikey: <AZURE_APIKEY>
3 changes: 3 additions & 0 deletions examples/basic-auth/_3.11.x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: basic-auth
config:
hide_credentials: true
4 changes: 4 additions & 0 deletions examples/bot-detection/_3.11.x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name: bot-detection
config:
deny:
- helloworld
5 changes: 5 additions & 0 deletions examples/canary/_3.11.x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
name: canary
config:
percentage: 50
upstream_host: example.com
upstream_port: 80
12 changes: 12 additions & 0 deletions examples/confluent-consume/_3.11.x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: confluent-consume
config:
bootstrap_servers:
- host: YOUR_BOOTSTRAP_SERVER
port: 9092
topics:
- name: my-topic
mode: http-get
message_deserializer: json
auto_offset_reset: latest
cluster_api_key: YOUR_API_KEY
cluster_api_secret: YOUR_API_SECRET
9 changes: 9 additions & 0 deletions examples/confluent/_3.11.x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: confluent
config:
bootstrap_servers:
- host: example.com
port: 80
producer_async: false
topic: 'kong-test'
cluster_api_key: CONFLUENT_CLUSTER_API_KEY
cluster_api_secret: CONFLUENT_CLUSTER_API_SECRET
5 changes: 5 additions & 0 deletions examples/correlation-id/_3.11.x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
name: correlation-id
config:
header_name: Kong-Request-ID
generator: uuid#counter
echo_downstream: false
19 changes: 19 additions & 0 deletions examples/cors/_3.11.x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: cors
config:
origins:
- http://mockbin.com
methods:
- GET
- POST
headers:
- Accept
- Accept-Version
- Content-Length
- Content-MD5
- Content-Type
- Date
- X-Auth-Token
exposed_headers:
- X-Auth-Token
credentials: true
max_age: 3600
6 changes: 6 additions & 0 deletions examples/datadog/_3.11.x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: datadog
config:
host: 127.0.0.1
port: 8125
flush_timeout: 2
retry_count: 10
3 changes: 3 additions & 0 deletions examples/degraphql/_3.11.x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: degraphql
config:
graphql_server_path: '/graphql'
4 changes: 4 additions & 0 deletions examples/exit-transformer/_3.11.x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name: exit-transformer
config:
functions:
- "return function(status, body, headers) return status, body, headers end"
3 changes: 3 additions & 0 deletions examples/file-log/_3.11.x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: file-log
config:
path: /tmp/file.log
9 changes: 9 additions & 0 deletions examples/forward-proxy/_3.11.x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: forward-proxy
config:
http_proxy_host: example.com
http_proxy_port: 80
proxy_scheme: http
auth_username: example_user
auth_password: example_pass
https_verify: false
x_headers: transparent
3 changes: 3 additions & 0 deletions examples/graphql-proxy-cache-advanced/_3.11.x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: graphql-proxy-cache-advanced
config:
strategy: memory
9 changes: 9 additions & 0 deletions examples/graphql-rate-limiting-advanced/_3.11.x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: graphql-rate-limiting-advanced
config:
limit:
- 5
window_size:
- 30
sync_rate: -1
namespace: example_namespace
strategy: cluster
3 changes: 3 additions & 0 deletions examples/grpc-gateway/_3.11.x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: grpc-gateway
config:
proto: path/to/hello.proto
3 changes: 3 additions & 0 deletions examples/grpc-web/_3.11.x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: grpc-web
config:
proto: path/to/hello.proto
7 changes: 7 additions & 0 deletions examples/header-cert-auth/_3.11.x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: header-cert-auth
config:
ca_certificates:
- "0D769DE8-7CC0-4541-989B-F9C23E20054C"
certificate_header_name: ssl-client-cert
certificate_header_format: base64_encoded
secure_source: false
3 changes: 3 additions & 0 deletions examples/hmac-auth/_3.11.x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: hmac-auth
config:
hide_credentials: false
8 changes: 8 additions & 0 deletions examples/http-log/_3.11.x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: http-log
config:
http_endpoint: http://mockbin.org/bin/:id
method: POST
timeout: 1000
keepalive: 1000
flush_timeout: 2
retry_count: 15
9 changes: 9 additions & 0 deletions examples/injection-protection/_3.11.x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: injection-protection
config:
injection_types:
- "sql"
locations:
- "path_and_query"
enforcement_mode: block
error_status_code: 400
error_message: Bad Request
Loading