├── .asf.yaml ├── .devcontainer ├── Dockerfile ├── devcontainer.json └── docker-compose.yml ├── .editorconfig ├── .gitattributes ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.yml │ ├── config.yml │ ├── feature_request.yml │ ├── improve_docs.yml │ └── request_help.yml ├── PULL_REQUEST_TEMPLATE.md ├── actions │ └── .editorconfig ├── dependabot.yml └── workflows │ ├── build.yml │ ├── cli.yml │ ├── close-unresponded.yml │ ├── code-lint.yml │ ├── doc-lint.yml │ ├── gm-cron.yaml.disabled │ ├── gm.yml.disabled │ ├── kubernetes-ci.yml │ ├── license-checker.yml │ ├── link-check.yml │ ├── lint.yml │ ├── redhat-ci.yaml │ ├── semantic.yml │ ├── source-install.yml │ ├── stale.yml │ ├── tars-ci.yml │ └── update-labels.yml ├── .gitignore ├── .gitmodules ├── .ignore_words ├── .licenserc.yaml ├── .luacheckrc ├── .markdownlint.yml ├── .requirements ├── .shellcheckrc ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CODE_STYLE.md ├── CONTRIBUTING.md ├── LICENSE ├── MAINTAIN.md ├── Makefile ├── NOTICE ├── README.md ├── THREAT_MODEL.md ├── Vision-and-Milestones.md ├── apisix-master-0.rockspec ├── apisix ├── admin │ ├── consumer_group.lua │ ├── consumers.lua │ ├── credentials.lua │ ├── global_rules.lua │ ├── init.lua │ ├── plugin_config.lua │ ├── plugin_metadata.lua │ ├── plugins.lua │ ├── proto.lua │ ├── resource.lua │ ├── routes.lua │ ├── schema.lua │ ├── secrets.lua │ ├── services.lua │ ├── ssl.lua │ ├── standalone.lua │ ├── stream_routes.lua │ ├── upstreams.lua │ ├── utils.lua │ └── v3_adapter.lua ├── api_router.lua ├── balancer.lua ├── balancer │ ├── chash.lua │ ├── ewma.lua │ ├── least_conn.lua │ ├── priority.lua │ └── roundrobin.lua ├── cli │ ├── apisix.lua │ ├── config.lua │ ├── env.lua │ ├── etcd.lua │ ├── file.lua │ ├── ip.lua │ ├── ngx_tpl.lua │ ├── ops.lua │ ├── schema.lua │ └── util.lua ├── constants.lua ├── consumer.lua ├── consumer_group.lua ├── control │ ├── router.lua │ └── v1.lua ├── core.lua ├── core │ ├── config_etcd.lua │ ├── config_local.lua │ ├── config_util.lua │ ├── config_xds.lua │ ├── config_yaml.lua │ ├── ctx.lua │ ├── dns │ │ └── client.lua │ ├── env.lua │ ├── etcd.lua │ ├── event.lua │ ├── id.lua │ ├── io.lua │ ├── ip.lua │ ├── json.lua │ ├── log.lua │ ├── lrucache.lua │ ├── math.lua │ ├── os.lua │ ├── profile.lua │ ├── pubsub.lua │ ├── request.lua │ ├── resolver.lua │ ├── response.lua │ ├── schema.lua │ ├── string.lua │ ├── table.lua │ ├── timer.lua │ ├── utils.lua │ └── version.lua ├── debug.lua ├── discovery │ ├── consul │ │ ├── init.lua │ │ └── schema.lua │ ├── consul_kv │ │ ├── init.lua │ │ └── schema.lua │ ├── dns │ │ ├── init.lua │ │ └── schema.lua │ ├── eureka │ │ ├── init.lua │ │ └── schema.lua │ ├── init.lua │ ├── kubernetes │ │ ├── informer_factory.lua │ │ ├── init.lua │ │ └── schema.lua │ ├── nacos │ │ ├── init.lua │ │ └── schema.lua │ └── tars │ │ ├── init.lua │ │ └── schema.lua ├── events.lua ├── global_rules.lua ├── http │ ├── route.lua │ ├── router │ │ ├── radixtree_host_uri.lua │ │ ├── radixtree_uri.lua │ │ └── radixtree_uri_with_parameter.lua │ └── service.lua ├── include │ └── apisix │ │ └── model │ │ └── pubsub.proto ├── init.lua ├── inspect │ ├── dbg.lua │ └── init.lua ├── patch.lua ├── plugin.lua ├── plugin_config.lua ├── plugins │ ├── ai-aws-content-moderation.lua │ ├── ai-drivers │ │ ├── deepseek.lua │ │ ├── openai-base.lua │ │ ├── openai-compatible.lua │ │ ├── openai.lua │ │ └── schema.lua │ ├── ai-prompt-decorator.lua │ ├── ai-prompt-guard.lua │ ├── ai-prompt-template.lua │ ├── ai-proxy-multi.lua │ ├── ai-proxy.lua │ ├── ai-proxy │ │ ├── base.lua │ │ └── schema.lua │ ├── ai-rag.lua │ ├── ai-rag │ │ ├── embeddings │ │ │ └── azure_openai.lua │ │ └── vector-search │ │ │ └── azure_ai_search.lua │ ├── ai-rate-limiting.lua │ ├── ai-request-rewrite.lua │ ├── ai.lua │ ├── api-breaker.lua │ ├── attach-consumer-label.lua │ ├── authz-casbin.lua │ ├── authz-casdoor.lua │ ├── authz-keycloak.lua │ ├── aws-lambda.lua │ ├── azure-functions.lua │ ├── basic-auth.lua │ ├── batch-requests.lua │ ├── body-transformer.lua │ ├── brotli.lua │ ├── cas-auth.lua │ ├── chaitin-waf.lua │ ├── clickhouse-logger.lua │ ├── client-control.lua │ ├── consumer-restriction.lua │ ├── cors.lua │ ├── csrf.lua │ ├── datadog.lua │ ├── degraphql.lua │ ├── dubbo-proxy.lua │ ├── echo.lua │ ├── elasticsearch-logger.lua │ ├── error-log-logger.lua │ ├── example-plugin.lua │ ├── ext-plugin-post-req.lua │ ├── ext-plugin-post-resp.lua │ ├── ext-plugin-pre-req.lua │ ├── ext-plugin │ │ ├── helper.lua │ │ └── init.lua │ ├── fault-injection.lua │ ├── file-logger.lua │ ├── forward-auth.lua │ ├── gm.lua │ ├── google-cloud-logging.lua │ ├── grpc-transcode.lua │ ├── grpc-transcode │ │ ├── proto.lua │ │ ├── request.lua │ │ ├── response.lua │ │ └── util.lua │ ├── grpc-web.lua │ ├── gzip.lua │ ├── hmac-auth.lua │ ├── http-dubbo.lua │ ├── http-logger.lua │ ├── inspect.lua │ ├── ip-restriction.lua │ ├── ip-restriction │ │ └── init.lua │ ├── jwe-decrypt.lua │ ├── jwt-auth.lua │ ├── kafka-logger.lua │ ├── kafka-proxy.lua │ ├── key-auth.lua │ ├── lago.lua │ ├── ldap-auth.lua │ ├── limit-conn.lua │ ├── limit-conn │ │ ├── init.lua │ │ ├── limit-conn-redis-cluster.lua │ │ ├── limit-conn-redis.lua │ │ └── util.lua │ ├── limit-count.lua │ ├── limit-count │ │ ├── init.lua │ │ ├── limit-count-local.lua │ │ ├── limit-count-redis-cluster.lua │ │ └── limit-count-redis.lua │ ├── limit-req.lua │ ├── limit-req │ │ ├── limit-req-redis-cluster.lua │ │ ├── limit-req-redis.lua │ │ └── util.lua │ ├── log-rotate.lua │ ├── loggly.lua │ ├── loki-logger.lua │ ├── mcp-bridge.lua │ ├── mcp │ │ └── session.lua │ ├── mocking.lua │ ├── multi-auth.lua │ ├── node-status.lua │ ├── ocsp-stapling.lua │ ├── opa.lua │ ├── opa │ │ └── helper.lua │ ├── openfunction.lua │ ├── openid-connect.lua │ ├── opentelemetry.lua │ ├── openwhisk.lua │ ├── prometheus.lua │ ├── prometheus │ │ └── exporter.lua │ ├── proxy-cache │ │ ├── disk_handler.lua │ │ ├── init.lua │ │ ├── memory.lua │ │ ├── memory_handler.lua │ │ └── util.lua │ ├── proxy-control.lua │ ├── proxy-mirror.lua │ ├── proxy-rewrite.lua │ ├── public-api.lua │ ├── real-ip.lua │ ├── redirect.lua │ ├── referer-restriction.lua │ ├── request-id.lua │ ├── request-validation.lua │ ├── response-rewrite.lua │ ├── rocketmq-logger.lua │ ├── server-info.lua │ ├── serverless-post-function.lua │ ├── serverless-pre-function.lua │ ├── serverless │ │ ├── generic-upstream.lua │ │ └── init.lua │ ├── skywalking-logger.lua │ ├── skywalking.lua │ ├── sls-logger.lua │ ├── splunk-hec-logging.lua │ ├── syslog.lua │ ├── syslog │ │ └── init.lua │ ├── tcp-logger.lua │ ├── tencent-cloud-cls.lua │ ├── tencent-cloud-cls │ │ └── cls-sdk.lua │ ├── traffic-split.lua │ ├── ua-restriction.lua │ ├── udp-logger.lua │ ├── uri-blocker.lua │ ├── wolf-rbac.lua │ ├── workflow.lua │ ├── zipkin.lua │ └── zipkin │ │ ├── codec.lua │ │ ├── random_sampler.lua │ │ └── reporter.lua ├── pubsub │ └── kafka.lua ├── router.lua ├── schema_def.lua ├── script.lua ├── secret.lua ├── secret │ ├── aws.lua │ ├── gcp.lua │ └── vault.lua ├── ssl.lua ├── ssl │ └── router │ │ └── radixtree_sni.lua ├── stream │ ├── plugins │ │ ├── ip-restriction.lua │ │ ├── limit-conn.lua │ │ ├── mqtt-proxy.lua │ │ ├── prometheus.lua │ │ └── syslog.lua │ ├── router │ │ └── ip_port.lua │ ├── xrpc.lua │ └── xrpc │ │ ├── metrics.lua │ │ ├── protocols │ │ ├── dubbo │ │ │ ├── init.lua │ │ │ └── schema.lua │ │ └── redis │ │ │ ├── commands.lua │ │ │ ├── init.lua │ │ │ ├── metrics.lua │ │ │ └── schema.lua │ │ ├── runner.lua │ │ └── sdk.lua ├── timers.lua ├── upstream.lua ├── utils │ ├── auth.lua │ ├── batch-processor-manager.lua │ ├── batch-processor.lua │ ├── content-decode.lua │ ├── google-cloud-oauth.lua │ ├── log-util.lua │ ├── redis-schema.lua │ ├── redis.lua │ ├── rediscluster.lua │ ├── rfc5424.lua │ ├── router.lua │ └── upstream.lua └── wasm.lua ├── autodocs ├── config.ld ├── generate.sh └── ldoc.ltp ├── benchmark ├── fake-apisix │ ├── conf │ │ ├── cert │ │ │ ├── apisix.crt │ │ │ ├── apisix.key │ │ │ └── openssl.conf │ │ └── nginx.conf │ └── lua │ │ └── apisix.lua ├── run.sh └── server │ └── conf │ └── nginx.conf ├── bin └── apisix ├── ci ├── backup-docker-images.sh ├── common.sh ├── free_disk_space.sh ├── init-common-test-service.sh ├── init-last-test-service.sh ├── init-plugin-test-service.sh ├── kubernetes-ci.sh ├── linux-install-etcd-client.sh ├── linux-install-openresty.sh ├── linux_apisix_current_luarocks_in_customed_nginx_runner.sh ├── linux_apisix_current_luarocks_runner.sh ├── linux_openresty_common_runner.sh ├── linux_openresty_runner.sh ├── linux_openresty_tongsuo_runner.sh ├── pod │ ├── docker-compose.common.yml │ ├── docker-compose.first.yml │ ├── docker-compose.last.yml │ ├── docker-compose.plugin.yml │ ├── etcd │ │ └── env │ │ │ └── common.env │ ├── eureka │ │ └── env │ │ │ └── common.env │ ├── kafka │ │ ├── kafka-server │ │ │ ├── env │ │ │ │ ├── common.env │ │ │ │ ├── common2.env │ │ │ │ └── last.env │ │ │ └── kafka_jaas.conf │ │ └── zookeeper-server │ │ │ └── env │ │ │ └── common.env │ ├── keycloak │ │ ├── kcadm_configure_basic.sh │ │ ├── kcadm_configure_cas.sh │ │ ├── kcadm_configure_university.sh │ │ ├── server.crt.pem │ │ └── server.key.pem │ ├── nacos │ │ ├── env │ │ │ ├── common.env │ │ │ └── service.env │ │ ├── healthcheck │ │ │ ├── Dockerfile │ │ │ ├── nacos-server-healthcheck.sh │ │ │ └── nacos-service-healthcheck.sh │ │ └── service │ │ │ └── Dockerfile │ ├── opa │ │ ├── data.json │ │ ├── echo.rego │ │ ├── example.rego │ │ └── with_route.rego │ ├── openfunction │ │ ├── build-function-image.sh │ │ └── function-example │ │ │ ├── test-body │ │ │ ├── go.mod │ │ │ ├── go.sum │ │ │ └── hello.go │ │ │ ├── test-header │ │ │ ├── go.mod │ │ │ └── hello.go │ │ │ └── test-uri │ │ │ ├── go.mod │ │ │ ├── go.sum │ │ │ └── hello.go │ ├── otelcol-contrib │ │ └── config.yaml │ └── vector │ │ └── vector.toml ├── redhat-ci.sh └── tars-ci.sh ├── conf ├── apisix.yaml ├── cert │ ├── ssl_PLACE_HOLDER.crt │ └── ssl_PLACE_HOLDER.key ├── config.yaml ├── config.yaml.example ├── debug.yaml └── mime.types ├── docs ├── assets │ ├── images │ │ ├── MA.jpeg │ │ ├── OA.jpg │ │ ├── apache.png │ │ ├── apisix-multi-lang-support.png │ │ ├── apisix-seed.svg │ │ ├── apisix.png │ │ ├── aws-caddy-php-welcome-page.png │ │ ├── aws-define-route.png │ │ ├── aws-define-service.png │ │ ├── aws-fargate-cdk.png │ │ ├── aws-nlb-ip-addr.png │ │ ├── benchmark-1.jpg │ │ ├── benchmark-2.jpg │ │ ├── build-devcontainers-vscode-command.png │ │ ├── build-devcontainers-vscode-progressbar.png │ │ ├── consumer-internal.png │ │ ├── consumer-who.png │ │ ├── contributor-over-time.png │ │ ├── control-plane-service-discovery.png │ │ ├── create-a-route.png │ │ ├── dashboard.jpeg │ │ ├── deployment-cp_and_dp.png │ │ ├── deployment-traditional.png │ │ ├── discovery-cn.png │ │ ├── discovery.png │ │ ├── external-plugin.png │ │ ├── flamegraph-1.jpg │ │ ├── flamegraph-2.jpg │ │ ├── flow-load-plugin.png │ │ ├── flow-plugin-internal.png │ │ ├── flow-software-architecture.png │ │ ├── health_check_node_state_diagram.png │ │ ├── health_check_status_page.png │ │ ├── latency-1.jpg │ │ ├── latency-2.jpg │ │ ├── list-of-routes.png │ │ ├── plugin │ │ │ ├── authz-keycloak.png │ │ │ ├── basic-auth-1.png │ │ │ ├── basic-auth-2.png │ │ │ ├── grafana-1.png │ │ │ ├── grafana-2.png │ │ │ ├── grafana-3.png │ │ │ ├── grafana-4.png │ │ │ ├── hmac-auth-1.png │ │ │ ├── hmac-auth-2.png │ │ │ ├── inspect.png │ │ │ ├── jaeger-1.png │ │ │ ├── jaeger-2.png │ │ │ ├── jwt-auth-1.png │ │ │ ├── jwt-auth-2.png │ │ │ ├── jwt-auth-3.png │ │ │ ├── key-auth-1.png │ │ │ ├── key-auth-2.png │ │ │ ├── limit-conn-1.png │ │ │ ├── limit-count-1.png │ │ │ ├── limit-req-1.png │ │ │ ├── loggly-dashboard.png │ │ │ ├── oauth-1.png │ │ │ ├── prometheus-1.png │ │ │ ├── prometheus-2.png │ │ │ ├── prometheus01.png │ │ │ ├── prometheus02.png │ │ │ ├── skywalking-1.png │ │ │ ├── skywalking-3.png │ │ │ ├── skywalking-4.png │ │ │ ├── skywalking-5.png │ │ │ ├── sls-logger-1.png │ │ │ ├── splunk-hec-admin-cn.png │ │ │ ├── splunk-hec-admin-en.png │ │ │ ├── wolf-rbac-1.png │ │ │ ├── wolf-rbac-2.png │ │ │ ├── zipkin-1.jpg │ │ │ ├── zipkin-1.png │ │ │ └── zipkin-2.jpg │ │ ├── pubsub-architecture.svg │ │ ├── requesturl.jpg │ │ ├── routes-example.png │ │ ├── secret.png │ │ ├── service-example.png │ │ ├── skip-mtls.png │ │ ├── update-docker-desktop-file-sharing.png │ │ └── upstream-example.png │ └── other │ │ ├── apisix-plugin-design.graffle │ │ └── json │ │ └── apisix-grafana-dashboard.json ├── en │ └── latest │ │ ├── FAQ.md │ │ ├── admin-api.md │ │ ├── apisix-variable.md │ │ ├── architecture-design │ │ └── apisix.md │ │ ├── aws.md │ │ ├── batch-processor.md │ │ ├── benchmark.md │ │ ├── build-apisix-dev-environment-devcontainers.md │ │ ├── build-apisix-dev-environment-on-mac.md │ │ ├── building-apisix.md │ │ ├── certificate.md │ │ ├── config.json │ │ ├── control-api.md │ │ ├── customize-nginx-configuration.md │ │ ├── debug-function.md │ │ ├── debug-mode.md │ │ ├── deployment-modes.md │ │ ├── discovery.md │ │ ├── discovery │ │ ├── consul.md │ │ ├── consul_kv.md │ │ ├── control-plane-service-discovery.md │ │ ├── dns.md │ │ ├── eureka.md │ │ ├── kubernetes.md │ │ └── nacos.md │ │ ├── examples │ │ └── plugins-hmac-auth-generate-signature.md │ │ ├── external-plugin.md │ │ ├── getting-started │ │ ├── README.md │ │ ├── configure-routes.md │ │ ├── key-authentication.md │ │ ├── load-balancing.md │ │ └── rate-limiting.md │ │ ├── grpc-proxy.md │ │ ├── http3.md │ │ ├── install-dependencies.md │ │ ├── installation-guide.md │ │ ├── internal │ │ ├── plugin-runner.md │ │ └── testing-framework.md │ │ ├── mtls.md │ │ ├── plugin-develop.md │ │ ├── plugins │ │ ├── ai-aws-content-moderation.md │ │ ├── ai-prompt-decorator.md │ │ ├── ai-prompt-guard.md │ │ ├── ai-prompt-template.md │ │ ├── ai-proxy-multi.md │ │ ├── ai-proxy.md │ │ ├── ai-rag.md │ │ ├── ai-rate-limiting.md │ │ ├── ai-request-rewrite.md │ │ ├── api-breaker.md │ │ ├── attach-consumer-label.md │ │ ├── authz-casbin.md │ │ ├── authz-casdoor.md │ │ ├── authz-keycloak.md │ │ ├── aws-lambda.md │ │ ├── azure-functions.md │ │ ├── basic-auth.md │ │ ├── batch-requests.md │ │ ├── body-transformer.md │ │ ├── brotli.md │ │ ├── cas-auth.md │ │ ├── chaitin-waf.md │ │ ├── clickhouse-logger.md │ │ ├── client-control.md │ │ ├── consumer-restriction.md │ │ ├── cors.md │ │ ├── csrf.md │ │ ├── datadog.md │ │ ├── degraphql.md │ │ ├── dubbo-proxy.md │ │ ├── echo.md │ │ ├── elasticsearch-logger.md │ │ ├── error-log-logger.md │ │ ├── ext-plugin-post-req.md │ │ ├── ext-plugin-post-resp.md │ │ ├── ext-plugin-pre-req.md │ │ ├── fault-injection.md │ │ ├── file-logger.md │ │ ├── forward-auth.md │ │ ├── gm.md │ │ ├── google-cloud-logging.md │ │ ├── grpc-transcode.md │ │ ├── grpc-web.md │ │ ├── gzip.md │ │ ├── hmac-auth.md │ │ ├── http-dubbo.md │ │ ├── http-logger.md │ │ ├── inspect.md │ │ ├── ip-restriction.md │ │ ├── jwe-decrypt.md │ │ ├── jwt-auth.md │ │ ├── kafka-logger.md │ │ ├── kafka-proxy.md │ │ ├── key-auth.md │ │ ├── lago.md │ │ ├── ldap-auth.md │ │ ├── limit-conn.md │ │ ├── limit-count.md │ │ ├── limit-req.md │ │ ├── log-rotate.md │ │ ├── loggly.md │ │ ├── loki-logger.md │ │ ├── mocking.md │ │ ├── mqtt-proxy.md │ │ ├── multi-auth.md │ │ ├── node-status.md │ │ ├── ocsp-stapling.md │ │ ├── opa.md │ │ ├── openfunction.md │ │ ├── openid-connect.md │ │ ├── opentelemetry.md │ │ ├── openwhisk.md │ │ ├── prometheus.md │ │ ├── proxy-cache.md │ │ ├── proxy-control.md │ │ ├── proxy-mirror.md │ │ ├── proxy-rewrite.md │ │ ├── public-api.md │ │ ├── real-ip.md │ │ ├── redirect.md │ │ ├── referer-restriction.md │ │ ├── request-id.md │ │ ├── request-validation.md │ │ ├── response-rewrite.md │ │ ├── rocketmq-logger.md │ │ ├── server-info.md │ │ ├── serverless.md │ │ ├── skywalking-logger.md │ │ ├── skywalking.md │ │ ├── sls-logger.md │ │ ├── splunk-hec-logging.md │ │ ├── syslog.md │ │ ├── tcp-logger.md │ │ ├── tencent-cloud-cls.md │ │ ├── traffic-split.md │ │ ├── ua-restriction.md │ │ ├── udp-logger.md │ │ ├── uri-blocker.md │ │ ├── wolf-rbac.md │ │ ├── workflow.md │ │ └── zipkin.md │ │ ├── profile.md │ │ ├── pubsub.md │ │ ├── pubsub │ │ └── kafka.md │ │ ├── router-radixtree.md │ │ ├── ssl-protocol.md │ │ ├── status-api.md │ │ ├── stream-proxy.md │ │ ├── support-fips-in-apisix.md │ │ ├── terminology │ │ ├── api-gateway.md │ │ ├── consumer-group.md │ │ ├── consumer.md │ │ ├── credential.md │ │ ├── global-rule.md │ │ ├── plugin-config.md │ │ ├── plugin-metadata.md │ │ ├── plugin.md │ │ ├── route.md │ │ ├── router.md │ │ ├── script.md │ │ ├── secret.md │ │ ├── service.md │ │ └── upstream.md │ │ ├── tutorials │ │ ├── add-multiple-api-versions.md │ │ ├── cache-api-responses.md │ │ ├── client-to-apisix-mtls.md │ │ ├── expose-api.md │ │ ├── health-check.md │ │ ├── manage-api-consumers.md │ │ ├── monitor-api-health-check.md │ │ ├── observe-your-api.md │ │ ├── protect-api.md │ │ └── websocket-authentication.md │ │ ├── upgrade-guide-from-2.15.x-to-3.0.0.md │ │ ├── wasm.md │ │ ├── xrpc.md │ │ └── xrpc │ │ └── redis.md └── zh │ └── latest │ ├── CHANGELOG.md │ ├── CODE_STYLE.md │ ├── FAQ.md │ ├── README.md │ ├── admin-api.md │ ├── apisix-variable.md │ ├── architecture-design │ └── apisix.md │ ├── batch-processor.md │ ├── benchmark.md │ ├── build-apisix-dev-environment-on-mac.md │ ├── building-apisix.md │ ├── certificate.md │ ├── config.json │ ├── control-api.md │ ├── customize-nginx-configuration.md │ ├── debug-function.md │ ├── debug-mode.md │ ├── discovery.md │ ├── discovery │ ├── control-plane-service-discovery.md │ ├── dns.md │ ├── eureka.md │ ├── kubernetes.md │ └── nacos.md │ ├── external-plugin.md │ ├── getting-started │ ├── README.md │ ├── configure-routes.md │ ├── key-authentication.md │ ├── load-balancing.md │ └── rate-limiting.md │ ├── grpc-proxy.md │ ├── http3.md │ ├── install-dependencies.md │ ├── installation-guide.md │ ├── mtls.md │ ├── plugin-develop.md │ ├── plugins │ ├── api-breaker.md │ ├── attach-consumer-label.md │ ├── authz-casbin.md │ ├── authz-casdoor.md │ ├── authz-keycloak.md │ ├── aws-lambda.md │ ├── azure-functions.md │ ├── basic-auth.md │ ├── batch-requests.md │ ├── body-transformer.md │ ├── brotli.md │ ├── chaitin-waf.md │ ├── clickhouse-logger.md │ ├── client-control.md │ ├── consumer-restriction.md │ ├── cors.md │ ├── csrf.md │ ├── datadog.md │ ├── dubbo-proxy.md │ ├── echo.md │ ├── elasticsearch-logger.md │ ├── error-log-logger.md │ ├── ext-plugin-post-req.md │ ├── ext-plugin-post-resp.md │ ├── ext-plugin-pre-req.md │ ├── fault-injection.md │ ├── file-logger.md │ ├── forward-auth.md │ ├── gm.md │ ├── google-cloud-logging.md │ ├── grpc-transcode.md │ ├── grpc-web.md │ ├── gzip.md │ ├── hmac-auth.md │ ├── http-dubbo.md │ ├── http-logger.md │ ├── ip-restriction.md │ ├── jwe-decrypt.md │ ├── jwt-auth.md │ ├── kafka-logger.md │ ├── key-auth.md │ ├── ldap-auth.md │ ├── limit-conn.md │ ├── limit-count.md │ ├── limit-req.md │ ├── log-rotate.md │ ├── loggly.md │ ├── loki-logger.md │ ├── mocking.md │ ├── mqtt-proxy.md │ ├── multi-auth.md │ ├── node-status.md │ ├── ocsp-stapling.md │ ├── opa.md │ ├── openfunction.md │ ├── openid-connect.md │ ├── opentelemetry.md │ ├── openwhisk.md │ ├── prometheus.md │ ├── proxy-cache.md │ ├── proxy-control.md │ ├── proxy-mirror.md │ ├── proxy-rewrite.md │ ├── public-api.md │ ├── real-ip.md │ ├── redirect.md │ ├── referer-restriction.md │ ├── request-id.md │ ├── request-validation.md │ ├── response-rewrite.md │ ├── rocketmq-logger.md │ ├── server-info.md │ ├── serverless.md │ ├── skywalking-logger.md │ ├── skywalking.md │ ├── sls-logger.md │ ├── splunk-hec-logging.md │ ├── syslog.md │ ├── tcp-logger.md │ ├── tencent-cloud-cls.md │ ├── traffic-split.md │ ├── ua-restriction.md │ ├── udp-logger.md │ ├── uri-blocker.md │ ├── wolf-rbac.md │ ├── workflow.md │ └── zipkin.md │ ├── profile.md │ ├── router-radixtree.md │ ├── ssl-protocol.md │ ├── status-api.md │ ├── stream-proxy.md │ ├── support-fips-in-apisix.md │ ├── terminology │ ├── api-gateway.md │ ├── consumer-group.md │ ├── consumer.md │ ├── credential.md │ ├── global-rule.md │ ├── plugin-config.md │ ├── plugin-metadata.md │ ├── plugin.md │ ├── route.md │ ├── router.md │ ├── script.md │ ├── secret.md │ ├── service.md │ └── upstream.md │ ├── tutorials │ ├── client-to-apisix-mtls.md │ ├── expose-api.md │ ├── health-check.md │ ├── observe-your-api.md │ └── protect-api.md │ ├── upgrade-guide-from-2.15.x-to-3.0.0.md │ └── wasm.md ├── example ├── apisix │ ├── plugins │ │ └── 3rd-party.lua │ └── stream │ │ └── plugins │ │ └── 3rd-party.lua ├── build-dev-image.dockerfile └── my_hook.lua ├── logos ├── apache-apisix.png ├── apisix-white-bg.jpg ├── cncf-landscape-white-bg.jpg └── cncf-white-bg.jpg ├── powered-by.md ├── t ├── APISIX.pm ├── admin │ ├── api.t │ ├── balancer.t │ ├── consumer-group-force-delete.t │ ├── consumer-group.t │ ├── consumers.t │ ├── consumers2.t │ ├── credentials.t │ ├── filter.t │ ├── global-rules.t │ ├── global-rules2.t │ ├── health-check.t │ ├── metadata.spec.ts │ ├── metadata.t │ ├── plugin-configs-force-delete.t │ ├── plugin-configs.t │ ├── plugin-metadata.t │ ├── plugin-metadata2.t │ ├── plugins-reload.t │ ├── plugins.t │ ├── protos-force-delete.t │ ├── protos.t │ ├── resources.t │ ├── response_body_format.t │ ├── routes-array-nodes.t │ ├── routes.t │ ├── routes2.t │ ├── routes3.t │ ├── routes4.t │ ├── schema-validate.t │ ├── schema.t │ ├── secrets.t │ ├── services-array-nodes.t │ ├── services-force-delete.t │ ├── services-string-id.t │ ├── services.t │ ├── services2.t │ ├── ssl.t │ ├── ssl2.t │ ├── ssl3.t │ ├── ssl4.t │ ├── ssl5.t │ ├── ssls.t │ ├── standalone-healthcheck.t │ ├── standalone.spec.ts │ ├── standalone.t │ ├── stream-routes-disable.t │ ├── stream-routes.t │ ├── token.t │ ├── upstream-array-nodes.t │ ├── upstream-force-delete.t │ ├── upstream.t │ ├── upstream2.t │ ├── upstream3.t │ ├── upstream4.t │ └── upstream5.t ├── apisix.luacov ├── assets │ ├── ai-proxy-response.json │ ├── content-moderation-responses.json │ └── embeddings.json ├── certs │ ├── apisix.crt │ ├── apisix.key │ ├── apisix_admin_ssl.crt │ ├── apisix_admin_ssl.key │ ├── apisix_ecc.crt │ ├── apisix_ecc.key │ ├── client_enc.crt │ ├── client_enc.key │ ├── client_sign.crt │ ├── client_sign.key │ ├── etcd.key │ ├── etcd.pem │ ├── gm_ca.crt │ ├── incorrect.crt │ ├── incorrect.key │ ├── localhost_slapd_cert.pem │ ├── localhost_slapd_key.pem │ ├── mtls_ca.crt │ ├── mtls_ca.key │ ├── mtls_client.crt │ ├── mtls_client.key │ ├── mtls_server.crt │ ├── mtls_server.key │ ├── ocsp │ │ ├── ecc_good.crt │ │ ├── ecc_good.key │ │ ├── index.txt │ │ ├── rsa_good.crt │ │ ├── rsa_good.key │ │ ├── rsa_revoked.crt │ │ ├── rsa_revoked.key │ │ ├── rsa_unknown.crt │ │ ├── rsa_unknown.key │ │ ├── signer.crt │ │ └── signer.key │ ├── openssl-test2.conf │ ├── openssl.conf │ ├── private.pem │ ├── public.pem │ ├── server_1024.crt │ ├── server_1024.key │ ├── server_enc.crt │ ├── server_enc.key │ ├── server_sign.crt │ ├── server_sign.key │ ├── test-dot.crt │ ├── test-dot.key │ ├── test2.crt │ ├── test2.key │ ├── vector_logs_ca.crt │ ├── vector_logs_ca.key │ ├── vector_logs_server.crt │ └── vector_logs_server.key ├── chaos │ ├── delayetcd │ │ └── delayetcd.go │ ├── e2e.go │ ├── e2e_test.go │ ├── go.mod │ ├── go.sum │ ├── killetcd │ │ └── killetcd.go │ ├── kubernetes │ │ ├── deployment.yaml │ │ └── service.yaml │ └── utils │ │ ├── Dockerfile │ │ ├── kube_utils.go │ │ ├── setup_chaos_utils.sh │ │ └── utils.go ├── cli │ ├── cli.t │ ├── cli_envsubst_confusion.t │ ├── common.sh │ ├── docker-compose-etcd-cluster.yaml │ ├── test_access_log.sh │ ├── test_admin.sh │ ├── test_admin_mtls.sh │ ├── test_apisix_mirror.sh │ ├── test_ci_only.sh │ ├── test_cmd.sh │ ├── test_control.sh │ ├── test_core_config.sh │ ├── test_deployment_control_plane.sh │ ├── test_deployment_data_plane.sh │ ├── test_deployment_traditional.sh │ ├── test_dns.sh │ ├── test_dubbo.sh │ ├── test_etcd.sh │ ├── test_etcd_healthcheck.sh │ ├── test_etcd_mtls.sh │ ├── test_etcd_sync_event_handle.sh │ ├── test_etcd_tls.sh │ ├── test_http_config.sh │ ├── test_kubernetes.sh │ ├── test_main.sh │ ├── test_makefile.sh │ ├── test_opentelemetry_set_ngx_var.sh │ ├── test_prometheus.sh │ ├── test_prometheus_reload.sh │ ├── test_prometheus_run_in_privileged.sh │ ├── test_prometheus_stream.sh │ ├── test_proxy_mirror_timeout.sh │ ├── test_route_match_with_graphql.sh │ ├── test_serverless.sh │ ├── test_snippet.sh │ ├── test_standalone.sh │ ├── test_status_api.sh │ ├── test_stream_config.sh │ ├── test_tls_over_tcp.sh │ ├── test_upstream_mtls.sh │ ├── test_validate_config.sh │ ├── test_wasm.sh │ └── test_zipkin_set_ngx_var.sh ├── config-center-yaml │ ├── consumer-group.t │ ├── consumer.t │ ├── global-rule.t │ ├── plugin-configs.t │ ├── plugin-metadata.t │ ├── plugin.t │ ├── route-service.t │ ├── route-upstream.t │ ├── route.t │ ├── secret.t │ ├── ssl.t │ └── stream-route.t ├── control │ ├── control-healthcheck-bug-fix.t │ ├── discovery.t │ ├── gc.t │ ├── healthcheck.t │ ├── plugin-api.t │ ├── plugin-metadata.t │ ├── plugins-reload.t │ ├── routes.t │ ├── schema.t │ ├── services.t │ └── upstreams.t ├── core │ ├── config-default.t │ ├── config.t │ ├── config_etcd.t │ ├── config_util.t │ ├── ctx.t │ ├── ctx2.t │ ├── ctx_with_params.t │ ├── env.t │ ├── etcd-auth-fail.t │ ├── etcd-auth.t │ ├── etcd-mtls.t │ ├── etcd-sync.t │ ├── etcd.t │ ├── json.t │ ├── log.t │ ├── lrucache.t │ ├── os.t │ ├── profile.t │ ├── random.t │ ├── request.t │ ├── resolver.t │ ├── response.t │ ├── schema.t │ ├── schema_def.t │ ├── string.t │ ├── table.t │ ├── timer.t │ ├── uid.t │ └── utils.t ├── coredns │ ├── Corefile │ └── db.test.local ├── debug │ ├── debug-mode.t │ ├── dynamic-hook.t │ └── hook.t ├── discovery │ ├── consul.t │ ├── consul2.t │ ├── consul_dump.t │ ├── consul_kv.t │ ├── consul_kv_dump.t │ ├── dns │ │ ├── mix.t │ │ └── sanity.t │ ├── eureka.t │ ├── nacos.t │ ├── nacos2.t │ ├── nacos3.t │ ├── reset-healthchecker.t │ └── stream │ │ ├── consul.t │ │ ├── consul_kv.t │ │ ├── dns.t │ │ ├── eureka.t │ │ └── nacos.t ├── error_page │ └── error_page.t ├── fake-plugin-exit.lua ├── fuzzing │ ├── client_abort.py │ ├── http_upstream.py │ ├── public.py │ ├── requirements.txt │ ├── serverless_route_test.py │ ├── simple_http.py │ ├── simpleroute_test.py │ ├── upstream │ │ └── nginx.conf │ └── vars_route_test.py ├── gm │ └── gm.t ├── grpc_server_example │ ├── echo.pb │ ├── go.mod │ ├── go.sum │ ├── main.go │ ├── proto.pb │ └── proto │ │ ├── echo.pb.go │ │ ├── echo.proto │ │ ├── echo_grpc.pb.go │ │ ├── helloworld.pb.go │ │ ├── helloworld.proto │ │ ├── helloworld_grpc.pb.go │ │ ├── import.pb.go │ │ ├── import.proto │ │ ├── src.pb.go │ │ ├── src.proto │ │ └── src_grpc.pb.go ├── http3 │ └── admin │ │ └── basic.t ├── jest.config.ts ├── kubernetes │ ├── configs │ │ ├── account.yaml │ │ ├── endpoint.yaml │ │ └── kind.yaml │ └── discovery │ │ ├── kubernetes.t │ │ ├── kubernetes2.t │ │ ├── kubernetes3.t │ │ └── stream │ │ └── kubernetes.t ├── lib │ ├── apisix │ │ └── plugins │ │ │ ├── jwt-auth.lua │ │ │ └── prometheus │ │ │ └── exporter.lua │ ├── chaitin_waf_server.lua │ ├── dubbo-backend │ │ ├── dubbo-backend-interface │ │ │ ├── pom.xml │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── apache │ │ │ │ └── dubbo │ │ │ │ └── backend │ │ │ │ └── DemoService.java │ │ ├── dubbo-backend-provider │ │ │ ├── pom.xml │ │ │ └── src │ │ │ │ └── main │ │ │ │ ├── java │ │ │ │ └── org │ │ │ │ │ └── apache │ │ │ │ │ └── dubbo │ │ │ │ │ └── backend │ │ │ │ │ └── provider │ │ │ │ │ ├── DemoServiceImpl.java │ │ │ │ │ └── Provider.java │ │ │ │ └── resources │ │ │ │ ├── META-INF │ │ │ │ └── spring │ │ │ │ │ └── dubbo-demo-provider.xml │ │ │ │ ├── dubbo.properties │ │ │ │ └── log4j.properties │ │ └── pom.xml │ ├── dubbo-serialization-backend │ │ ├── dubbo-serialization-backend-interface │ │ │ ├── pom.xml │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── apache │ │ │ │ └── dubbo │ │ │ │ └── backend │ │ │ │ ├── DubboSerializationTestService.java │ │ │ │ └── PoJo.java │ │ ├── dubbo-serialization-backend-provider │ │ │ ├── pom.xml │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ ├── java │ │ │ │ │ └── org │ │ │ │ │ │ └── apache │ │ │ │ │ │ └── dubbo │ │ │ │ │ │ └── backend │ │ │ │ │ │ └── provider │ │ │ │ │ │ ├── DubboSerializationTestServiceImpl.java │ │ │ │ │ │ └── Provider.java │ │ │ │ │ └── resources │ │ │ │ │ ├── META-INF │ │ │ │ │ └── spring │ │ │ │ │ │ └── dubbo-demo-provider.xml │ │ │ │ │ ├── dubbo.properties │ │ │ │ │ └── log4j.properties │ │ │ └── target │ │ │ │ └── classes │ │ │ │ ├── META-INF │ │ │ │ └── spring │ │ │ │ │ └── dubbo-demo-provider.xml │ │ │ │ ├── dubbo.properties │ │ │ │ └── log4j.properties │ │ └── pom.xml │ ├── etcd.proto │ ├── ext-plugin.lua │ ├── grafana_loki.lua │ ├── keycloak.lua │ ├── keycloak_cas.lua │ ├── mock_layer4.lua │ ├── pubsub.lua │ ├── server.lua │ ├── test_admin.lua │ └── test_inspect.lua ├── misc │ ├── patch.t │ ├── pre-function.t │ └── timers.t ├── node │ ├── chash-balance.t │ ├── chash-hashon.t │ ├── client-mtls-openresty.t │ ├── client-mtls.t │ ├── consumer-group.t │ ├── consumer-plugin.t │ ├── consumer-plugin2.t │ ├── consumer-plugin3.t │ ├── credential-plugin-basic-auth.t │ ├── credential-plugin-incremental-effective.t │ ├── credential-plugin-jwt-auth.t │ ├── credential-plugin-key-auth.t │ ├── credential-plugin-multi-credentials.t │ ├── credential-plugin-set-request-header.t │ ├── credential-plugin-work-with-other-plugin.t │ ├── data_encrypt.t │ ├── data_encrypt2.t │ ├── ewma.t │ ├── filter_func.t │ ├── global-rule.t │ ├── grpc-proxy-mtls.t │ ├── grpc-proxy-stream.t │ ├── grpc-proxy-unary.t │ ├── grpc-proxy.t │ ├── healthcheck-discovery.t │ ├── healthcheck-https.t │ ├── healthcheck-ipv6.t │ ├── healthcheck-leak-bugfix.t │ ├── healthcheck-multiple-worker.t │ ├── healthcheck-passive-resty-events.t │ ├── healthcheck-passive.t │ ├── healthcheck-stop-checker.t │ ├── healthcheck.t │ ├── healthcheck2.t │ ├── healthcheck3.t │ ├── hosts.t │ ├── http_host.t │ ├── https-proxy.t │ ├── invalid-port.t │ ├── invalid-route.t │ ├── invalid-service.t │ ├── invalid-upstream.t │ ├── least_conn.t │ ├── least_conn2.t │ ├── merge-route.t │ ├── not-exist-service.t │ ├── not-exist-upstream.t │ ├── plugin-configs.t │ ├── plugin.t │ ├── plugin1.t │ ├── priority-balancer │ │ ├── health-checker.t │ │ └── sanity.t │ ├── remote-addr-ipv6.t │ ├── remote-addr.t │ ├── remote_addrs.t │ ├── route-delete.t │ ├── route-domain-with-local-dns.t │ ├── route-domain.t │ ├── route-filter-func.t │ ├── route-host.t │ ├── route-status.t │ ├── route-uris.t │ ├── rr-balance.t │ ├── sanity-radixtree.t │ ├── service-empty.t │ ├── ssl-protocols.t │ ├── ssl.t │ ├── timeout-upstream.t │ ├── upstream-array-nodes.t │ ├── upstream-discovery-dynamic.t │ ├── upstream-discovery.t │ ├── upstream-domain-with-special-dns.t │ ├── upstream-domain-with-special-ipv6-dns.t │ ├── upstream-domain.t │ ├── upstream-ipv6.t │ ├── upstream-keepalive-pool.t │ ├── upstream-mtls.t │ ├── upstream-node-dns.t │ ├── upstream-retries.t │ ├── upstream-status-5xx.t │ ├── upstream-status-all.t │ ├── upstream-websocket.t │ ├── upstream.t │ ├── vars.t │ └── wildcard-host.t ├── package.json ├── plugin │ ├── ai-aws-content-moderation-secrets.t │ ├── ai-aws-content-moderation.t │ ├── ai-aws-content-moderation2.t │ ├── ai-prompt-decorator.t │ ├── ai-prompt-guard.t │ ├── ai-prompt-template.t │ ├── ai-proxy-multi.balancer.t │ ├── ai-proxy-multi.openai-compatible.t │ ├── ai-proxy-multi.t │ ├── ai-proxy-multi2.t │ ├── ai-proxy.openai-compatible.t │ ├── ai-proxy.t │ ├── ai-proxy2.t │ ├── ai-rag.t │ ├── ai-rate-limiting.t │ ├── ai-request-rewrite.t │ ├── ai-request-rewrite2.t │ ├── ai.t │ ├── ai2.t │ ├── ai3.t │ ├── ai4.t │ ├── ai5.t │ ├── api-breaker.t │ ├── attach-consumer-label.t │ ├── authz-casbin.t │ ├── authz-casbin │ │ ├── model.conf │ │ └── policy.csv │ ├── authz-casdoor.t │ ├── authz-keycloak.t │ ├── authz-keycloak2.t │ ├── authz-keycloak3.t │ ├── authz-keycloak4.t │ ├── aws-lambda.t │ ├── azure-functions.t │ ├── basic-auth-anonymous-consumer.t │ ├── basic-auth.t │ ├── batch-requests-grpc.t │ ├── batch-requests.t │ ├── batch-requests2.t │ ├── body-transformer-multipart.t │ ├── body-transformer.t │ ├── body-transformer2.t │ ├── brotli.t │ ├── cas-auth.t │ ├── chaitin-waf-reject.t │ ├── chaitin-waf-timeout.t │ ├── chaitin-waf.t │ ├── clickhouse-logger.t │ ├── clickhouse-logger2.t │ ├── client-control.t │ ├── consumer-bug-fix.t │ ├── consumer-restriction.t │ ├── consumer-restriction2.t │ ├── cors.t │ ├── cors2.t │ ├── cors3.t │ ├── cors4.t │ ├── csrf.t │ ├── custom_sort_plugins.t │ ├── datadog.t │ ├── degraphql.t │ ├── dubbo-proxy │ │ ├── route.t │ │ └── upstream.t │ ├── echo.t │ ├── elasticsearch-logger.t │ ├── error-log-logger-clickhouse.t │ ├── error-log-logger-kafka.t │ ├── error-log-logger-skywalking.t │ ├── error-log-logger.t │ ├── example.t │ ├── ext-plugin │ │ ├── conf_token.t │ │ ├── extra-info.t │ │ ├── http-req-call.t │ │ ├── request-body.t │ │ ├── response.t │ │ ├── runner.sh │ │ ├── runner_can_not_terminated.sh │ │ ├── sanity.t │ │ └── sanity2.t │ ├── fault-injection.t │ ├── fault-injection2.t │ ├── file-logger-reopen.t │ ├── file-logger.t │ ├── file-logger2.t │ ├── forward-auth.t │ ├── forward-auth2.t │ ├── google-cloud-logging.t │ ├── google-cloud-logging │ │ ├── config-https-domain.json │ │ ├── config-https-ip.json │ │ └── config.json │ ├── google-cloud-logging2.t │ ├── grpc-transcode-reload-bugfix.t │ ├── grpc-transcode.t │ ├── grpc-transcode2.t │ ├── grpc-transcode3.t │ ├── grpc-web.t │ ├── grpc-web │ │ ├── a6 │ │ │ ├── route.pb.go │ │ │ ├── route.proto │ │ │ ├── route_grpc_web_bin_pb.js │ │ │ ├── route_grpc_web_text_pb.js │ │ │ └── route_pb.js │ │ ├── client.js │ │ ├── go.mod │ │ ├── go.sum │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── req.bin │ │ ├── server.go │ │ └── setup.sh │ ├── gzip.t │ ├── hmac-auth-anonymous-consumer.t │ ├── hmac-auth.t │ ├── hmac-auth2.t │ ├── hmac-auth3.t │ ├── hmac-auth4.t │ ├── http-dubbo.t │ ├── http-logger-json.t │ ├── http-logger-log-format.t │ ├── http-logger-new-line.t │ ├── http-logger.t │ ├── http-logger2.t │ ├── inspect.t │ ├── ip-restriction.t │ ├── jwe-decrypt.t │ ├── jwt-auth-anonymous-consumer.t │ ├── jwt-auth.t │ ├── jwt-auth2.t │ ├── jwt-auth3.t │ ├── jwt-auth4.t │ ├── kafka-logger-large-body.t │ ├── kafka-logger-log-format.t │ ├── kafka-logger.t │ ├── kafka-logger2.t │ ├── kafka-proxy.t │ ├── key-auth-anonymous-consumer.t │ ├── key-auth-upstream-domain-node.t │ ├── key-auth.t │ ├── lago.spec.mts │ ├── lago.t │ ├── ldap-auth.t │ ├── limit-conn-redis-cluster.t │ ├── limit-conn-redis.t │ ├── limit-conn.t │ ├── limit-conn2.t │ ├── limit-conn3.t │ ├── limit-count-redis-cluster.t │ ├── limit-count-redis-cluster2.t │ ├── limit-count-redis-cluster3.t │ ├── limit-count-redis.t │ ├── limit-count-redis2.t │ ├── limit-count-redis3.t │ ├── limit-count-redis4.t │ ├── limit-count.t │ ├── limit-count2.t │ ├── limit-count3.t │ ├── limit-count4.t │ ├── limit-count5.t │ ├── limit-req-redis-cluster.t │ ├── limit-req-redis.t │ ├── limit-req.t │ ├── limit-req2.t │ ├── limit-req3.t │ ├── log-rotate.t │ ├── log-rotate2.t │ ├── log-rotate3.t │ ├── loggly.t │ ├── loki-logger.t │ ├── mcp-bridge.t │ ├── mcp │ │ ├── assets │ │ │ └── bridge-list-tools.json │ │ ├── bridge.spec.ts │ │ ├── jest.config.ts │ │ ├── package.json │ │ ├── pnpm-lock.yaml │ │ └── tsconfig.json │ ├── mocking.t │ ├── multi-auth.t │ ├── multi-auth2.t │ ├── node-status.t │ ├── ocsp-stapling.t │ ├── opa.t │ ├── opa2.t │ ├── openfunction.t │ ├── openid-connect.t │ ├── openid-connect │ │ └── configuration.json │ ├── openid-connect2.t │ ├── openid-connect3.t │ ├── openid-connect4.t │ ├── openid-connect5.t │ ├── openid-connect6.t │ ├── openid-connect7.t │ ├── openid-connect8.t │ ├── opentelemetry.t │ ├── opentelemetry2.t │ ├── opentelemetry3.t │ ├── opentelemetry4-bugfix-pb-state.t │ ├── opentelemetry5.t │ ├── openwhisk.t │ ├── plugin.t │ ├── prometheus-metric-expire.t │ ├── prometheus.t │ ├── prometheus2.t │ ├── prometheus3.t │ ├── prometheus4.t │ ├── proxy-cache │ │ ├── disk.t │ │ └── memory.t │ ├── proxy-control.t │ ├── proxy-mirror.t │ ├── proxy-mirror2.t │ ├── proxy-mirror3.t │ ├── proxy-rewrite.t │ ├── proxy-rewrite2.t │ ├── proxy-rewrite3.t │ ├── public-api.t │ ├── real-ip.t │ ├── redirect.t │ ├── redirect2.t │ ├── referer-restriction.t │ ├── request-id.t │ ├── request-id2.t │ ├── request-validation.t │ ├── request-validation2.t │ ├── response-rewrite.t │ ├── response-rewrite2.t │ ├── response-rewrite3.t │ ├── rocketmq-logger-log-format.t │ ├── rocketmq-logger.t │ ├── rocketmq-logger2.t │ ├── security-warning.t │ ├── security-warning2.t │ ├── server-info.t │ ├── serverless.t │ ├── skywalking-logger.t │ ├── skywalking.t │ ├── sls-logger.t │ ├── splunk-hec-logging.t │ ├── syslog.t │ ├── tcp-logger.t │ ├── tencent-cloud-cls.t │ ├── traffic-split.t │ ├── traffic-split2.t │ ├── traffic-split3.t │ ├── traffic-split4.t │ ├── traffic-split5.t │ ├── ua-restriction.t │ ├── udp-logger.t │ ├── uri-blocker.t │ ├── wolf-rbac.t │ ├── workflow-without-case.t │ ├── workflow.t │ ├── workflow2.t │ ├── zipkin.t │ ├── zipkin2.t │ └── zipkin3.t ├── pnpm-lock.yaml ├── pubsub │ ├── kafka.t │ └── pubsub.t ├── router │ ├── graphql.t │ ├── multi-ssl-certs.t │ ├── radixtree-host-uri-priority.t │ ├── radixtree-host-uri.t │ ├── radixtree-host-uri2.t │ ├── radixtree-host-uri3.t │ ├── radixtree-method.t │ ├── radixtree-sni.t │ ├── radixtree-sni2.t │ ├── radixtree-sni3.t │ ├── radixtree-uri-host.t │ ├── radixtree-uri-keep-end-slash.t │ ├── radixtree-uri-multiple.t │ ├── radixtree-uri-priority.t │ ├── radixtree-uri-sanity.t │ ├── radixtree-uri-vars.t │ ├── radixtree-uri-with-parameter.t │ └── radixtree-uri-with-parameter2.t ├── script │ ├── script.t │ ├── script_distribute.t │ └── script_test.lua ├── secret │ ├── aws.t │ ├── conf │ │ ├── error.json │ │ └── success.json │ ├── gcp.t │ ├── secret_lru.t │ └── vault.t ├── sse_server_example │ ├── go.mod │ └── main.go ├── stream-node │ ├── healthcheck-resty-events.t │ ├── healthcheck-resty-worker-events.t │ ├── mtls.t │ ├── priority-balancer.t │ ├── random.t │ ├── sanity-repeat.t │ ├── sanity-with-service.t │ ├── sanity.t │ ├── sni.t │ ├── tls.t │ ├── upstream-domain.t │ └── upstream-tls.t ├── stream-plugin │ ├── ip-restriction.t │ ├── limit-conn.t │ ├── limit-conn2.t │ ├── mqtt-proxy.t │ ├── mqtt-proxy2.t │ ├── plugin.t │ ├── prometheus.t │ └── syslog.t ├── tars │ ├── conf │ │ └── tars.sql │ └── discovery │ │ ├── stream │ │ └── tars.t │ │ └── tars.t ├── ts │ ├── admin_api.ts │ └── utils.ts ├── tsconfig.esm.json ├── tsconfig.json ├── utils │ ├── batch-processor.t │ └── rfc5424.t ├── wasm │ ├── fault-injection.t │ ├── fault-injection │ │ └── main.go │ ├── forward-auth.go │ ├── forward-auth.t │ ├── global-rule.t │ ├── go.mod │ ├── go.sum │ ├── log │ │ └── main.go │ ├── request-body.t │ ├── request-body │ │ └── main.go │ ├── response-rewrite.t │ ├── response-rewrite │ │ └── main.go │ └── route.t ├── xds-library │ ├── config_xds.t │ ├── config_xds_2.t │ ├── export.go │ ├── main.go │ └── xds.h └── xrpc │ ├── apisix │ └── stream │ │ └── xrpc │ │ └── protocols │ │ └── pingpong │ │ ├── init.lua │ │ └── schema.lua │ ├── dubbo.t │ ├── pingpong.t │ ├── pingpong2.t │ ├── pingpong3.t │ ├── prometheus.t │ ├── redis.t │ └── redis2.t └── utils ├── check-category.py ├── check-lua-code-style.sh ├── check-merge-conflict.sh ├── check-plugins-code.sh ├── check-test-code-style.sh ├── check-version.sh ├── fix-zh-doc-segment.py ├── gen-vote-contents.sh ├── install-dependencies.sh └── linux-install-luarocks.sh /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "APISIX", 3 | "dockerComposeFile": ["docker-compose.yml"], 4 | "service": "apisix", 5 | "workspaceFolder": "/workspace", 6 | "privileged": true, 7 | "postCreateCommand": "bash -c 'cd /workspace && rm -rf test-nginx && git config --global --add safe.directory /workspace && git submodule update --init --recursive && git clone https://github.com/openresty/test-nginx.git --depth 1 --single-branch -b master && make deps'", 8 | "customizations": { 9 | "vscode": { 10 | "extensions": ["ms-vscode.makefile-tools", "ms-azuretools.vscode-docker", "sumneko.lua"] 11 | } 12 | }, 13 | "forwardPorts": [9080, 9180, 2379] 14 | } 15 | -------------------------------------------------------------------------------- /.devcontainer/docker-compose.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | services: 19 | apisix: 20 | build: 21 | context: .. 22 | dockerfile: .devcontainer/Dockerfile 23 | command: sleep infinity 24 | volumes: 25 | - ..:/workspace:cached 26 | network_mode: service:etcd 27 | etcd: 28 | image: bitnami/etcd:3.5 29 | volumes: 30 | - etcd_data:/bitnami/etcd 31 | environment: 32 | ALLOW_NONE_AUTHENTICATION: "yes" 33 | ETCD_ADVERTISE_CLIENT_URLS: "http://127.0.0.1:2379" 34 | ETCD_LISTEN_CLIENT_URLS: "http://0.0.0.0:2379" 35 | 36 | volumes: 37 | etcd_data: 38 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | root = true 19 | 20 | [*] 21 | charset = utf-8 22 | end_of_line = lf 23 | indent_style = space 24 | insert_final_newline = true 25 | trim_trailing_whitespace = true 26 | 27 | [.gitmodules] 28 | indent_style = tab 29 | 30 | [Makefile] 31 | indent_style = tab 32 | 33 | [*.{yml,yaml}] 34 | indent_size = 2 35 | 36 | [*.go] 37 | indent_style = tab 38 | ## ignore ASF license 39 | block_comment_start = /* 40 | block_comment = * 41 | block_comment_end = */ 42 | 43 | [**go.mod] 44 | indent_style = tab 45 | 46 | [t/coredns/db.test.local] 47 | indent_style = unset 48 | 49 | [*.pb] 50 | indent_style = unset 51 | insert_final_newline = unset 52 | trim_trailing_whitespace = unset 53 | end_of_line = unset 54 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | t/**/*.t linguist-vendored 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: APISIX Discussion Forum 4 | url: https://github.com/apache/apisix/discussions 5 | about: Please ask and answer questions here. 6 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.yml: -------------------------------------------------------------------------------- 1 | name: "Feature Request" 2 | description: Suggest an enhancement to APISIX. 3 | title: "feat: As a user, I want to ..., so that ..." 4 | body: 5 | - type: markdown 6 | attributes: 7 | value: | 8 | _The more information you share, the faster we can help you._ 9 | 10 | Prior to opening the issue, please make sure that you: 11 | 12 | - Use English to communicate. 13 | - Search the [open issues](https://github.com/apache/apisix/issues) and [discussion forum](https://github.com/apache/apisix/discussions) to avoid duplicating the issue. 14 | 15 | - type: textarea 16 | id: description 17 | attributes: 18 | label: Description 19 | description: Describe the feature you would like to see. 20 | placeholder: | 21 | As a user, I want to ..., so that... 22 | validations: 23 | required: true 24 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/improve_docs.yml: -------------------------------------------------------------------------------- 1 | name: "Documentation Issue" 2 | description: Issues related to documentation. 3 | title: "docs: " 4 | labels: [doc] 5 | body: 6 | - type: markdown 7 | attributes: 8 | value: | 9 | _The more information you share, the faster we can help you._ 10 | 11 | Prior to opening the issue, please make sure that you: 12 | 13 | - Use English to communicate. 14 | - Search the [open issues](https://github.com/apache/apisix/issues) and [discussion forum](https://github.com/apache/apisix/discussions) to avoid duplicating the issue. 15 | 16 | - type: textarea 17 | id: current-state 18 | attributes: 19 | label: Current State 20 | description: Describe the current state of the documentation. 21 | placeholder: | 22 | The documentation for the API in this page (url) is missing ... 23 | validations: 24 | required: true 25 | - type: textarea 26 | id: desired-state 27 | attributes: 28 | label: Desired State 29 | description: Describe the desired state the documentation should be in. 30 | placeholder: | 31 | There should be line mentioning how the API behaves when ... 32 | validations: 33 | required: true 34 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/request_help.yml: -------------------------------------------------------------------------------- 1 | name: "Request Help" 2 | description: Stuck? Ask for help! 3 | title: "help request: " 4 | body: 5 | - type: markdown 6 | attributes: 7 | value: | 8 | _The more information you share, the faster we can help you._ 9 | 10 | Prior to opening the issue, please make sure that you: 11 | 12 | - Use English to communicate. 13 | - Search the [open issues](https://github.com/apache/apisix/issues) and [discussion forum](https://github.com/apache/apisix/discussions) to avoid duplicating the issue. 14 | 15 | - type: textarea 16 | id: description 17 | attributes: 18 | label: Description 19 | description: Describe the issue you are facing and what you need help with. 20 | validations: 21 | required: true 22 | - type: textarea 23 | id: environment 24 | attributes: 25 | label: Environment 26 | description: Share your environment details. Reports without proper environment details will likely be closed. 27 | value: | 28 | - APISIX version (run `apisix version`): 29 | - Operating system (run `uname -a`): 30 | - OpenResty / Nginx version (run `openresty -V` or `nginx -V`): 31 | - etcd version, if relevant (run `curl http://127.0.0.1:9090/v1/server_info`): 32 | - APISIX Dashboard version, if relevant: 33 | - Plugin runner version, for issues related to plugin runners: 34 | - LuaRocks version, for installation issues (run `luarocks --version`): 35 | validations: 36 | required: true 37 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ### Description 2 | 3 | 4 | 5 | 6 | #### Which issue(s) this PR fixes: 7 | 11 | Fixes # 12 | 13 | ### Checklist 14 | 15 | - [ ] I have explained the need for this PR and the problem it solves 16 | - [ ] I have explained the changes or the new features added to this PR 17 | - [ ] I have added tests corresponding to this change 18 | - [ ] I have updated the documentation to reflect this change 19 | - [ ] I have verified that this change is backward compatible (If not, please discuss on the [APISIX mailing list](https://github.com/apache/apisix/tree/master#community) first) 20 | 21 | 34 | -------------------------------------------------------------------------------- /.github/actions/.editorconfig: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | # ignore third-party actions 19 | root = true 20 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # Set update schedule for GitHub Actions 2 | 3 | version: 2 4 | updates: 5 | 6 | - package-ecosystem: "github-actions" 7 | directory: "/" 8 | schedule: 9 | # Check for updates to GitHub Actions every weekday 10 | interval: "daily" 11 | -------------------------------------------------------------------------------- /.github/workflows/close-unresponded.yml: -------------------------------------------------------------------------------- 1 | name: Check Issues 2 | 3 | on: 4 | workflow_dispatch: 5 | schedule: 6 | - cron: '0 10 * * *' 7 | 8 | permissions: 9 | contents: read 10 | 11 | jobs: 12 | prune_stale: 13 | permissions: 14 | issues: write # for actions/stale to close stale issues 15 | name: Prune Unresponded 16 | runs-on: ubuntu-latest 17 | timeout-minutes: 10 18 | 19 | steps: 20 | - name: Prune Stale 21 | uses: actions/stale@v8 22 | with: 23 | days-before-issue-stale: 60 24 | days-before-issue-close: 3 25 | stale-issue-message: > 26 | Due to lack of the reporter's response this issue has been labeled with "no response". 27 | It will be close in 3 days if no further activity occurs. If this issue is still 28 | relevant, please simply write any comment. Even if closed, you can still revive the 29 | issue at any time or discuss it on the dev@apisix.apache.org list. 30 | Thank you for your contributions. 31 | close-issue-message: > 32 | This issue has been closed due to lack of activity. If you think that 33 | is incorrect, or the issue requires additional review, you can revive the issue at 34 | any time. 35 | # Issues with these labels will never be considered stale. 36 | only-labels: 'wait for update' 37 | stale-issue-label: 'no response' 38 | exempt-issue-labels: "don't close" 39 | ascending: true 40 | -------------------------------------------------------------------------------- /.github/workflows/code-lint.yml: -------------------------------------------------------------------------------- 1 | name: Code Lint 2 | 3 | on: 4 | pull_request: 5 | branches: [master, 'release/**'] 6 | paths-ignore: 7 | - 'docs/**' 8 | - '**/*.md' 9 | 10 | permissions: 11 | contents: read 12 | 13 | jobs: 14 | lint: 15 | runs-on: ubuntu-latest 16 | timeout-minutes: 10 17 | steps: 18 | - uses: actions/checkout@v4 19 | - name: Install 20 | run: | 21 | . ./ci/common.sh 22 | export_or_prefix 23 | export OPENRESTY_VERSION=default 24 | 25 | sudo -E ./ci/linux-install-openresty.sh 26 | ./utils/linux-install-luarocks.sh 27 | sudo -E luarocks install luacheck 28 | 29 | - name: Script 30 | run: | 31 | . ./ci/common.sh 32 | export_or_prefix 33 | make lint 34 | 35 | sc-lint: 36 | runs-on: ubuntu-latest 37 | timeout-minutes: 5 38 | steps: 39 | - name: Checkout code 40 | uses: actions/checkout@v4 41 | 42 | - name: Shellcheck code 43 | run: | 44 | scversion="latest" 45 | wget -qO- "https://github.com/koalaman/shellcheck/releases/download/${scversion?}/shellcheck-${scversion?}.linux.x86_64.tar.xz" | tar -xJv 46 | cp -av "shellcheck-${scversion}/shellcheck" /usr/local/bin/ 47 | shellcheck --version 48 | git ls-files -- "*.sh" | xargs -t shellcheck 49 | -------------------------------------------------------------------------------- /.github/workflows/license-checker.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one 3 | # or more contributor license agreements. See the NOTICE file 4 | # distributed with this work for additional information 5 | # regarding copyright ownership. The ASF licenses this file 6 | # to you under the Apache License, Version 2.0 (the 7 | # "License"); you may not use this file except in compliance 8 | # with the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, 13 | # software distributed under the License is distributed on an 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # KIND, either express or implied. See the License for the 16 | # specific language governing permissions and limitations 17 | # under the License. 18 | # 19 | name: License checker 20 | 21 | on: 22 | push: 23 | branches: [master, 'release/**'] 24 | pull_request: 25 | branches: [master, 'release/**'] 26 | 27 | jobs: 28 | check-license: 29 | runs-on: ubuntu-latest 30 | timeout-minutes: 3 31 | 32 | steps: 33 | - uses: actions/checkout@v4 34 | - name: Check License Header 35 | uses: apache/skywalking-eyes@v0.6.0 36 | env: 37 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 38 | -------------------------------------------------------------------------------- /.github/workflows/lint.yml: -------------------------------------------------------------------------------- 1 | name: ❄️ Lint 2 | 3 | on: [push, pull_request] 4 | 5 | permissions: 6 | contents: read 7 | 8 | jobs: 9 | misc: 10 | name: misc checker 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Check out code. 14 | uses: actions/checkout@v4 15 | - name: spell check 16 | run: | 17 | pip install codespell==2.1.0 18 | # codespell considers some repo name in go.sum are misspelled 19 | git grep --cached -l '' | grep -v go.sum | grep -v pnpm-lock.yaml |xargs codespell --ignore-words=.ignore_words --skip="*.ts,*.mts" 20 | - name: Merge conflict 21 | run: | 22 | bash ./utils/check-merge-conflict.sh 23 | - name: Plugin Code 24 | run: | 25 | bash ./utils/check-plugins-code.sh 26 | 27 | ci-eclint: 28 | runs-on: ubuntu-latest 29 | timeout-minutes: 5 30 | 31 | steps: 32 | - name: Check out code 33 | uses: actions/checkout@v4 34 | 35 | - name: Setup Nodejs env 36 | uses: actions/setup-node@v4.0.2 37 | with: 38 | node-version: '12' 39 | 40 | - name: Install eclint 41 | run: | 42 | sudo npm install -g eclint 43 | 44 | - name: Run eclint 45 | run: | 46 | eclint check 47 | -------------------------------------------------------------------------------- /.github/workflows/semantic.yml: -------------------------------------------------------------------------------- 1 | name: "PR Lint" 2 | 3 | on: 4 | pull_request_target: 5 | types: 6 | - opened 7 | - edited 8 | - synchronize 9 | 10 | jobs: 11 | main: 12 | name: Validate PR title 13 | runs-on: ubuntu-latest 14 | steps: 15 | - name: Check out repository code 16 | uses: actions/checkout@v4 17 | with: 18 | submodules: recursive 19 | - uses: ./.github/actions/action-semantic-pull-request 20 | env: 21 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 22 | with: 23 | types: | 24 | feat 25 | fix 26 | docs 27 | style 28 | refactor 29 | perf 30 | test 31 | build 32 | ci 33 | chore 34 | revert 35 | change 36 | -------------------------------------------------------------------------------- /.github/workflows/tars-ci.yml: -------------------------------------------------------------------------------- 1 | name: CI Tars 2 | 3 | on: 4 | push: 5 | branches: [ master, 'release/**' ] 6 | paths-ignore: 7 | - 'docs/**' 8 | - '**/*.md' 9 | pull_request: 10 | branches: [ master, 'release/**' ] 11 | paths-ignore: 12 | - 'docs/**' 13 | - '**/*.md' 14 | 15 | concurrency: 16 | group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.run_number || github.ref }} 17 | cancel-in-progress: true 18 | 19 | permissions: 20 | contents: read 21 | 22 | jobs: 23 | tars: 24 | strategy: 25 | fail-fast: false 26 | matrix: 27 | platform: 28 | - ubuntu-latest 29 | os_name: 30 | - linux_openresty 31 | 32 | runs-on: ${{ matrix.platform }} 33 | timeout-minutes: 15 34 | env: 35 | SERVER_NAME: ${{ matrix.os_name }} 36 | OPENRESTY_VERSION: default 37 | 38 | steps: 39 | - name: Check out code 40 | uses: actions/checkout@v4 41 | with: 42 | submodules: recursive 43 | 44 | - name: Setup Tars MySql 45 | run: | 46 | docker run -d -p 3306:3306 -v $PWD/t/tars/conf/tars.sql:/docker-entrypoint-initdb.d/tars.sql -e MYSQL_ROOT_PASSWORD=tars2022 mysql:5.7 47 | 48 | - name: Linux Install 49 | run: | 50 | sudo ./ci/${{ matrix.os_name }}_runner.sh before_install 51 | sudo --preserve-env=OPENRESTY_VERSION ./ci/${{ matrix.os_name }}_runner.sh do_install 52 | 53 | - name: Run test cases 54 | run: | 55 | ./ci/tars-ci.sh run_case 56 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Lua sources 2 | luac.out 3 | 4 | # luarocks build files 5 | *.src.rock 6 | *.zip 7 | *.tar.gz 8 | 9 | # Object files 10 | *.o 11 | *.os 12 | *.ko 13 | *.obj 14 | *.elf 15 | 16 | # Precompiled Headers 17 | *.gch 18 | *.pch 19 | 20 | # Libraries 21 | *.lib 22 | *.a 23 | *.la 24 | *.lo 25 | *.def 26 | *.exp 27 | 28 | # Shared objects (inc. Windows DLLs) 29 | *.dll 30 | *.so 31 | *.so.* 32 | *.dylib 33 | 34 | # Executables 35 | *.exe 36 | *.out 37 | *.app 38 | *.i*86 39 | *.x86_64 40 | *.hex 41 | 42 | # develop 43 | *.log 44 | *.pid 45 | *.orig 46 | *.rej 47 | t/servroot 48 | t/certs/*.csr 49 | t/certs/*.srl 50 | t/xds-library/libxds.h 51 | conf/apisix.uid 52 | conf/nginx.conf 53 | deps 54 | scgi_temp 55 | uwsgi_temp 56 | proxy_temp 57 | fastcgi_temp 58 | client_body_temp 59 | utils/lj-releng 60 | utils/reindex 61 | *.etcd/ 62 | t/lib/dubbo*/**/target/ 63 | .idea/ 64 | *.iml 65 | \.* 66 | !.github/ 67 | !.devcontainer/ 68 | !.gitmodules 69 | !.markdownlint.yml 70 | !.licenserc.yaml 71 | !.ignore_words 72 | conf/apisix.yaml 73 | conf/apisix-*.yaml 74 | conf/config-*.yaml 75 | !conf/config-default.yaml 76 | conf/debug-*.yaml 77 | build-cache/ 78 | t/fuzzing/__pycache__/ 79 | boofuzz-results/ 80 | *.pyc 81 | *.wasm 82 | t/grpc_server_example/grpc_server_example 83 | t/plugin/grpc-web/grpc-web-server 84 | t/plugin/grpc-web/node_modules/ 85 | pack 86 | pack-v*-linux.tgz* 87 | 88 | # release tar package 89 | *.tgz 90 | release/* 91 | 92 | 93 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "t/toolkit"] 2 | path = t/toolkit 3 | url = https://github.com/api7/test-toolkit.git 4 | [submodule ".github/actions/action-semantic-pull-request"] 5 | path = .github/actions/action-semantic-pull-request 6 | url = https://github.com/amannn/action-semantic-pull-request.git 7 | [submodule ".github/actions/autocorrect"] 8 | path = .github/actions/autocorrect 9 | url = https://github.com/huacnlee/autocorrect.git 10 | -------------------------------------------------------------------------------- /.ignore_words: -------------------------------------------------------------------------------- 1 | iam 2 | te 3 | ba 4 | ue 5 | shttp 6 | nd 7 | hel 8 | nulll 9 | smove 10 | aks 11 | nin 12 | -------------------------------------------------------------------------------- /.luacheckrc: -------------------------------------------------------------------------------- 1 | std = "ngx_lua" 2 | unused_args = false 3 | redefined = false 4 | max_line_length = 100 5 | exclude_files = { 6 | "apisix/cli/ngx_tpl.lua", 7 | } 8 | -------------------------------------------------------------------------------- /.markdownlint.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | MD001: false 19 | MD004: false 20 | MD005: false 21 | MD006: false 22 | MD007: false 23 | MD010: false 24 | MD013: false 25 | MD014: false 26 | MD024: false 27 | MD026: false 28 | MD029: false 29 | MD033: false 30 | MD034: false 31 | MD036: false 32 | MD040: false 33 | MD041: false 34 | MD046: false 35 | -------------------------------------------------------------------------------- /.requirements: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | APISIX_PACKAGE_NAME=apisix 19 | 20 | APISIX_RUNTIME=1.3.0 21 | -------------------------------------------------------------------------------- /.shellcheckrc: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | # wiki link pattern https://github.com/koalaman/shellcheck/wiki/{code} 19 | # like SC2148, links to https://github.com/koalaman/shellcheck/wiki/SC2148 20 | 21 | disable=SC1083,SC1091 22 | disable=SC2002,SC2004,SC2006,SC2009,SC2010,SC2016,SC2024,SC2027,SC2034,SC2046,SC2048,SC2059 23 | disable=SC2068,SC2076,SC2086,SC2089,SC2090 24 | disable=SC2103,SC2126,SC2143,SC2148,SC2155,SC2157,SC2164,SC2181 25 | disable=SC2215,SC2216,SC2251,SC2260,SC3037 26 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | Apache APISIX 2 | Copyright 2019-2025 The Apache Software Foundation 3 | 4 | This product includes software developed at 5 | The Apache Software Foundation (http://www.apache.org/). 6 | -------------------------------------------------------------------------------- /apisix/admin/global_rules.lua: -------------------------------------------------------------------------------- 1 | -- 2 | -- Licensed to the Apache Software Foundation (ASF) under one or more 3 | -- contributor license agreements. See the NOTICE file distributed with 4 | -- this work for additional information regarding copyright ownership. 5 | -- The ASF licenses this file to You under the Apache License, Version 2.0 6 | -- (the "License"); you may not use this file except in compliance with 7 | -- the License. You may obtain a copy of the License at 8 | -- 9 | -- http://www.apache.org/licenses/LICENSE-2.0 10 | -- 11 | -- Unless required by applicable law or agreed to in writing, software 12 | -- distributed under the License is distributed on an "AS IS" BASIS, 13 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | -- See the License for the specific language governing permissions and 15 | -- limitations under the License. 16 | -- 17 | local core = require("apisix.core") 18 | local resource = require("apisix.admin.resource") 19 | local schema_plugin = require("apisix.admin.plugins").check_schema 20 | 21 | 22 | local function check_conf(id, conf, need_id, schema) 23 | local ok, err = core.schema.check(schema, conf) 24 | if not ok then 25 | return nil, {error_msg = "invalid configuration: " .. err} 26 | end 27 | 28 | local ok, err = schema_plugin(conf.plugins) 29 | if not ok then 30 | return nil, {error_msg = err} 31 | end 32 | 33 | return true 34 | end 35 | 36 | 37 | return resource.new({ 38 | name = "global_rules", 39 | kind = "global rule", 40 | schema = core.schema.global_rule, 41 | checker = check_conf, 42 | unsupported_methods = {"post"} 43 | }) 44 | -------------------------------------------------------------------------------- /apisix/admin/schema.lua: -------------------------------------------------------------------------------- 1 | -- 2 | -- Licensed to the Apache Software Foundation (ASF) under one or more 3 | -- contributor license agreements. See the NOTICE file distributed with 4 | -- this work for additional information regarding copyright ownership. 5 | -- The ASF licenses this file to You under the Apache License, Version 2.0 6 | -- (the "License"); you may not use this file except in compliance with 7 | -- the License. You may obtain a copy of the License at 8 | -- 9 | -- http://www.apache.org/licenses/LICENSE-2.0 10 | -- 11 | -- Unless required by applicable law or agreed to in writing, software 12 | -- distributed under the License is distributed on an "AS IS" BASIS, 13 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | -- See the License for the specific language governing permissions and 15 | -- limitations under the License. 16 | -- 17 | local core = require("apisix.core") 18 | 19 | local _M = { 20 | version = 0.1, 21 | } 22 | 23 | 24 | function _M.get(name) 25 | local json_schema = core.schema[name] 26 | core.log.info("schema: ", core.json.delay_encode(core.schema, true)) 27 | if not json_schema then 28 | return 400, {error_msg = "not found schema: " .. name} 29 | end 30 | 31 | return 200, json_schema 32 | end 33 | 34 | 35 | return _M 36 | -------------------------------------------------------------------------------- /apisix/admin/secrets.lua: -------------------------------------------------------------------------------- 1 | -- 2 | -- Licensed to the Apache Software Foundation (ASF) under one or more 3 | -- contributor license agreements. See the NOTICE file distributed with 4 | -- this work for additional information regarding copyright ownership. 5 | -- The ASF licenses this file to You under the Apache License, Version 2.0 6 | -- (the "License"); you may not use this file except in compliance with 7 | -- the License. You may obtain a copy of the License at 8 | -- 9 | -- http://www.apache.org/licenses/LICENSE-2.0 10 | -- 11 | -- Unless required by applicable law or agreed to in writing, software 12 | -- distributed under the License is distributed on an "AS IS" BASIS, 13 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | -- See the License for the specific language governing permissions and 15 | -- limitations under the License. 16 | -- 17 | local require = require 18 | 19 | local core = require("apisix.core") 20 | local resource = require("apisix.admin.resource") 21 | 22 | local pcall = pcall 23 | 24 | 25 | local function check_conf(id, conf, need_id, schema, typ) 26 | local ok, secret_manager = pcall(require, "apisix.secret." .. typ) 27 | if not ok then 28 | return false, {error_msg = "invalid secret manager: " .. typ} 29 | end 30 | 31 | local ok, err = core.schema.check(secret_manager.schema, conf) 32 | if not ok then 33 | return nil, {error_msg = "invalid configuration: " .. err} 34 | end 35 | 36 | return true 37 | end 38 | 39 | 40 | return resource.new({ 41 | name = "secrets", 42 | kind = "secret", 43 | checker = check_conf, 44 | unsupported_methods = {"post"} 45 | }) 46 | -------------------------------------------------------------------------------- /apisix/admin/ssl.lua: -------------------------------------------------------------------------------- 1 | -- 2 | -- Licensed to the Apache Software Foundation (ASF) under one or more 3 | -- contributor license agreements. See the NOTICE file distributed with 4 | -- this work for additional information regarding copyright ownership. 5 | -- The ASF licenses this file to You under the Apache License, Version 2.0 6 | -- (the "License"); you may not use this file except in compliance with 7 | -- the License. You may obtain a copy of the License at 8 | -- 9 | -- http://www.apache.org/licenses/LICENSE-2.0 10 | -- 11 | -- Unless required by applicable law or agreed to in writing, software 12 | -- distributed under the License is distributed on an "AS IS" BASIS, 13 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | -- See the License for the specific language governing permissions and 15 | -- limitations under the License. 16 | -- 17 | local core = require("apisix.core") 18 | local resource = require("apisix.admin.resource") 19 | local apisix_ssl = require("apisix.ssl") 20 | 21 | 22 | local function check_conf(id, conf, need_id, schema) 23 | local ok, err = apisix_ssl.check_ssl_conf(false, conf) 24 | if not ok then 25 | return nil, {error_msg = err} 26 | end 27 | 28 | return need_id and id or true 29 | end 30 | 31 | 32 | return resource.new({ 33 | name = "ssls", 34 | kind = "ssl", 35 | schema = core.schema.ssl, 36 | checker = check_conf 37 | }) 38 | -------------------------------------------------------------------------------- /apisix/core/event.lua: -------------------------------------------------------------------------------- 1 | -- 2 | -- Licensed to the Apache Software Foundation (ASF) under one or more 3 | -- contributor license agreements. See the NOTICE file distributed with 4 | -- this work for additional information regarding copyright ownership. 5 | -- The ASF licenses this file to You under the Apache License, Version 2.0 6 | -- (the "License"); you may not use this file except in compliance with 7 | -- the License. You may obtain a copy of the License at 8 | -- 9 | -- http://www.apache.org/licenses/LICENSE-2.0 10 | -- 11 | -- Unless required by applicable law or agreed to in writing, software 12 | -- distributed under the License is distributed on an "AS IS" BASIS, 13 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | -- See the License for the specific language governing permissions and 15 | -- limitations under the License. 16 | -- 17 | 18 | local CONST = { 19 | BUILD_ROUTER = 1, 20 | } 21 | 22 | local _M = { 23 | CONST = CONST, 24 | } 25 | 26 | local events = {} 27 | 28 | 29 | function _M.push(type, ...) 30 | local handler = events[type] 31 | if handler then 32 | handler(...) 33 | end 34 | end 35 | 36 | function _M.register(type, handler) 37 | -- TODO: we can register more than one handler 38 | events[type] = handler 39 | end 40 | 41 | function _M.unregister(type) 42 | events[type] = nil 43 | end 44 | 45 | return _M 46 | -------------------------------------------------------------------------------- /apisix/core/math.lua: -------------------------------------------------------------------------------- 1 | -- 2 | -- Licensed to the Apache Software Foundation (ASF) under one or more 3 | -- contributor license agreements. See the NOTICE file distributed with 4 | -- this work for additional information regarding copyright ownership. 5 | -- The ASF licenses this file to You under the Apache License, Version 2.0 6 | -- (the "License"); you may not use this file except in compliance with 7 | -- the License. You may obtain a copy of the License at 8 | -- 9 | -- http://www.apache.org/licenses/LICENSE-2.0 10 | -- 11 | -- Unless required by applicable law or agreed to in writing, software 12 | -- distributed under the License is distributed on an "AS IS" BASIS, 13 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | -- See the License for the specific language governing permissions and 15 | -- limitations under the License. 16 | -- 17 | 18 | --- Common library about math 19 | -- 20 | -- @module core.math 21 | local _M = {} 22 | 23 | 24 | --- 25 | -- Calculate the greatest common divisor (GCD) of two numbers 26 | -- 27 | -- @function core.math.gcd 28 | -- @tparam number a 29 | -- @tparam number b 30 | -- @treturn number the GCD of a and b 31 | local function gcd(a, b) 32 | if b == 0 then 33 | return a 34 | end 35 | 36 | return gcd(b, a % b) 37 | end 38 | _M.gcd = gcd 39 | 40 | 41 | return _M 42 | -------------------------------------------------------------------------------- /apisix/core/version.lua: -------------------------------------------------------------------------------- 1 | -- 2 | -- Licensed to the Apache Software Foundation (ASF) under one or more 3 | -- contributor license agreements. See the NOTICE file distributed with 4 | -- this work for additional information regarding copyright ownership. 5 | -- The ASF licenses this file to You under the Apache License, Version 2.0 6 | -- (the "License"); you may not use this file except in compliance with 7 | -- the License. You may obtain a copy of the License at 8 | -- 9 | -- http://www.apache.org/licenses/LICENSE-2.0 10 | -- 11 | -- Unless required by applicable law or agreed to in writing, software 12 | -- distributed under the License is distributed on an "AS IS" BASIS, 13 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | -- See the License for the specific language governing permissions and 15 | -- limitations under the License. 16 | -- 17 | 18 | --- Return APISIX current version. 19 | -- 20 | -- @module core.version 21 | 22 | return { 23 | VERSION = "3.12.0" 24 | } 25 | -------------------------------------------------------------------------------- /apisix/plugins/ai-drivers/deepseek.lua: -------------------------------------------------------------------------------- 1 | -- 2 | -- Licensed to the Apache Software Foundation (ASF) under one or more 3 | -- contributor license agreements. See the NOTICE file distributed with 4 | -- this work for additional information regarding copyright ownership. 5 | -- The ASF licenses this file to You under the Apache License, Version 2.0 6 | -- (the "License"); you may not use this file except in compliance with 7 | -- the License. You may obtain a copy of the License at 8 | -- 9 | -- http://www.apache.org/licenses/LICENSE-2.0 10 | -- 11 | -- Unless required by applicable law or agreed to in writing, software 12 | -- distributed under the License is distributed on an "AS IS" BASIS, 13 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | -- See the License for the specific language governing permissions and 15 | -- limitations under the License. 16 | -- 17 | 18 | return require("apisix.plugins.ai-drivers.openai-base").new( 19 | { 20 | host = "api.deepseek.com", 21 | path = "/chat/completions", 22 | port = 443 23 | } 24 | ) 25 | -------------------------------------------------------------------------------- /apisix/plugins/ai-drivers/openai-compatible.lua: -------------------------------------------------------------------------------- 1 | -- 2 | -- Licensed to the Apache Software Foundation (ASF) under one or more 3 | -- contributor license agreements. See the NOTICE file distributed with 4 | -- this work for additional information regarding copyright ownership. 5 | -- The ASF licenses this file to You under the Apache License, Version 2.0 6 | -- (the "License"); you may not use this file except in compliance with 7 | -- the License. You may obtain a copy of the License at 8 | -- 9 | -- http://www.apache.org/licenses/LICENSE-2.0 10 | -- 11 | -- Unless required by applicable law or agreed to in writing, software 12 | -- distributed under the License is distributed on an "AS IS" BASIS, 13 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | -- See the License for the specific language governing permissions and 15 | -- limitations under the License. 16 | -- 17 | 18 | return require("apisix.plugins.ai-drivers.openai-base").new({}) 19 | -------------------------------------------------------------------------------- /apisix/plugins/ai-drivers/openai.lua: -------------------------------------------------------------------------------- 1 | -- 2 | -- Licensed to the Apache Software Foundation (ASF) under one or more 3 | -- contributor license agreements. See the NOTICE file distributed with 4 | -- this work for additional information regarding copyright ownership. 5 | -- The ASF licenses this file to You under the Apache License, Version 2.0 6 | -- (the "License"); you may not use this file except in compliance with 7 | -- the License. You may obtain a copy of the License at 8 | -- 9 | -- http://www.apache.org/licenses/LICENSE-2.0 10 | -- 11 | -- Unless required by applicable law or agreed to in writing, software 12 | -- distributed under the License is distributed on an "AS IS" BASIS, 13 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | -- See the License for the specific language governing permissions and 15 | -- limitations under the License. 16 | -- 17 | 18 | return require("apisix.plugins.ai-drivers.openai-base").new( 19 | { 20 | host = "api.openai.com", 21 | path = "/v1/chat/completions", 22 | port = 443 23 | } 24 | ) 25 | -------------------------------------------------------------------------------- /apisix/plugins/ext-plugin-post-req.lua: -------------------------------------------------------------------------------- 1 | -- 2 | -- Licensed to the Apache Software Foundation (ASF) under one or more 3 | -- contributor license agreements. See the NOTICE file distributed with 4 | -- this work for additional information regarding copyright ownership. 5 | -- The ASF licenses this file to You under the Apache License, Version 2.0 6 | -- (the "License"); you may not use this file except in compliance with 7 | -- the License. You may obtain a copy of the License at 8 | -- 9 | -- http://www.apache.org/licenses/LICENSE-2.0 10 | -- 11 | -- Unless required by applicable law or agreed to in writing, software 12 | -- distributed under the License is distributed on an "AS IS" BASIS, 13 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | -- See the License for the specific language governing permissions and 15 | -- limitations under the License. 16 | -- 17 | local core = require("apisix.core") 18 | local ext = require("apisix.plugins.ext-plugin.init") 19 | 20 | 21 | local name = "ext-plugin-post-req" 22 | local _M = { 23 | version = 0.1, 24 | priority = -3000, 25 | name = name, 26 | schema = ext.schema, 27 | } 28 | 29 | 30 | function _M.check_schema(conf) 31 | return core.schema.check(_M.schema, conf) 32 | end 33 | 34 | 35 | function _M.access(conf, ctx) 36 | return ext.communicate(conf, ctx, name) 37 | end 38 | 39 | 40 | return _M 41 | -------------------------------------------------------------------------------- /apisix/plugins/ext-plugin-pre-req.lua: -------------------------------------------------------------------------------- 1 | -- 2 | -- Licensed to the Apache Software Foundation (ASF) under one or more 3 | -- contributor license agreements. See the NOTICE file distributed with 4 | -- this work for additional information regarding copyright ownership. 5 | -- The ASF licenses this file to You under the Apache License, Version 2.0 6 | -- (the "License"); you may not use this file except in compliance with 7 | -- the License. You may obtain a copy of the License at 8 | -- 9 | -- http://www.apache.org/licenses/LICENSE-2.0 10 | -- 11 | -- Unless required by applicable law or agreed to in writing, software 12 | -- distributed under the License is distributed on an "AS IS" BASIS, 13 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | -- See the License for the specific language governing permissions and 15 | -- limitations under the License. 16 | -- 17 | local core = require("apisix.core") 18 | local ext = require("apisix.plugins.ext-plugin.init") 19 | 20 | 21 | local name = "ext-plugin-pre-req" 22 | local _M = { 23 | version = 0.1, 24 | priority = 12000, 25 | name = name, 26 | schema = ext.schema, 27 | } 28 | 29 | 30 | function _M.check_schema(conf) 31 | return core.schema.check(_M.schema, conf) 32 | end 33 | 34 | 35 | function _M.rewrite(conf, ctx) 36 | return ext.communicate(conf, ctx, name) 37 | end 38 | 39 | 40 | return _M 41 | -------------------------------------------------------------------------------- /apisix/plugins/ip-restriction.lua: -------------------------------------------------------------------------------- 1 | -- 2 | -- Licensed to the Apache Software Foundation (ASF) under one or more 3 | -- contributor license agreements. See the NOTICE file distributed with 4 | -- this work for additional information regarding copyright ownership. 5 | -- The ASF licenses this file to You under the Apache License, Version 2.0 6 | -- (the "License"); you may not use this file except in compliance with 7 | -- the License. You may obtain a copy of the License at 8 | -- 9 | -- http://www.apache.org/licenses/LICENSE-2.0 10 | -- 11 | -- Unless required by applicable law or agreed to in writing, software 12 | -- distributed under the License is distributed on an "AS IS" BASIS, 13 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | -- See the License for the specific language governing permissions and 15 | -- limitations under the License. 16 | -- 17 | local core = require("apisix.core") 18 | local base = require("apisix.plugins.ip-restriction.init") 19 | 20 | 21 | -- avoid unexpected data sharing 22 | local ip_restriction = core.table.clone(base) 23 | ip_restriction.access = base.restrict 24 | 25 | 26 | return ip_restriction 27 | -------------------------------------------------------------------------------- /apisix/plugins/serverless-post-function.lua: -------------------------------------------------------------------------------- 1 | -- 2 | -- Licensed to the Apache Software Foundation (ASF) under one or more 3 | -- contributor license agreements. See the NOTICE file distributed with 4 | -- this work for additional information regarding copyright ownership. 5 | -- The ASF licenses this file to You under the Apache License, Version 2.0 6 | -- (the "License"); you may not use this file except in compliance with 7 | -- the License. You may obtain a copy of the License at 8 | -- 9 | -- http://www.apache.org/licenses/LICENSE-2.0 10 | -- 11 | -- Unless required by applicable law or agreed to in writing, software 12 | -- distributed under the License is distributed on an "AS IS" BASIS, 13 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | -- See the License for the specific language governing permissions and 15 | -- limitations under the License. 16 | -- 17 | return require("apisix.plugins.serverless.init")("serverless-post-function", -2000) 18 | -------------------------------------------------------------------------------- /apisix/plugins/serverless-pre-function.lua: -------------------------------------------------------------------------------- 1 | -- 2 | -- Licensed to the Apache Software Foundation (ASF) under one or more 3 | -- contributor license agreements. See the NOTICE file distributed with 4 | -- this work for additional information regarding copyright ownership. 5 | -- The ASF licenses this file to You under the Apache License, Version 2.0 6 | -- (the "License"); you may not use this file except in compliance with 7 | -- the License. You may obtain a copy of the License at 8 | -- 9 | -- http://www.apache.org/licenses/LICENSE-2.0 10 | -- 11 | -- Unless required by applicable law or agreed to in writing, software 12 | -- distributed under the License is distributed on an "AS IS" BASIS, 13 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | -- See the License for the specific language governing permissions and 15 | -- limitations under the License. 16 | -- 17 | return require("apisix.plugins.serverless.init")("serverless-pre-function", 10000) 18 | -------------------------------------------------------------------------------- /apisix/plugins/zipkin/random_sampler.lua: -------------------------------------------------------------------------------- 1 | -- 2 | -- Licensed to the Apache Software Foundation (ASF) under one or more 3 | -- contributor license agreements. See the NOTICE file distributed with 4 | -- this work for additional information regarding copyright ownership. 5 | -- The ASF licenses this file to You under the Apache License, Version 2.0 6 | -- (the "License"); you may not use this file except in compliance with 7 | -- the License. You may obtain a copy of the License at 8 | -- 9 | -- http://www.apache.org/licenses/LICENSE-2.0 10 | -- 11 | -- Unless required by applicable law or agreed to in writing, software 12 | -- distributed under the License is distributed on an "AS IS" BASIS, 13 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | -- See the License for the specific language governing permissions and 15 | -- limitations under the License. 16 | -- 17 | local assert = assert 18 | local type = type 19 | local setmetatable = setmetatable 20 | local math = math 21 | 22 | 23 | local _M = {} 24 | local mt = { __index = _M } 25 | 26 | function _M.new(conf) 27 | return setmetatable({}, mt) 28 | end 29 | 30 | function _M.sample(self, sample_ratio) 31 | assert(type(sample_ratio) == "number" and 32 | sample_ratio >= 0 and sample_ratio <= 1, "invalid sample_ratio") 33 | return math.random() < sample_ratio 34 | end 35 | 36 | 37 | return _M 38 | -------------------------------------------------------------------------------- /apisix/stream/plugins/ip-restriction.lua: -------------------------------------------------------------------------------- 1 | -- 2 | -- Licensed to the Apache Software Foundation (ASF) under one or more 3 | -- contributor license agreements. See the NOTICE file distributed with 4 | -- this work for additional information regarding copyright ownership. 5 | -- The ASF licenses this file to You under the Apache License, Version 2.0 6 | -- (the "License"); you may not use this file except in compliance with 7 | -- the License. You may obtain a copy of the License at 8 | -- 9 | -- http://www.apache.org/licenses/LICENSE-2.0 10 | -- 11 | -- Unless required by applicable law or agreed to in writing, software 12 | -- distributed under the License is distributed on an "AS IS" BASIS, 13 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | -- See the License for the specific language governing permissions and 15 | -- limitations under the License. 16 | -- 17 | local core = require("apisix.core") 18 | local base = require("apisix.plugins.ip-restriction.init") 19 | 20 | 21 | -- avoid unexpected data sharing 22 | local ip_restriction = core.table.clone(base) 23 | ip_restriction.preread = base.restrict 24 | 25 | 26 | return ip_restriction 27 | -------------------------------------------------------------------------------- /apisix/stream/plugins/prometheus.lua: -------------------------------------------------------------------------------- 1 | -- 2 | -- Licensed to the Apache Software Foundation (ASF) under one or more 3 | -- contributor license agreements. See the NOTICE file distributed with 4 | -- this work for additional information regarding copyright ownership. 5 | -- The ASF licenses this file to You under the Apache License, Version 2.0 6 | -- (the "License"); you may not use this file except in compliance with 7 | -- the License. You may obtain a copy of the License at 8 | -- 9 | -- http://www.apache.org/licenses/LICENSE-2.0 10 | -- 11 | -- Unless required by applicable law or agreed to in writing, software 12 | -- distributed under the License is distributed on an "AS IS" BASIS, 13 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | -- See the License for the specific language governing permissions and 15 | -- limitations under the License. 16 | -- 17 | local core = require("apisix.core") 18 | local exporter = require("apisix.plugins.prometheus.exporter") 19 | 20 | 21 | local plugin_name = "prometheus" 22 | local schema = { 23 | type = "object", 24 | properties = { 25 | prefer_name = { 26 | type = "boolean", 27 | default = false -- stream route doesn't have name yet 28 | } 29 | }, 30 | } 31 | 32 | 33 | local _M = { 34 | version = 0.1, 35 | priority = 500, 36 | name = plugin_name, 37 | log = exporter.stream_log, 38 | schema = schema, 39 | run_policy = "prefer_route", 40 | } 41 | 42 | 43 | function _M.check_schema(conf) 44 | return core.schema.check(schema, conf) 45 | end 46 | 47 | 48 | return _M 49 | -------------------------------------------------------------------------------- /apisix/stream/xrpc/protocols/dubbo/schema.lua: -------------------------------------------------------------------------------- 1 | -- 2 | -- Licensed to the Apache Software Foundation (ASF) under one or more 3 | -- contributor license agreements. See the NOTICE file distributed with 4 | -- this work for additional information regarding copyright ownership. 5 | -- The ASF licenses this file to You under the Apache License, Version 2.0 6 | -- (the "License"); you may not use this file except in compliance with 7 | -- the License. You may obtain a copy of the License at 8 | -- 9 | -- http://www.apache.org/licenses/LICENSE-2.0 10 | -- 11 | -- Unless required by applicable law or agreed to in writing, software 12 | -- distributed under the License is distributed on an "AS IS" BASIS, 13 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | -- See the License for the specific language governing permissions and 15 | -- limitations under the License. 16 | -- 17 | local core = require("apisix.core") 18 | 19 | 20 | local schema = { 21 | type = "object", 22 | } 23 | 24 | local _M = {} 25 | 26 | 27 | function _M.check_schema(conf) 28 | return core.schema.check(schema, conf) 29 | end 30 | 31 | 32 | return _M 33 | -------------------------------------------------------------------------------- /apisix/stream/xrpc/protocols/redis/metrics.lua: -------------------------------------------------------------------------------- 1 | -- 2 | -- Licensed to the Apache Software Foundation (ASF) under one or more 3 | -- contributor license agreements. See the NOTICE file distributed with 4 | -- this work for additional information regarding copyright ownership. 5 | -- The ASF licenses this file to You under the Apache License, Version 2.0 6 | -- (the "License"); you may not use this file except in compliance with 7 | -- the License. You may obtain a copy of the License at 8 | -- 9 | -- http://www.apache.org/licenses/LICENSE-2.0 10 | -- 11 | -- Unless required by applicable law or agreed to in writing, software 12 | -- distributed under the License is distributed on an "AS IS" BASIS, 13 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | -- See the License for the specific language governing permissions and 15 | -- limitations under the License. 16 | -- 17 | local _M = { 18 | commands_total = { 19 | type = "counter", 20 | help = "Total number of requests for a specific Redis command", 21 | labels = {"route", "command"}, 22 | }, 23 | commands_latency_seconds = { 24 | type = "histogram", 25 | help = "Latency of requests for a specific Redis command", 26 | labels = {"route", "command"}, 27 | -- latency buckets, 1ms to 1s: 28 | buckets = {0.001, 0.002, 0.005, 0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1} 29 | }, 30 | } 31 | 32 | 33 | return _M 34 | -------------------------------------------------------------------------------- /apisix/utils/auth.lua: -------------------------------------------------------------------------------- 1 | -- 2 | -- Licensed to the Apache Software Foundation (ASF) under one or more 3 | -- contributor license agreements. See the NOTICE file distributed with 4 | -- this work for additional information regarding copyright ownership. 5 | -- The ASF licenses this file to You under the Apache License, Version 2.0 6 | -- (the "License"); you may not use this file except in compliance with 7 | -- the License. You may obtain a copy of the License at 8 | -- 9 | -- http://www.apache.org/licenses/LICENSE-2.0 10 | -- 11 | -- Unless required by applicable law or agreed to in writing, software 12 | -- distributed under the License is distributed on an "AS IS" BASIS, 13 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | -- See the License for the specific language governing permissions and 15 | -- limitations under the License. 16 | -- 17 | 18 | local _M = {} 19 | 20 | function _M.is_running_under_multi_auth(ctx) 21 | return ctx._plugin_name == "multi-auth" 22 | end 23 | 24 | return _M 25 | -------------------------------------------------------------------------------- /apisix/utils/router.lua: -------------------------------------------------------------------------------- 1 | -- 2 | -- Licensed to the Apache Software Foundation (ASF) under one or more 3 | -- contributor license agreements. See the NOTICE file distributed with 4 | -- this work for additional information regarding copyright ownership. 5 | -- The ASF licenses this file to You under the Apache License, Version 2.0 6 | -- (the "License"); you may not use this file except in compliance with 7 | -- the License. You may obtain a copy of the License at 8 | -- 9 | -- http://www.apache.org/licenses/LICENSE-2.0 10 | -- 11 | -- Unless required by applicable law or agreed to in writing, software 12 | -- distributed under the License is distributed on an "AS IS" BASIS, 13 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | -- See the License for the specific language governing permissions and 15 | -- limitations under the License. 16 | -- 17 | local resty_router = require("resty.radixtree") 18 | 19 | 20 | local _M = {} 21 | 22 | do 23 | local router_opts = { 24 | no_param_match = true 25 | } 26 | 27 | function _M.new(routes) 28 | return resty_router.new(routes, router_opts) 29 | end 30 | 31 | end 32 | 33 | 34 | return _M 35 | -------------------------------------------------------------------------------- /autodocs/config.ld: -------------------------------------------------------------------------------- 1 | project='Apache APISIX' 2 | title='Plugin Develop Docs' 3 | description='Functions in APISIX core' 4 | format='markdown' 5 | backtick_references = false 6 | no_lua_ref = true 7 | all = false 8 | no_space_before_args = true 9 | ext = "md" 10 | template = true -- use the ldoc.ltp as markdown template 11 | template_escape = ">" 12 | -------------------------------------------------------------------------------- /benchmark/fake-apisix/conf/cert/openssl.conf: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | [req] 18 | distinguished_name = req_distinguished_name 19 | x509_extensions = v3_req 20 | prompt = no 21 | 22 | [req_distinguished_name] 23 | C = CN 24 | ST = GuangDong 25 | L = ZhuHai 26 | O = iresty 27 | CN = test.com 28 | 29 | [v3_req] 30 | subjectKeyIdentifier = hash 31 | authorityKeyIdentifier = keyid,issuer 32 | basicConstraints = CA:TRUE 33 | subjectAltName = @alt_names 34 | 35 | [alt_names] 36 | DNS.1 = test.com 37 | DNS.2 = *.test.com 38 | 39 | ## openssl genrsa -out apisix.key 3072 -nodes 40 | ## openssl req -new -x509 -key apisix.key -sha256 -config openssl.conf -out apisix.crt -days 36500 41 | -------------------------------------------------------------------------------- /benchmark/server/conf/nginx.conf: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | master_process on; 18 | 19 | worker_processes 2; 20 | 21 | error_log logs/error.log warn; 22 | pid logs/nginx.pid; 23 | 24 | worker_rlimit_nofile 20480; 25 | 26 | events { 27 | accept_mutex off; 28 | worker_connections 10620; 29 | } 30 | 31 | worker_shutdown_timeout 3; 32 | 33 | http { 34 | server { 35 | listen 1980; 36 | 37 | access_log off; 38 | location / { 39 | echo_duplicate 1 "1234567890"; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /ci/init-common-test-service.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Licensed to the Apache Software Foundation (ASF) under one or more 4 | # contributor license agreements. See the NOTICE file distributed with 5 | # this work for additional information regarding copyright ownership. 6 | # The ASF licenses this file to You under the Apache License, Version 2.0 7 | # (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | # prepare vault kv engine 20 | sleep 3s 21 | docker exec -i vault sh -c "VAULT_TOKEN='root' VAULT_ADDR='http://0.0.0.0:8200' vault secrets enable -path=kv -version=1 kv" 22 | 23 | # prepare localstack 24 | sleep 3s 25 | docker exec -i localstack sh -c "awslocal secretsmanager create-secret --name apisix-key --description 'APISIX Secret' --secret-string '{\"jack\":\"value\"}'" 26 | sleep 3s 27 | docker exec -i localstack sh -c "awslocal secretsmanager create-secret --name apisix-mysql --description 'APISIX Secret' --secret-string 'secret'" 28 | -------------------------------------------------------------------------------- /ci/kubernetes-ci.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Licensed to the Apache Software Foundation (ASF) under one or more 4 | # contributor license agreements. See the NOTICE file distributed with 5 | # this work for additional information regarding copyright ownership. 6 | # The ASF licenses this file to You under the Apache License, Version 2.0 7 | # (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | . ./ci/common.sh 20 | 21 | run_case() { 22 | export_or_prefix 23 | export PERL5LIB=.:$PERL5LIB 24 | prove -Itest-nginx/lib -I./ -r t/kubernetes | tee test-result 25 | rerun_flaky_tests test-result 26 | } 27 | 28 | case_opt=$1 29 | case $case_opt in 30 | (run_case) 31 | run_case 32 | ;; 33 | esac 34 | -------------------------------------------------------------------------------- /ci/linux-install-etcd-client.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # 4 | # Licensed to the Apache Software Foundation (ASF) under one or more 5 | # contributor license agreements. See the NOTICE file distributed with 6 | # this work for additional information regarding copyright ownership. 7 | # The ASF licenses this file to You under the Apache License, Version 2.0 8 | # (the "License"); you may not use this file except in compliance with 9 | # the License. You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # 19 | 20 | ETCD_ARCH="amd64" 21 | ETCD_VERSION=${ETCD_VERSION:-'3.5.4'} 22 | ARCH=${ARCH:-`(uname -m | tr '[:upper:]' '[:lower:]')`} 23 | 24 | if [[ $ARCH == "arm64" ]] || [[ $ARCH == "aarch64" ]]; then 25 | ETCD_ARCH="arm64" 26 | fi 27 | 28 | wget -q https://github.com/etcd-io/etcd/releases/download/v${ETCD_VERSION}/etcd-v${ETCD_VERSION}-linux-${ETCD_ARCH}.tar.gz 29 | tar xf etcd-v${ETCD_VERSION}-linux-${ETCD_ARCH}.tar.gz 30 | sudo cp etcd-v${ETCD_VERSION}-linux-${ETCD_ARCH}/etcdctl /usr/local/bin/ 31 | rm -rf etcd-v${ETCD_VERSION}-linux-${ETCD_ARCH} 32 | -------------------------------------------------------------------------------- /ci/linux_apisix_current_luarocks_in_customed_nginx_runner.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Licensed to the Apache Software Foundation (ASF) under one or more 4 | # contributor license agreements. See the NOTICE file distributed with 5 | # this work for additional information regarding copyright ownership. 6 | # The ASF licenses this file to You under the Apache License, Version 2.0 7 | # (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | 20 | export OPENRESTY_VERSION=source 21 | . ./ci/linux_apisix_current_luarocks_runner.sh 22 | -------------------------------------------------------------------------------- /ci/linux_openresty_runner.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Licensed to the Apache Software Foundation (ASF) under one or more 4 | # contributor license agreements. See the NOTICE file distributed with 5 | # this work for additional information regarding copyright ownership. 6 | # The ASF licenses this file to You under the Apache License, Version 2.0 7 | # (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | 20 | export OPENRESTY_VERSION=source 21 | . ./ci/linux_openresty_common_runner.sh 22 | -------------------------------------------------------------------------------- /ci/pod/etcd/env/common.env: -------------------------------------------------------------------------------- 1 | ALLOW_NONE_AUTHENTICATION=yes 2 | -------------------------------------------------------------------------------- /ci/pod/eureka/env/common.env: -------------------------------------------------------------------------------- 1 | ENVIRONMENT=apisix 2 | spring.application.name=apisix-eureka 3 | server.port=8761 4 | eureka.instance.ip-address=127.0.0.1 5 | eureka.client.registerWithEureka=true 6 | eureka.client.fetchRegistry=false 7 | eureka.client.serviceUrl.defaultZone=http://127.0.0.1:8761/eureka/ 8 | -------------------------------------------------------------------------------- /ci/pod/kafka/kafka-server/env/common.env: -------------------------------------------------------------------------------- 1 | ALLOW_PLAINTEXT_LISTENER=yes 2 | KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE=true 3 | KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://127.0.0.1:9092 4 | -------------------------------------------------------------------------------- /ci/pod/kafka/kafka-server/env/common2.env: -------------------------------------------------------------------------------- 1 | ALLOW_PLAINTEXT_LISTENER=yes 2 | KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE=false 3 | KAFKA_CFG_LISTENERS=PLAINTEXT://0.0.0.0:19092,SASL_PLAINTEXT://0.0.0.0:19094 4 | KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://127.0.0.1:19092,SASL_PLAINTEXT://127.0.0.1:19094 5 | KAFKA_CFG_SSL_ENDPOINT_IDENTIFICATION_ALGORITHM= 6 | KAFKA_CFG_SSL_KEYSTORE_LOCATION=/opt/bitnami/kafka/config/certs/kafka.keystore.jks 7 | KAFKA_CFG_SSL_KEYSTORE_PASSWORD=changeit 8 | KAFKA_CFG_SSL_KEY_PASSWORD=changeit 9 | -------------------------------------------------------------------------------- /ci/pod/kafka/kafka-server/env/last.env: -------------------------------------------------------------------------------- 1 | ALLOW_PLAINTEXT_LISTENER=yes 2 | KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE=false 3 | KAFKA_CFG_LISTENERS=PLAINTEXT://0.0.0.0:9092,SSL://0.0.0.0:9093,SASL_PLAINTEXT://0.0.0.0:9094 4 | KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://127.0.0.1:9092,SSL://127.0.0.1:9093,SASL_PLAINTEXT://127.0.0.1:9094 5 | KAFKA_CFG_SSL_ENDPOINT_IDENTIFICATION_ALGORITHM= 6 | KAFKA_CFG_SSL_KEYSTORE_LOCATION=/opt/bitnami/kafka/config/certs/kafka.keystore.jks 7 | KAFKA_CFG_SSL_KEYSTORE_PASSWORD=changeit 8 | KAFKA_CFG_SSL_KEY_PASSWORD=changeit 9 | -------------------------------------------------------------------------------- /ci/pod/kafka/kafka-server/kafka_jaas.conf: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed to the Apache Software Foundation (ASF) under one or more 3 | // contributor license agreements. See the NOTICE file distributed with 4 | // this work for additional information regarding copyright ownership. 5 | // The ASF licenses this file to You under the Apache License, Version 2.0 6 | // (the "License"); you may not use this file except in compliance with 7 | // the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | 18 | KafkaServer { 19 | org.apache.kafka.common.security.plain.PlainLoginModule required 20 | username="admin" 21 | password="admin-secret" 22 | user_admin="admin-secret"; 23 | }; 24 | -------------------------------------------------------------------------------- /ci/pod/kafka/zookeeper-server/env/common.env: -------------------------------------------------------------------------------- 1 | ALLOW_ANONYMOUS_LOGIN=yes 2 | -------------------------------------------------------------------------------- /ci/pod/keycloak/kcadm_configure_cas.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # 4 | # Licensed to the Apache Software Foundation (ASF) under one or more 5 | # contributor license agreements. See the NOTICE file distributed with 6 | # this work for additional information regarding copyright ownership. 7 | # The ASF licenses this file to You under the Apache License, Version 2.0 8 | # (the "License"); you may not use this file except in compliance with 9 | # the License. You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # 19 | 20 | set -ex 21 | 22 | export PATH=/opt/keycloak/bin:$PATH 23 | 24 | kcadm.sh config credentials --server http://localhost:8080 --realm master --user admin --password admin 25 | 26 | kcadm.sh create realms -s realm=test -s enabled=true 27 | 28 | kcadm.sh create users -r test -s username=test -s enabled=true 29 | kcadm.sh set-password -r test --username test --new-password test 30 | 31 | clients=("cas1" "cas2") 32 | rootUrls=("http://127.0.0.1:1984" "http://127.0.0.2:1984") 33 | 34 | for i in ${!clients[@]}; do 35 | kcadm.sh create clients -r test -s clientId=${clients[$i]} -s enabled=true \ 36 | -s protocol=cas -s frontchannelLogout=false -s rootUrl=${rootUrls[$i]} -s 'redirectUris=["/*"]' 37 | done 38 | -------------------------------------------------------------------------------- /ci/pod/keycloak/server.crt.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDazCCAlOgAwIBAgIUbZfnhty/ZiHPz5Aq8kK5Kr8kcSQwDQYJKoZIhvcNAQEL 3 | BQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM 4 | GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAeFw0yMzA0MTgxMTQzNDJaFw0zMzA0 5 | MTUxMTQzNDJaMEUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEw 6 | HwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwggEiMA0GCSqGSIb3DQEB 7 | AQUAA4IBDwAwggEKAoIBAQC/F4wK7eMTVAKGDMLCXE+Y6REdA5GU6/AakJf3NEKQ 8 | wCrtrqO+VBPIz445+edf3EEXhjFFGPdU6p0EkF0SMLaMsVBQQJ2qcP6FloIYiyT3 9 | WCs/gbtdoWq53ucAfWueIyHWsovLc0VhOXm0rhTYg88nMjJ7y6vYkfLMT6qlwASn 10 | 9Tozgjat09fWATbN7yBi4ivVVsKDo2S3jkOyVnYYMjzZO3CSkyUSMl+ZsSesseSK 11 | A9c2zogfKIU833njraA8blMFfdinEMI/9yceEx57IUjnpY1iWHLSItiZF+LKEpeL 12 | vp9gpr88ghR85ISusqAqwcmnsdAqjjw7gbPm1DIvUgVBAgMBAAGjUzBRMB0GA1Ud 13 | DgQWBBRvlz5ZiE2fD9ikPRqpYwsVrxZfxTAfBgNVHSMEGDAWgBRvlz5ZiE2fD9ik 14 | PRqpYwsVrxZfxTAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQCX 15 | 5fOeFnX67eHI5dJB8p3U2GS21qykDVLV5ZV+JZfZwXJEygIvr/T9vs772EPxv+0/ 16 | TO0+pGdcVswXq/6BoUFCV0rWWTDP5wTS3sV1ZsSSHil5zEutXuAI1LQGlit6w5xn 17 | iDURFZw3ZmOFytXKXNbca1ma4yaCZtOwVe3O36GZeOiZFzBYE2DELqy77Nz1E5+3 18 | jZaDnx0vonV8/hhX6FAPRPQnIXkaEH3BnVQZGD1jxipbFQQtmeeNPELy18MQo30N 19 | W1wOsbMMouniKUjdT16tdtzJzC+l9pVqRC+8df5PJfN56Uv9Ed6pjytkSF1SvHyJ 20 | iTWmyxJL9AonUkc5Oiri 21 | -----END CERTIFICATE----- 22 | -------------------------------------------------------------------------------- /ci/pod/nacos/env/common.env: -------------------------------------------------------------------------------- 1 | EMBEDDED_STORAGE=embedded 2 | PREFER_HOST_MODE=hostname 3 | MODE=cluster 4 | NACOS_SERVERS="nacos1:8848 nacos2:8848" 5 | JVM_XMS=512m 6 | JVM_XMX=512m 7 | -------------------------------------------------------------------------------- /ci/pod/nacos/env/service.env: -------------------------------------------------------------------------------- 1 | SERVICE_NAME=APISIX-NACOS 2 | NACOS_ADDR=nacos2:8848 3 | -------------------------------------------------------------------------------- /ci/pod/nacos/healthcheck/Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | FROM alpine:latest 19 | 20 | # change workdir to / 21 | WORKDIR / 22 | 23 | # install curl 24 | RUN apk --no-cache add bash curl 25 | 26 | # add healthcheck script 27 | COPY *.sh / 28 | 29 | # add hosted process 30 | CMD ["cat"] 31 | -------------------------------------------------------------------------------- /ci/pod/nacos/healthcheck/nacos-server-healthcheck.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Licensed to the Apache Software Foundation (ASF) under one or more 4 | # contributor license agreements. See the NOTICE file distributed with 5 | # this work for additional information regarding copyright ownership. 6 | # The ASF licenses this file to You under the Apache License, Version 2.0 7 | # (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | 20 | set -ex 21 | 22 | # nacos server healthcheck 23 | REQ_STATUS=$(curl -s -o /dev/null -w '%{http_code}' "${CHECK_URI}") 24 | 25 | if [ "${REQ_STATUS}" -ne "200" ]; then 26 | exit 1; 27 | fi 28 | -------------------------------------------------------------------------------- /ci/pod/nacos/service/Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | FROM eclipse-temurin:8 19 | 20 | ENV SUFFIX_NUM=${SUFFIX_NUM:-1} 21 | ENV NACOS_ADDR=${NACOS_ADDR:-127.0.0.1:8848} 22 | ENV SERVICE_NAME=${SERVICE_NAME:-gateway-service} 23 | ENV NAMESPACE=${NAMESPACE} 24 | ENV GROUP=${GROUP:-DEFAULT_GROUP} 25 | 26 | ADD https://raw.githubusercontent.com/api7/nacos-test-service/main/spring-nacos-1.0-SNAPSHOT.jar /app.jar 27 | 28 | ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar",\ 29 | "--suffix.num=${SUFFIX_NUM}","--spring.cloud.nacos.discovery.server-addr=${NACOS_ADDR}",\ 30 | "--spring.application.name=${SERVICE_NAME}","--spring.cloud.nacos.discovery.group=${GROUP}",\ 31 | "--spring.cloud.nacos.discovery.namespace=${NAMESPACE}"] 32 | EXPOSE 18001 33 | -------------------------------------------------------------------------------- /ci/pod/opa/data.json: -------------------------------------------------------------------------------- 1 | { 2 | "users": { 3 | "alice": { 4 | "headers": { 5 | "Location": "http://example.com/auth" 6 | }, 7 | "status_code": 302 8 | }, 9 | "bob": { 10 | "headers": { 11 | "test": "abcd", 12 | "abcd": "test" 13 | } 14 | }, 15 | "carla": { 16 | "reason": "Give you a string reason" 17 | }, 18 | "dylon": { 19 | "reason": { 20 | "code": 40001, 21 | "desc": "Give you a object reason" 22 | } 23 | }, 24 | "elisa": { 25 | "reason": { 26 | "info": [] 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /ci/pod/opa/echo.rego: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | package echo 18 | 19 | allow = false 20 | reason = input 21 | -------------------------------------------------------------------------------- /ci/pod/opa/with_route.rego: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | package with_route 18 | default allow = false 19 | 20 | allow { 21 | input.route.name == "valid" 22 | } 23 | 24 | status_code = 403 {not allow} 25 | -------------------------------------------------------------------------------- /ci/pod/openfunction/function-example/test-body/go.mod: -------------------------------------------------------------------------------- 1 | module example.com/hello 2 | 3 | go 1.17 4 | 5 | require github.com/OpenFunction/functions-framework-go v0.3.0 6 | 7 | require ( 8 | github.com/SkyAPM/go2sky v1.4.1 // indirect 9 | github.com/cloudevents/sdk-go/v2 v2.4.1 // indirect 10 | github.com/dapr/dapr v1.6.0 // indirect 11 | github.com/dapr/go-sdk v1.3.1 // indirect 12 | github.com/go-logr/logr v1.2.0 // indirect 13 | github.com/golang/protobuf v1.5.2 // indirect 14 | github.com/google/uuid v1.3.0 // indirect 15 | github.com/json-iterator/go v1.1.11 // indirect 16 | github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect 17 | github.com/modern-go/reflect2 v1.0.1 // indirect 18 | github.com/pkg/errors v0.9.1 // indirect 19 | go.uber.org/atomic v1.9.0 // indirect 20 | go.uber.org/multierr v1.7.0 // indirect 21 | go.uber.org/zap v1.19.1 // indirect 22 | golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f // indirect 23 | golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 // indirect 24 | golang.org/x/text v0.3.7 // indirect 25 | google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2 // indirect 26 | google.golang.org/grpc v1.40.0 // indirect 27 | google.golang.org/protobuf v1.33.0 // indirect 28 | gopkg.in/yaml.v3 v3.0.0 // indirect 29 | k8s.io/klog/v2 v2.30.0 // indirect 30 | skywalking.apache.org/repo/goapi v0.0.0-20220401015832-2c9eee9481eb // indirect 31 | ) 32 | -------------------------------------------------------------------------------- /ci/pod/openfunction/function-example/test-body/hello.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 The OpenFunction Authors. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package hello 21 | 22 | import ( 23 | "fmt" 24 | "io" 25 | "net/http" 26 | 27 | "github.com/OpenFunction/functions-framework-go/functions" 28 | ) 29 | 30 | func init() { 31 | functions.HTTP("HelloWorld", HelloWorld) 32 | } 33 | 34 | func HelloWorld(w http.ResponseWriter, r *http.Request) { 35 | body, _ := io.ReadAll(r.Body) 36 | fmt.Fprintf(w, "Hello, %s!\n", string(body)) 37 | } 38 | -------------------------------------------------------------------------------- /ci/pod/openfunction/function-example/test-header/go.mod: -------------------------------------------------------------------------------- 1 | module example.com/hello 2 | 3 | go 1.17 4 | -------------------------------------------------------------------------------- /ci/pod/openfunction/function-example/test-header/hello.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 The OpenFunction Authors. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package hello 21 | 22 | import ( 23 | "fmt" 24 | "net/http" 25 | ) 26 | 27 | func HelloWorld(w http.ResponseWriter, r *http.Request) { 28 | header := r.Header 29 | fmt.Fprintf(w, "%s", header["Authorization"]) 30 | } 31 | -------------------------------------------------------------------------------- /ci/pod/openfunction/function-example/test-uri/go.mod: -------------------------------------------------------------------------------- 1 | module example.com/hello 2 | 3 | go 1.17 4 | 5 | require github.com/OpenFunction/functions-framework-go v0.4.0 6 | 7 | require ( 8 | github.com/SkyAPM/go2sky v1.4.1 // indirect 9 | github.com/cloudevents/sdk-go/v2 v2.4.1 // indirect 10 | github.com/dapr/dapr v1.8.3 // indirect 11 | github.com/dapr/go-sdk v1.5.0 // indirect 12 | github.com/go-logr/logr v1.2.3 // indirect 13 | github.com/golang/protobuf v1.5.2 // indirect 14 | github.com/google/uuid v1.3.0 // indirect 15 | github.com/gorilla/mux v1.8.0 // indirect 16 | github.com/json-iterator/go v1.1.12 // indirect 17 | github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect 18 | github.com/modern-go/reflect2 v1.0.2 // indirect 19 | github.com/pkg/errors v0.9.1 // indirect 20 | go.uber.org/atomic v1.9.0 // indirect 21 | go.uber.org/multierr v1.7.0 // indirect 22 | go.uber.org/zap v1.21.0 // indirect 23 | golang.org/x/net v0.0.0-20220621193019-9d032be2e588 // indirect 24 | golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect 25 | golang.org/x/text v0.3.7 // indirect 26 | google.golang.org/genproto v0.0.0-20220622171453-ea41d75dfa0f // indirect 27 | google.golang.org/grpc v1.47.0 // indirect 28 | google.golang.org/protobuf v1.33.0 // indirect 29 | gopkg.in/yaml.v3 v3.0.1 // indirect 30 | k8s.io/klog/v2 v2.30.0 // indirect 31 | skywalking.apache.org/repo/goapi v0.0.0-20220401015832-2c9eee9481eb // indirect 32 | ) 33 | -------------------------------------------------------------------------------- /ci/pod/openfunction/function-example/test-uri/hello.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 The OpenFunction Authors. 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one or more 5 | * contributor license agreements. See the NOTICE file distributed with 6 | * this work for additional information regarding copyright ownership. 7 | * The ASF licenses this file to You under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with 9 | * the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package hello 21 | 22 | import ( 23 | "fmt" 24 | ofctx "github.com/OpenFunction/functions-framework-go/context" 25 | "net/http" 26 | 27 | "github.com/OpenFunction/functions-framework-go/functions" 28 | ) 29 | 30 | func init() { 31 | functions.HTTP("HelloWorld", HelloWorld, 32 | functions.WithFunctionPath("/{greeting}")) 33 | } 34 | 35 | func HelloWorld(w http.ResponseWriter, r *http.Request) { 36 | vars := ofctx.VarsFromCtx(r.Context()) 37 | fmt.Fprintf(w, "Hello, %s!\n", vars["greeting"]) 38 | } 39 | -------------------------------------------------------------------------------- /ci/pod/otelcol-contrib/config.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | receivers: 19 | otlp: 20 | protocols: 21 | grpc: 22 | endpoint: 0.0.0.0:4317 23 | http: 24 | endpoint: 0.0.0.0:4318 25 | exporters: 26 | file: 27 | path: /etc/otelcol-contrib/data-otlp.json 28 | service: 29 | pipelines: 30 | traces: 31 | receivers: [otlp] 32 | exporters: [file] 33 | -------------------------------------------------------------------------------- /ci/tars-ci.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Licensed to the Apache Software Foundation (ASF) under one or more 4 | # contributor license agreements. See the NOTICE file distributed with 5 | # this work for additional information regarding copyright ownership. 6 | # The ASF licenses this file to You under the Apache License, Version 2.0 7 | # (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | . ./ci/common.sh 20 | 21 | run_case() { 22 | export_or_prefix 23 | export PERL5LIB=.:$PERL5LIB 24 | prove -Itest-nginx/lib -I./ -r t/tars | tee test-result 25 | rerun_flaky_tests test-result 26 | } 27 | 28 | case_opt=$1 29 | case $case_opt in 30 | (run_case) 31 | run_case 32 | ;; 33 | esac 34 | -------------------------------------------------------------------------------- /conf/apisix.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | # example 18 | routes: 19 | - 20 | uri: /hello 21 | upstream: 22 | nodes: 23 | "127.0.0.1:1980": 1 24 | type: roundrobin 25 | #END 26 | -------------------------------------------------------------------------------- /docs/assets/images/MA.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/MA.jpeg -------------------------------------------------------------------------------- /docs/assets/images/OA.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/OA.jpg -------------------------------------------------------------------------------- /docs/assets/images/apache.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/apache.png -------------------------------------------------------------------------------- /docs/assets/images/apisix-multi-lang-support.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/apisix-multi-lang-support.png -------------------------------------------------------------------------------- /docs/assets/images/apisix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/apisix.png -------------------------------------------------------------------------------- /docs/assets/images/aws-caddy-php-welcome-page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/aws-caddy-php-welcome-page.png -------------------------------------------------------------------------------- /docs/assets/images/aws-define-route.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/aws-define-route.png -------------------------------------------------------------------------------- /docs/assets/images/aws-define-service.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/aws-define-service.png -------------------------------------------------------------------------------- /docs/assets/images/aws-fargate-cdk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/aws-fargate-cdk.png -------------------------------------------------------------------------------- /docs/assets/images/aws-nlb-ip-addr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/aws-nlb-ip-addr.png -------------------------------------------------------------------------------- /docs/assets/images/benchmark-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/benchmark-1.jpg -------------------------------------------------------------------------------- /docs/assets/images/benchmark-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/benchmark-2.jpg -------------------------------------------------------------------------------- /docs/assets/images/build-devcontainers-vscode-command.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/build-devcontainers-vscode-command.png -------------------------------------------------------------------------------- /docs/assets/images/build-devcontainers-vscode-progressbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/build-devcontainers-vscode-progressbar.png -------------------------------------------------------------------------------- /docs/assets/images/consumer-internal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/consumer-internal.png -------------------------------------------------------------------------------- /docs/assets/images/consumer-who.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/consumer-who.png -------------------------------------------------------------------------------- /docs/assets/images/contributor-over-time.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/contributor-over-time.png -------------------------------------------------------------------------------- /docs/assets/images/control-plane-service-discovery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/control-plane-service-discovery.png -------------------------------------------------------------------------------- /docs/assets/images/create-a-route.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/create-a-route.png -------------------------------------------------------------------------------- /docs/assets/images/dashboard.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/dashboard.jpeg -------------------------------------------------------------------------------- /docs/assets/images/deployment-cp_and_dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/deployment-cp_and_dp.png -------------------------------------------------------------------------------- /docs/assets/images/deployment-traditional.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/deployment-traditional.png -------------------------------------------------------------------------------- /docs/assets/images/discovery-cn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/discovery-cn.png -------------------------------------------------------------------------------- /docs/assets/images/discovery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/discovery.png -------------------------------------------------------------------------------- /docs/assets/images/external-plugin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/external-plugin.png -------------------------------------------------------------------------------- /docs/assets/images/flamegraph-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/flamegraph-1.jpg -------------------------------------------------------------------------------- /docs/assets/images/flamegraph-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/flamegraph-2.jpg -------------------------------------------------------------------------------- /docs/assets/images/flow-load-plugin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/flow-load-plugin.png -------------------------------------------------------------------------------- /docs/assets/images/flow-plugin-internal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/flow-plugin-internal.png -------------------------------------------------------------------------------- /docs/assets/images/flow-software-architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/flow-software-architecture.png -------------------------------------------------------------------------------- /docs/assets/images/health_check_node_state_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/health_check_node_state_diagram.png -------------------------------------------------------------------------------- /docs/assets/images/health_check_status_page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/health_check_status_page.png -------------------------------------------------------------------------------- /docs/assets/images/latency-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/latency-1.jpg -------------------------------------------------------------------------------- /docs/assets/images/latency-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/latency-2.jpg -------------------------------------------------------------------------------- /docs/assets/images/list-of-routes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/list-of-routes.png -------------------------------------------------------------------------------- /docs/assets/images/plugin/authz-keycloak.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/plugin/authz-keycloak.png -------------------------------------------------------------------------------- /docs/assets/images/plugin/basic-auth-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/plugin/basic-auth-1.png -------------------------------------------------------------------------------- /docs/assets/images/plugin/basic-auth-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/plugin/basic-auth-2.png -------------------------------------------------------------------------------- /docs/assets/images/plugin/grafana-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/plugin/grafana-1.png -------------------------------------------------------------------------------- /docs/assets/images/plugin/grafana-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/plugin/grafana-2.png -------------------------------------------------------------------------------- /docs/assets/images/plugin/grafana-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/plugin/grafana-3.png -------------------------------------------------------------------------------- /docs/assets/images/plugin/grafana-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/plugin/grafana-4.png -------------------------------------------------------------------------------- /docs/assets/images/plugin/hmac-auth-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/plugin/hmac-auth-1.png -------------------------------------------------------------------------------- /docs/assets/images/plugin/hmac-auth-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/plugin/hmac-auth-2.png -------------------------------------------------------------------------------- /docs/assets/images/plugin/inspect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/plugin/inspect.png -------------------------------------------------------------------------------- /docs/assets/images/plugin/jaeger-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/plugin/jaeger-1.png -------------------------------------------------------------------------------- /docs/assets/images/plugin/jaeger-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/plugin/jaeger-2.png -------------------------------------------------------------------------------- /docs/assets/images/plugin/jwt-auth-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/plugin/jwt-auth-1.png -------------------------------------------------------------------------------- /docs/assets/images/plugin/jwt-auth-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/plugin/jwt-auth-2.png -------------------------------------------------------------------------------- /docs/assets/images/plugin/jwt-auth-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/plugin/jwt-auth-3.png -------------------------------------------------------------------------------- /docs/assets/images/plugin/key-auth-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/plugin/key-auth-1.png -------------------------------------------------------------------------------- /docs/assets/images/plugin/key-auth-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/plugin/key-auth-2.png -------------------------------------------------------------------------------- /docs/assets/images/plugin/limit-conn-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/plugin/limit-conn-1.png -------------------------------------------------------------------------------- /docs/assets/images/plugin/limit-count-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/plugin/limit-count-1.png -------------------------------------------------------------------------------- /docs/assets/images/plugin/limit-req-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/plugin/limit-req-1.png -------------------------------------------------------------------------------- /docs/assets/images/plugin/loggly-dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/plugin/loggly-dashboard.png -------------------------------------------------------------------------------- /docs/assets/images/plugin/oauth-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/plugin/oauth-1.png -------------------------------------------------------------------------------- /docs/assets/images/plugin/prometheus-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/plugin/prometheus-1.png -------------------------------------------------------------------------------- /docs/assets/images/plugin/prometheus-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/plugin/prometheus-2.png -------------------------------------------------------------------------------- /docs/assets/images/plugin/prometheus01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/plugin/prometheus01.png -------------------------------------------------------------------------------- /docs/assets/images/plugin/prometheus02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/plugin/prometheus02.png -------------------------------------------------------------------------------- /docs/assets/images/plugin/skywalking-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/plugin/skywalking-1.png -------------------------------------------------------------------------------- /docs/assets/images/plugin/skywalking-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/plugin/skywalking-3.png -------------------------------------------------------------------------------- /docs/assets/images/plugin/skywalking-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/plugin/skywalking-4.png -------------------------------------------------------------------------------- /docs/assets/images/plugin/skywalking-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/plugin/skywalking-5.png -------------------------------------------------------------------------------- /docs/assets/images/plugin/sls-logger-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/plugin/sls-logger-1.png -------------------------------------------------------------------------------- /docs/assets/images/plugin/splunk-hec-admin-cn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/plugin/splunk-hec-admin-cn.png -------------------------------------------------------------------------------- /docs/assets/images/plugin/splunk-hec-admin-en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/plugin/splunk-hec-admin-en.png -------------------------------------------------------------------------------- /docs/assets/images/plugin/wolf-rbac-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/plugin/wolf-rbac-1.png -------------------------------------------------------------------------------- /docs/assets/images/plugin/wolf-rbac-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/plugin/wolf-rbac-2.png -------------------------------------------------------------------------------- /docs/assets/images/plugin/zipkin-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/plugin/zipkin-1.jpg -------------------------------------------------------------------------------- /docs/assets/images/plugin/zipkin-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/plugin/zipkin-1.png -------------------------------------------------------------------------------- /docs/assets/images/plugin/zipkin-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/plugin/zipkin-2.jpg -------------------------------------------------------------------------------- /docs/assets/images/requesturl.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/requesturl.jpg -------------------------------------------------------------------------------- /docs/assets/images/routes-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/routes-example.png -------------------------------------------------------------------------------- /docs/assets/images/secret.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/secret.png -------------------------------------------------------------------------------- /docs/assets/images/service-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/service-example.png -------------------------------------------------------------------------------- /docs/assets/images/skip-mtls.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/skip-mtls.png -------------------------------------------------------------------------------- /docs/assets/images/update-docker-desktop-file-sharing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/update-docker-desktop-file-sharing.png -------------------------------------------------------------------------------- /docs/assets/images/upstream-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/images/upstream-example.png -------------------------------------------------------------------------------- /docs/assets/other/apisix-plugin-design.graffle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/docs/assets/other/apisix-plugin-design.graffle -------------------------------------------------------------------------------- /docs/en/latest/discovery/eureka.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: eureka 3 | --- 4 | 5 | 23 | 24 | Apache APISIX supports service discovery via Eureka. For the details, please start your 25 | reading from [Supported discovery registries](../discovery.md#supported-discovery-registries). 26 | -------------------------------------------------------------------------------- /docs/en/latest/plugins/ext-plugin-post-req.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: ext-plugin-post-req 3 | keywords: 4 | - Apache APISIX 5 | - Plugin 6 | - ext-plugin-post-req 7 | description: This document contains information about the Apache APISIX ext-plugin-post-req Plugin. 8 | --- 9 | 10 | 28 | 29 | ## Description 30 | 31 | `ext-plugin-post-req` differs from the [ext-plugin-pre-req](./ext-plugin-pre-req.md) Plugin in that it runs after executing the built-in Lua Plugins and before proxying to the Upstream. 32 | 33 | You can learn more about the configuration from the [ext-plugin-pre-req](./ext-plugin-pre-req.md) Plugin document. 34 | -------------------------------------------------------------------------------- /docs/en/latest/plugins/gm.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: GM 3 | keywords: 4 | - Apache APISIX 5 | - Plugin 6 | - GM 7 | description: This article introduces the basic information and usage of the Apache APISIX `gm` plugin. 8 | --- 9 | 10 | 28 | 29 | :::info 30 | The function usage scenarios introduced in this article are mainly in China, so this article only has a Chinese version temporarily. You can click [here](https://apisix.apache.org/zh/docs/apisix/plugins/gm/) for more details. If you are interested in this feature, welcome to translate this document. 31 | ::: 32 | -------------------------------------------------------------------------------- /docs/zh/latest/discovery/eureka.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: eureka 3 | --- 4 | 5 | 23 | 24 | Apache APISIX 支持使用 [Eureka](https://github.com/Netflix/eureka#eureka) 做服务发现。 25 | 详情请阅读 [支持的服务注册发现](../discovery.md#当前支持的注册中心) 。 26 | -------------------------------------------------------------------------------- /docs/zh/latest/plugins/ext-plugin-post-req.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: ext-plugin-post-req 3 | keywords: 4 | - Apache APISIX 5 | - Plugin 6 | - ext-plugin-post-req 7 | description: 本文介绍了关于 Apache APISIX `ext-plugin-post-req` 插件的基本信息及使用方法。 8 | --- 9 | 10 | 28 | 29 | ## 描述 30 | 31 | `ext-plugin-post-req` 插件的功能与 `ext-plugin-pre-req` 插件的不同之处在于:`ext-plugin-post-req` 插件是在内置 Lua 插件执行之后且在请求到达上游之前工作。 32 | 33 | 你可以参考 [ext-plugin-pre-req](./ext-plugin-pre-req.md) 文档,学习如何配置和使用 `ext-plugin-post-req` 插件。 34 | -------------------------------------------------------------------------------- /docs/zh/latest/profile.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 基于环境变量进行配置文件切换 3 | --- 4 | 5 | 23 | 24 | 配置之所以从代码中提取出来,就是为了更好适应变化。通常我们的应用都有开发环境、生产环境等不同运行环境,这些环境下应用的一些配置肯定会有不同,比如:配置中心的地址等。 25 | 26 | 如果把所有环境的配置都放在同一个文件里,非常不好管理,我们接到新需求后,在开发环境进行开发时,需要将配置文件中的参数都改成开发环境的,提交代码时还要改回去,这样改来改去非常容易出错。 27 | 28 | 上述问题的解决办法就是通过环境变量来区分当前运行环境,并通过环境变量来切换不同配置文件。APISIX 中对应的环境变量就是:`APISIX_PROFILE`。 29 | 30 | 在没有设置 `APISIX_PROFILE` 时,默认使用以下三个配置文件: 31 | 32 | * conf/config.yaml 33 | * conf/apisix.yaml 34 | * conf/debug.yaml 35 | 36 | 如果设置了 `APISIX_PROFILE` 的值为 `prod`,则使用以下三个配置文件: 37 | 38 | * conf/config-prod.yaml 39 | * conf/apisix-prod.yaml 40 | * conf/debug-prod.yaml 41 | 42 | 通过这种方式虽然会增加配置文件的数量,但可以独立管理,再配置 git 等版本管理工具,还能更好实现版本管理。 43 | -------------------------------------------------------------------------------- /docs/zh/latest/terminology/api-gateway.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: API Gateway 3 | keywords: 4 | - Apache APISIX 5 | - API 网关 6 | - 网关 7 | description: 本文主要介绍了 API 网关的作用以及为什么需要 API 网关。 8 | --- 9 | 10 | 28 | 29 | ## 描述 30 | 31 | API 网关是位于客户端与后端服务集之间的 API 管理工具。API 网关相当于反向代理,用于接受所有 API 的调用、整合处理这些调用所需的各种服务,并返回相应的结果。API 网关通常会处理**跨 API 服务系统使用**的常见任务,并统一接入进行管理。通过 API 网关的统一拦截,可以实现对 API 接口的安全、日志等共性需求,如用户身份验证、速率限制和统计信息。 32 | 33 | ## 为什么需要 API 网关? 34 | 35 | 与传统的 API 微服务相比,API 网关有很多好处。比如: 36 | 37 | - 它是所有 API 请求的唯一入口。 38 | - 可用于将请求转发到不同的后端,或根据请求头将请求转发到不同的服务。 39 | - 可用于执行身份验证、授权和限速。 40 | - 它可用于支持分析,例如监控、日志记录和跟踪。 41 | - 可以保护 API 免受 SQL 注入、DDOS 攻击和 XSS 等恶意攻击媒介的攻击。 42 | - 它可以降低 API 和微服务的复杂性。 43 | -------------------------------------------------------------------------------- /docs/zh/latest/terminology/script.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Script 3 | keywords: 4 | - API 网关 5 | - Apache APISIX 6 | - Router 7 | description: 本文介绍了 Apache APISIX Script 的使用方法及注意事项。 8 | --- 9 | 10 | 28 | 29 | ## 描述 30 | 31 | Script 表示将在 `HTTP` 请求/响应生命周期期间执行的脚本。 32 | 33 | Script 配置需要绑定在路由上。 34 | 35 | Script 与 Plugin 不兼容,并且 Script 优先执行 Script,这意味着配置 Script 后,Route 上配置的 Plugin 将**不被执行**。 36 | 37 | 理论上,在 Script 中可以编写任意 Lua 代码,你也可以直接调用已有的插件以复用已有的代码。 38 | 39 | Script 也有执行阶段概念,支持 `access`、`header_filter`、`body_filter` 和 `log` 阶段。系统会在相应阶段中自动执行 `Script` 脚本中对应阶段的代码。 40 | 41 | ```json 42 | { 43 | ... 44 | "script": "local _M = {} \n function _M.access(api_ctx) \n ngx.log(ngx.INFO,\"hit access phase\") \n end \nreturn _M" 45 | } 46 | ``` 47 | -------------------------------------------------------------------------------- /example/apisix/plugins/3rd-party.lua: -------------------------------------------------------------------------------- 1 | -- 2 | -- Licensed to the Apache Software Foundation (ASF) under one or more 3 | -- contributor license agreements. See the NOTICE file distributed with 4 | -- this work for additional information regarding copyright ownership. 5 | -- The ASF licenses this file to You under the Apache License, Version 2.0 6 | -- (the "License"); you may not use this file except in compliance with 7 | -- the License. You may obtain a copy of the License at 8 | -- 9 | -- http://www.apache.org/licenses/LICENSE-2.0 10 | -- 11 | -- Unless required by applicable law or agreed to in writing, software 12 | -- distributed under the License is distributed on an "AS IS" BASIS, 13 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | -- See the License for the specific language governing permissions and 15 | -- limitations under the License. 16 | -- 17 | local core = require("apisix.core") 18 | 19 | 20 | local schema = { 21 | type = "object", 22 | properties = { 23 | body = { 24 | description = "body to replace response.", 25 | type = "string" 26 | }, 27 | }, 28 | required = {"body"}, 29 | } 30 | 31 | local plugin_name = "3rd-party" 32 | 33 | local _M = { 34 | version = 0.1, 35 | priority = 12, 36 | name = plugin_name, 37 | schema = schema, 38 | } 39 | 40 | 41 | function _M.check_schema(conf) 42 | return core.schema.check(schema, conf) 43 | end 44 | 45 | 46 | function _M.access(conf, ctx) 47 | return 200, conf.body 48 | end 49 | 50 | 51 | return _M 52 | -------------------------------------------------------------------------------- /example/apisix/stream/plugins/3rd-party.lua: -------------------------------------------------------------------------------- 1 | -- 2 | -- Licensed to the Apache Software Foundation (ASF) under one or more 3 | -- contributor license agreements. See the NOTICE file distributed with 4 | -- this work for additional information regarding copyright ownership. 5 | -- The ASF licenses this file to You under the Apache License, Version 2.0 6 | -- (the "License"); you may not use this file except in compliance with 7 | -- the License. You may obtain a copy of the License at 8 | -- 9 | -- http://www.apache.org/licenses/LICENSE-2.0 10 | -- 11 | -- Unless required by applicable law or agreed to in writing, software 12 | -- distributed under the License is distributed on an "AS IS" BASIS, 13 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | -- See the License for the specific language governing permissions and 15 | -- limitations under the License. 16 | -- 17 | local core = require("apisix.core") 18 | 19 | 20 | local schema = { 21 | type = "object", 22 | properties = { 23 | body = { 24 | description = "body to replace response.", 25 | type = "string" 26 | }, 27 | }, 28 | required = {"body"}, 29 | } 30 | 31 | local plugin_name = "3rd-party" 32 | 33 | local _M = { 34 | version = 0.1, 35 | priority = 12, 36 | name = plugin_name, 37 | schema = schema, 38 | } 39 | 40 | 41 | function _M.check_schema(conf) 42 | return core.schema.check(schema, conf) 43 | end 44 | 45 | 46 | function _M.access(conf, ctx) 47 | return 200, conf.body 48 | end 49 | 50 | 51 | return _M 52 | -------------------------------------------------------------------------------- /example/build-dev-image.dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | FROM ubuntu:20.04 19 | 20 | # Install Test::Nginx 21 | RUN apt update 22 | RUN apt install -y cpanminus make 23 | RUN cpanm --notest Test::Nginx 24 | 25 | # Install development utils 26 | RUN apt install -y sudo git gawk curl nano vim inetutils-ping 27 | 28 | WORKDIR /apisix 29 | 30 | ENV PERL5LIB=.:$PERL5LIB 31 | 32 | ENTRYPOINT ["tail", "-f", "/dev/null"] 33 | -------------------------------------------------------------------------------- /example/my_hook.lua: -------------------------------------------------------------------------------- 1 | -- 2 | -- Licensed to the Apache Software Foundation (ASF) under one or more 3 | -- contributor license agreements. See the NOTICE file distributed with 4 | -- this work for additional information regarding copyright ownership. 5 | -- The ASF licenses this file to You under the Apache License, Version 2.0 6 | -- (the "License"); you may not use this file except in compliance with 7 | -- the License. You may obtain a copy of the License at 8 | -- 9 | -- http://www.apache.org/licenses/LICENSE-2.0 10 | -- 11 | -- Unless required by applicable law or agreed to in writing, software 12 | -- distributed under the License is distributed on an "AS IS" BASIS, 13 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | -- See the License for the specific language governing permissions and 15 | -- limitations under the License. 16 | -- 17 | local apisix = require("apisix") 18 | 19 | local old_http_init = apisix.http_init 20 | apisix.http_init = function (...) 21 | ngx.log(ngx.EMERG, "my hook works in http") 22 | old_http_init(...) 23 | end 24 | 25 | local old_stream_init = apisix.stream_init 26 | apisix.stream_init = function (...) 27 | ngx.log(ngx.EMERG, "my hook works in stream") 28 | old_stream_init(...) 29 | end 30 | -------------------------------------------------------------------------------- /logos/apache-apisix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/logos/apache-apisix.png -------------------------------------------------------------------------------- /logos/apisix-white-bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/logos/apisix-white-bg.jpg -------------------------------------------------------------------------------- /logos/cncf-landscape-white-bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/logos/cncf-landscape-white-bg.jpg -------------------------------------------------------------------------------- /logos/cncf-white-bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/logos/cncf-white-bg.jpg -------------------------------------------------------------------------------- /t/admin/metadata.t: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | use t::APISIX 'no_plan'; 18 | 19 | repeat_each(1); 20 | no_long_string(); 21 | no_root_location(); 22 | use_hup(); 23 | 24 | run_tests(); 25 | 26 | __DATA__ 27 | 28 | === TEST 1: test 29 | --- timeout: 15 30 | --- max_size: 204800 31 | --- exec 32 | cd t && pnpm test admin/metadata.spec.ts 2>&1 33 | --- no_error_log 34 | failed to execute the script with status 35 | --- response_body eval 36 | qr/PASS admin\/metadata.spec.ts/ 37 | -------------------------------------------------------------------------------- /t/assets/ai-proxy-response.json: -------------------------------------------------------------------------------- 1 | { 2 | "choices": [ 3 | { 4 | "finish_reason": "stop", 5 | "index": 0, 6 | "message": { "content": "1 + 1 = 2.", "role": "assistant" } 7 | } 8 | ], 9 | "created": 1723780938, 10 | "id": "chatcmpl-9wiSIg5LYrrpxwsr2PubSQnbtod1P", 11 | "model": "gpt-4o-2024-05-13", 12 | "object": "chat.completion", 13 | "system_fingerprint": "fp_abc28019ad", 14 | "usage": { "completion_tokens": 8, "prompt_tokens": 23, "total_tokens": 31 } 15 | } 16 | -------------------------------------------------------------------------------- /t/assets/embeddings.json: -------------------------------------------------------------------------------- 1 | { 2 | "object": "list", 3 | "data": [ 4 | { 5 | "object": "embedding", 6 | "index": 0, 7 | "embedding": [ 8 | 123456789, 9 | 0.01902593, 10 | 0.008967914, 11 | -0.013226582, 12 | -0.026961878, 13 | -0.017892223, 14 | -0.0007785152, 15 | -0.011031842, 16 | 0.0068531134 17 | ] 18 | } 19 | ], 20 | "model": "text-embedding-3-small", 21 | "usage": { 22 | "prompt_tokens": 4, 23 | "total_tokens": 4 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /t/certs/apisix_ecc.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIB8jCCAZmgAwIBAgIJALwxr+GMOgSKMAoGCCqGSM49BAMCMFYxCzAJBgNVBAYT 3 | AkNOMRIwEAYDVQQIDAlHdWFuZ0RvbmcxDzANBgNVBAcMBlpodUhhaTEPMA0GA1UE 4 | CgwGaXJlc3R5MREwDwYDVQQDDAh0ZXN0LmNvbTAeFw0yMDA4MTgwODI0MzdaFw0y 5 | MTA4MTgwODI0MzdaMFYxCzAJBgNVBAYTAkNOMRIwEAYDVQQIDAlHdWFuZ0Rvbmcx 6 | DzANBgNVBAcMBlpodUhhaTEPMA0GA1UECgwGaXJlc3R5MREwDwYDVQQDDAh0ZXN0 7 | LmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABEJACTxb5qYd4v9VaNKlv2fe 8 | XlZSTDYe+0fZwT4l9sifmPzmpwjiVTB2wLiCYYzy+BPrb29r5ubgtXIflsWKRBKj 9 | UDBOMB0GA1UdDgQWBBQPXxOYAHfboUjsoo1xm6/GJ1qHijAfBgNVHSMEGDAWgBQP 10 | XxOYAHfboUjsoo1xm6/GJ1qHijAMBgNVHRMEBTADAQH/MAoGCCqGSM49BAMCA0cA 11 | MEQCICQ70LiJ+Z2lv9ZF+FQL+VEdVQ938rz6RGXBmnl2oEvkAiBY2eeTl//JanNX 12 | GsSV104WrpHjcBjcY24jb11Y1H3R9g== 13 | -----END CERTIFICATE----- 14 | -------------------------------------------------------------------------------- /t/certs/apisix_ecc.key: -------------------------------------------------------------------------------- 1 | -----BEGIN EC PARAMETERS----- 2 | BggqhkjOPQMBBw== 3 | -----END EC PARAMETERS----- 4 | -----BEGIN EC PRIVATE KEY----- 5 | MHcCAQEEIBlQqVD3bK6CQT5puOOngrb50+3K66MKJdhtpWQoUw2poAoGCCqGSM49 6 | AwEHoUQDQgAEQkAJPFvmph3i/1Vo0qW/Z95eVlJMNh77R9nBPiX2yJ+Y/OanCOJV 7 | MHbAuIJhjPL4E+tvb2vm5uC1ch+WxYpEEg== 8 | -----END EC PRIVATE KEY----- 9 | -------------------------------------------------------------------------------- /t/certs/client_enc.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIB2TCCAX6gAwIBAgIBBTAKBggqgRzPVQGDdTBFMQswCQYDVQQGEwJBQTELMAkG 3 | A1UECAwCQkIxCzAJBgNVBAoMAkNDMQswCQYDVQQLDAJERDEPMA0GA1UEAwwGc3Vi 4 | IGNhMB4XDTIyMTEwMjAzMTkzNloXDTMyMTAzMDAzMTkzNlowSTELMAkGA1UEBhMC 5 | QUExCzAJBgNVBAgMAkJCMQswCQYDVQQKDAJDQzELMAkGA1UECwwCREQxEzARBgNV 6 | BAMMCmNsaWVudCBlbmMwWjAUBggqgRzPVQGCLQYIKoEcz1UBgi0DQgAEYYuPPz5e 7 | 0QMSGPeBfVbK02GwYhSieSCuc12WsNw+ZQEiaN3NJ2Mh0EAH95eWVutKAeMwKwQZ 8 | q7QgnSoo3io8hKNaMFgwCQYDVR0TBAIwADALBgNVHQ8EBAMCAzgwHQYDVR0OBBYE 9 | FEL0AwvahirH+kdK5Poq+e0yhii1MB8GA1UdIwQYMBaAFCTrpmbUig3JfveqAIGJ 10 | 6n+vAk2AMAoGCCqBHM9VAYN1A0kAMEYCIQDx+KxdaJ7YX5gR492EgiGn7//HsjOU 11 | B7+jyTVvkNzN2AIhAIbDKNJQ2i5Edcw/nDIWJQLec7NZui3QfC/gr9AuCfHN 12 | -----END CERTIFICATE----- 13 | -------------------------------------------------------------------------------- /t/certs/client_enc.key: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGHAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBG0wawIBAQQgq7+Y1ql10Uvv2vTf 3 | AHR26o4B3RJTJO5XTh0BNLdtB7OhRANCAARhi48/Pl7RAxIY94F9VsrTYbBiFKJ5 4 | IK5zXZaw3D5lASJo3c0nYyHQQAf3l5ZW60oB4zArBBmrtCCdKijeKjyE 5 | -----END PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /t/certs/client_sign.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIB2TCCAX+gAwIBAgIBBDAKBggqgRzPVQGDdTBFMQswCQYDVQQGEwJBQTELMAkG 3 | A1UECAwCQkIxCzAJBgNVBAoMAkNDMQswCQYDVQQLDAJERDEPMA0GA1UEAwwGc3Vi 4 | IGNhMB4XDTIyMTEwMjAzMTkzNloXDTMyMTAzMDAzMTkzNlowSjELMAkGA1UEBhMC 5 | QUExCzAJBgNVBAgMAkJCMQswCQYDVQQKDAJDQzELMAkGA1UECwwCREQxFDASBgNV 6 | BAMMC2NsaWVudCBzaWduMFowFAYIKoEcz1UBgi0GCCqBHM9VAYItA0IABFZcc94m 7 | hTZRKis639AnlAbS0cKQv73GP5RzBdNlLpAaUwi4hqAh0ZUIcTH/5ZbOTal9MvHA 8 | gOLjVxv197o+fNejWjBYMAkGA1UdEwQCMAAwCwYDVR0PBAQDAgbAMB0GA1UdDgQW 9 | BBTkdzyphRCxqD6m6j/AUhMSEBASRDAfBgNVHSMEGDAWgBQk66Zm1IoNyX73qgCB 10 | iep/rwJNgDAKBggqgRzPVQGDdQNIADBFAiB2rcm1UI84yPYT5q6vjucBNPw01cHM 11 | 3/Hc9fhiuYPyHwIhAIiPPPj4XI2l98C+DBaqoZtSiwDK2IA6Q8lf9SmHdFPN 12 | -----END CERTIFICATE----- 13 | -------------------------------------------------------------------------------- /t/certs/client_sign.key: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGHAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBG0wawIBAQQgIsAr+s4TL7K4AQWO 3 | PbXrJfHoO5yE2V7oYQxUBsieOQOhRANCAARWXHPeJoU2USorOt/QJ5QG0tHCkL+9 4 | xj+UcwXTZS6QGlMIuIagIdGVCHEx/+WWzk2pfTLxwIDi41cb9fe6PnzX 5 | -----END PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /t/certs/etcd.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDrzCCApegAwIBAgIJAI3Meu/gJVTLMA0GCSqGSIb3DQEBCwUAMG4xCzAJBgNV 3 | BAYTAkNOMREwDwYDVQQIDAhaaGVqaWFuZzERMA8GA1UEBwwISGFuZ3pob3UxDTAL 4 | BgNVBAoMBHRlc3QxDTALBgNVBAsMBHRlc3QxGzAZBgNVBAMMEmV0Y2QuY2x1c3Rl 5 | ci5sb2NhbDAeFw0yMDEwMjgwMzMzMDJaFw0yMTEwMjgwMzMzMDJaMG4xCzAJBgNV 6 | BAYTAkNOMREwDwYDVQQIDAhaaGVqaWFuZzERMA8GA1UEBwwISGFuZ3pob3UxDTAL 7 | BgNVBAoMBHRlc3QxDTALBgNVBAsMBHRlc3QxGzAZBgNVBAMMEmV0Y2QuY2x1c3Rl 8 | ci5sb2NhbDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJ/qwxCR7g5S 9 | s9+VleopkLi5pAszEkHYOBpwF/hDeRdxU0I0e1zZTdTlwwPy2vf8m3kwoq6fmNCt 10 | tdUUXh5Wvgi/2OA8HBBzaQFQL1Av9qWwyES5cx6p0ZBwIrcXQIsl1XfNSUpQNTSS 11 | D44TGduXUIdeshukPvMvLWLezynf2/WlgVh/haWtDG99r/Gj3uBdjl0m/xGvKvIv 12 | NFy6EdgG9fkwcIalutjrUnGl9moGjwKYu4eXW2Zt5el0d1AHXUsqK4voe0p+U2Nz 13 | quDmvxteXWdlsz8o5kQT6a4DUtWhpPIfNj9oZfPRs3LhBFQ74N70kVxMOCdec1lU 14 | bnFzLIMGlz0CAwEAAaNQME4wHQYDVR0OBBYEFFHeljijrr+SPxlH5fjHRPcC7bv2 15 | MB8GA1UdIwQYMBaAFFHeljijrr+SPxlH5fjHRPcC7bv2MAwGA1UdEwQFMAMBAf8w 16 | DQYJKoZIhvcNAQELBQADggEBAG6NNTK7sl9nJxeewVuogCdMtkcdnx9onGtCOeiQ 17 | qvh5Xwn9akZtoLMVEdceU0ihO4wILlcom3OqHs9WOd6VbgW5a19Thh2toxKidHz5 18 | rAaBMyZsQbFb6+vFshZwoCtOLZI/eIZfUUMFqMXlEPrKru1nSddNdai2+zi5rEnM 19 | HCot43+3XYuqkvWlOjoi9cP+C4epFYrxpykVbcrtbd7TK+wZNiK3xtDPnVzjdNWL 20 | geAEl9xrrk0ss4nO/EreTQgS46gVU+tLC+b23m2dU7dcKZ7RDoiA9bdVc4a2IsaS 21 | 2MvLL4NZ2nUh8hAEHiLtGMAV3C6xNbEyM07hEpDW6vk6tqk= 22 | -----END CERTIFICATE----- 23 | -------------------------------------------------------------------------------- /t/certs/gm_ca.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIB3zCCAYWgAwIBAgIBADAKBggqgRzPVQGDdTBGMQswCQYDVQQGEwJBQTELMAkG 3 | A1UECAwCQkIxCzAJBgNVBAoMAkNDMQswCQYDVQQLDAJERDEQMA4GA1UEAwwHcm9v 4 | dCBjYTAeFw0yMjExMDIwMzE5MzZaFw0zMjEwMzAwMzE5MzZaMEYxCzAJBgNVBAYT 5 | AkFBMQswCQYDVQQIDAJCQjELMAkGA1UECgwCQ0MxCzAJBgNVBAsMAkREMRAwDgYD 6 | VQQDDAdyb290IGNhMFowFAYIKoEcz1UBgi0GCCqBHM9VAYItA0IABB+V1+bwQsP4 7 | IMZEVCu3LSekz9SIhxWVVtlqdQYZG55S46PmAqICzrO3KFJ/IPtMx9wKn3L6V5M8 8 | hAc/UwOAnKCjYzBhMB0GA1UdDgQWBBRV7bTJ6vT1fliZR42/+E+fEBfTSjAfBgNV 9 | HSMEGDAWgBRV7bTJ6vT1fliZR42/+E+fEBfTSjAPBgNVHRMBAf8EBTADAQH/MA4G 10 | A1UdDwEB/wQEAwIBhjAKBggqgRzPVQGDdQNIADBFAiEA1SGACV1wj158Spgh+HOW 11 | oOr7rTO2fR4cK9Zx7eUvmAECIHbKbsw5szaC/EH7CdsHdFgrj2tWaXiQUnx/rxM/ 12 | upAQ 13 | -----END CERTIFICATE----- 14 | -----BEGIN CERTIFICATE----- 15 | MIIB4TCCAYegAwIBAgIBATAKBggqgRzPVQGDdTBGMQswCQYDVQQGEwJBQTELMAkG 16 | A1UECAwCQkIxCzAJBgNVBAoMAkNDMQswCQYDVQQLDAJERDEQMA4GA1UEAwwHcm9v 17 | dCBjYTAeFw0yMjExMDIwMzE5MzZaFw0zMjEwMzAwMzE5MzZaMEUxCzAJBgNVBAYT 18 | AkFBMQswCQYDVQQIDAJCQjELMAkGA1UECgwCQ0MxCzAJBgNVBAsMAkREMQ8wDQYD 19 | VQQDDAZzdWIgY2EwWjAUBggqgRzPVQGCLQYIKoEcz1UBgi0DQgAElA5ey1dYWNkT 20 | zfvwcKEhX1vHL+Kjil+egM6QssbNrts2S0M07L77XDe1q2zPpHjo0MR05x862/tZ 21 | j87OgmEE0KNmMGQwHQYDVR0OBBYEFCTrpmbUig3JfveqAIGJ6n+vAk2AMB8GA1Ud 22 | IwQYMBaAFFXttMnq9PV+WJlHjb/4T58QF9NKMBIGA1UdEwEB/wQIMAYBAf8CAQAw 23 | DgYDVR0PAQH/BAQDAgGGMAoGCCqBHM9VAYN1A0gAMEUCIArKNHWYLmd3thQmJv89 24 | o0wr6O2q26WJuy6y7Eu14rdFAiEA7XNZ0JGMXPKiG5Hl7nmL8ooTrVhrmRrvs9No 25 | Y8rH88Y= 26 | -----END CERTIFICATE----- 27 | -------------------------------------------------------------------------------- /t/certs/incorrect.crt: -------------------------------------------------------------------------------- 1 | test not base64 encoded crt 2 | test not base64 encoded crt 3 | test not base64 encoded crt 4 | test not base64 encoded crt 5 | test not base64 encoded crt 6 | test not base64 encoded crt 7 | test not base64 encoded crt 8 | test not base64 encoded crt 9 | test not base64 encoded crt 10 | test not base64 encoded crt 11 | test not base64 encoded crt 12 | test not base64 encoded crt 13 | -------------------------------------------------------------------------------- /t/certs/incorrect.key: -------------------------------------------------------------------------------- 1 | test not base64 encoded key 2 | test not base64 encoded key 3 | test not base64 encoded key 4 | test not base64 encoded key 5 | test not base64 encoded key 6 | test not base64 encoded key 7 | test not base64 encoded key 8 | test not base64 encoded key 9 | test not base64 encoded key 10 | test not base64 encoded key 11 | test not base64 encoded key 12 | test not base64 encoded key 13 | -------------------------------------------------------------------------------- /t/certs/localhost_slapd_cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDcjCCAdoCFCS4ndwl6lusO7yj4zxbngp17nNUMA0GCSqGSIb3DQEBCwUAMFYx 3 | CzAJBgNVBAYTAkNOMRIwEAYDVQQIDAlHdWFuZ0RvbmcxDzANBgNVBAcMBlpodUhh 4 | aTEPMA0GA1UECgwGaXJlc3R5MREwDwYDVQQDDAh0ZXN0LmNvbTAgFw0yMzA4MDMw 5 | NjM3NDhaGA8yMTA1MDkyMjA2Mzc0OFowEzERMA8GA1UEAwwIdGVzdC5jb20wggEi 6 | MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC4mQik/vxL1bdjXcXWNT6DBVGL 7 | A87CeVYleNE5Fx5KROU5Y388h80VgSTmV3ytu9ZuNEB8hcZqmAttZXcipMyNm9PI 8 | vTXaDFaQVclYNJ27hy7rpaJ29WkeLKlUx/pRUpOCg3lbafSmURf5C234LZL1qe5O 9 | 0CIvY3uAzkGWMUE8ABYnef+ucULZPLa2+Y9wIx76oP5tfmcM/pQhDXt+GK/bZyat 10 | 1sUmEHCVC2gjvHoZO8T7n4ccpi5v06Klj8BKVxRlGVkO2w4hlDbNyh6FWKK31nF8 11 | BLu/TKF70xSOzX4OFNT6/GJ8R9AyeK52f6OzNmlNUY3UsMEeX8Y2qL4hNrFhAgMB 12 | AAEwDQYJKoZIhvcNAQELBQADggGBAL6g7NZfVTEVklJPmTFSqwQfuu0YXmIvUQIF 13 | jvbNOmwC+nHSq6yuJFC+83R/on/IPWrkP489bEVwqaBQXnZnIMOTjIk8k9elBm/N 14 | 1BBpzWUiKNp+HqRjPCanvRCIPUZ9hWpmJy6uzG6VodEtxZgJ7lsArj0AlOYlkHHa 15 | Ctmnl5g6H4m8sNACZaAixesb9wM8Slvn1zhpAeIYZsvIaBZOZnWuwHD1R7seh4ob 16 | BDhDaUfXOYb0VJaKNWnJ5ItPxh4/YMSuS7mG5o2ELnzWN6OeDEQrqKFW17qWLXko 17 | DXEfyrQnODDI+fXvasJhQ62hH33rQF/Q4yJQOEEr7gQUxtMYCxtGCumx2/5MFTuB 18 | E8sf8FykV5jGjwdwMHhPGAmhpMJwM6i65P9GwZguqVmeFv2l4eSTmMinURlkwaAw 19 | cx+LrigAxSKOCcnnnC6Uza1VShyDAuj+XKPglwwJd99UJlk1VG/9TXp3WZTOvSt+ 20 | KttglpiMHyqzCYcMDTGbjPm/UsjFTw== 21 | -----END CERTIFICATE----- 22 | -------------------------------------------------------------------------------- /t/certs/mtls_ca.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDNzCCAh8CFHIjXWyzoKYAEb8cJgTxRYdhZDu0MA0GCSqGSIb3DQEBDQUAMFgx 3 | CzAJBgNVBAYTAmNuMRIwEAYDVQQIDAlHdWFuZ0RvbmcxDzANBgNVBAcMBlpodUhh 4 | aTEWMBQGA1UEAwwNY2EuYXBpc2l4LmRldjEMMAoGA1UECwwDb3BzMB4XDTIyMTIw 5 | MTEwMTY0OFoXDTQyMTIwMzEwMTY0OFowWDELMAkGA1UEBhMCY24xEjAQBgNVBAgM 6 | CUd1YW5nRG9uZzEPMA0GA1UEBwwGWmh1SGFpMRYwFAYDVQQDDA1jYS5hcGlzaXgu 7 | ZGV2MQwwCgYDVQQLDANvcHMwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB 8 | AQC6QRtbK1qZg1gUuaVWn0M8hw73H360hH6EvHtEil8meni3W000HpCsi/JdDSr3 9 | tD6Z88O7x0IToPCT0NsAWA0B2LK1oshFkiyIXiq4CWgfwM9qd5GIwA71WUzJ6Jkq 10 | kz0r3M3/ogo0+Z7RKoKilvBinqVjTZhRpd63Dg5cLrgPBKFGUBMfRPmKSgwPSWfV 11 | V85SuHlzpcgcK09NHgSLu2DlFGK+lXGWTLLsrb4F0GAAwL/lk4kplcHK0IZCxfJJ 12 | puXynmoOmgWKcZcHipgv4+LY6+8K+8Lh9FF6ZXOuW7RLwTY1woLMKK2u40fG4C0I 13 | Wcyh+vzTivCrJ72pSC3rYGX5AgMBAAEwDQYJKoZIhvcNAQENBQADggEBAG6RnAvo 14 | AMQPog3TIAtIrXi1JPfJ5kuI26KOn/yUlVIoUjbqxkeELwmoUF/K4eg5sT6RX/8U 15 | 0gFVuBi5FZXfPZUt/JSN+fVRSoMP9d1K8ImVpu5gxdp5UZSINlCLvessMx9vafjQ 16 | EwDcACseel511LIe0rOlVvwHeM2P9pNIMfoexGP0U2U5ubZIO8Ye4ZbNieHYgNCN 17 | UgJpadvBOC8I3eML2hx79di5y4R1niRXhAd1IYnL9eK4xUoHwyMtl/1kXtq/nrXB 18 | 0njzpqb0GQg0badsF+7v+QM/zrbSSwDTzriCCTWSrd9ze4HYoRqCV6Dc3DjqmHq2 19 | j4wg2QntJBQWmSc= 20 | -----END CERTIFICATE----- 21 | -------------------------------------------------------------------------------- /t/certs/mtls_client.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDUzCCAjugAwIBAgIURw+Rc5FSNUQWdJD+quORtr9KaE8wDQYJKoZIhvcNAQEN 3 | BQAwWDELMAkGA1UEBhMCY24xEjAQBgNVBAgMCUd1YW5nRG9uZzEPMA0GA1UEBwwG 4 | Wmh1SGFpMRYwFAYDVQQDDA1jYS5hcGlzaXguZGV2MQwwCgYDVQQLDANvcHMwHhcN 5 | MjIxMjAxMTAxOTU3WhcNNDIwODE4MTAxOTU3WjBOMQswCQYDVQQGEwJjbjESMBAG 6 | A1UECAwJR3VhbmdEb25nMQ8wDQYDVQQHDAZaaHVIYWkxGjAYBgNVBAMMEWNsaWVu 7 | dC5hcGlzaXguZGV2MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzypq 8 | krsJ8MaqpS0kr2SboE9aRKOJzd6mY3AZLq3tFpio5cK5oIHkQLfeaaLcd4ycFcZw 9 | FTpxc+Eth6I0X9on+j4tEibc5IpDnRSAQlzHZzlrOG6WxcOza4VmfcrKqj27oodr 10 | oqXv05r/5yIoRrEN9ZXfA8n2OnjhkP+C3Q68L6dBtPpv+e6HaAuw8MvcsEo+MQwu 11 | cTZyWqWT2UzKVzToW29dHRW+yZGuYNWRh15X09VSvx+E0s+uYKzN0Cyef2C6VtBJ 12 | KmJ3NtypAiPqw7Ebfov2Ym/zzU9pyWPi3P1mYPMKQqUT/FpZSXm4iSy0a5qTYhkF 13 | rFdV1YuYYZL5YGl9aQIDAQABox8wHTAbBgNVHREEFDASghBhZG1pbi5hcGlzaXgu 14 | ZGV2MA0GCSqGSIb3DQEBDQUAA4IBAQBepRpwWdckZ6QdL5EuufYwU7p5SIqkVL/+ 15 | N4/l5YSjPoAZf/M6XkZu/PsLI9/kPZN/PX4oxjZSDH14dU9ON3JjxtSrebizcT8V 16 | aQ13TeW9KSv/i5oT6qBmj+V+RF2YCUhyzXdYokOfsSVtSlA1qMdm+cv0vkjYcImV 17 | l3L9nVHRPq15dY9sbmWEtFBWvOzqNSuQYax+iYG+XEuL9SPaYlwKRC6eS/dbXa1T 18 | PPWDQad2X/WmhxPzEHvjSl2bsZF1u0GEdKyhXWMOLCLiYIJo15G7bMz8cTUvkDN3 19 | 6WaWBd6bd2g13Ho/OOceARpkR/ND8PU78Y8cq+zHoOSqH+1aly5H 20 | -----END CERTIFICATE----- 21 | -------------------------------------------------------------------------------- /t/certs/mtls_server.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDYDCCAkigAwIBAgIURw+Rc5FSNUQWdJD+quORtr9KaE4wDQYJKoZIhvcNAQEN 3 | BQAwWDELMAkGA1UEBhMCY24xEjAQBgNVBAgMCUd1YW5nRG9uZzEPMA0GA1UEBwwG 4 | Wmh1SGFpMRYwFAYDVQQDDA1jYS5hcGlzaXguZGV2MQwwCgYDVQQLDANvcHMwHhcN 5 | MjIxMjAxMTAxNzI0WhcNNDIwODE4MTAxNzI0WjBbMQswCQYDVQQGEwJjbjESMBAG 6 | A1UECAwJR3VhbmdEb25nMQ8wDQYDVQQHDAZaaHVIYWkxGTAXBgNVBAMMEGFkbWlu 7 | LmFwaXNpeC5kZXYxDDAKBgNVBAsMA29wczCCASIwDQYJKoZIhvcNAQEBBQADggEP 8 | ADCCAQoCggEBAONlOihn9AtXWay72aPDFbwm2zJOe+5ngV1D3B4f2q+KlkAnjAPx 9 | 1GWO1buRDEALL8g5NfbZF3gU9v+wjsEsFK/Sn8ejtziVwJUFVmvRr+PCm/2DEARN 10 | Re1cp0cwRVQJAKLVFpy19ALlSSTQRoCAjLVXC8tEsIxrvN3DVVet9g6AxnPPd4oR 11 | LosDGQ+p+qbriQdx20gg5MHmjZX+/ByZq4BIQkshmQW2LnwxAS3xOpqPmFHmdn56 12 | RXw8JlyvYS3KRiGU3z59uph4wnIic4r/11Puj1LoGd+YtFJash6ZRU/rM6JSdPS7 13 | b53m8HdRcjGdBG+EnsqN67qZUWbGBntmu2cCAwEAAaMfMB0wGwYDVR0RBBQwEoIQ 14 | YWRtaW4uYXBpc2l4LmRldjANBgkqhkiG9w0BAQ0FAAOCAQEAMAxCZmKwWEDHuAzW 15 | PHJUyrdK1eos2UExmeq9TY8c7IluIMClTxS8ui3+7+oc6ZqffyrZL4jx7oe8Ua6V 16 | bat75H+OF05f9ziGJjJY5PM3wxOP1QvR7HePSkwBkNPhGOQf3bi7rQEhBuqhpRfr 17 | GfPmzKejaUm9m8IiHnFKxjTfQ7pm3hR8/+P9LKDO21i5Ua3ec+rKv0Y1jsCuv3t/ 18 | APMN7MTDsFqxudqbOG3dufOSe1E7qs16/ygTRvYpIe+kz4rldGWmo0joOrrti43T 19 | Oi1BAGaC3znJe3aaihr08c37NZ/A6WHiX+h5wBEdboOJc4Htytkicd8jBvU2Svjq 20 | dZS3wQ== 21 | -----END CERTIFICATE----- 22 | -------------------------------------------------------------------------------- /t/certs/ocsp/ecc_good.key: -------------------------------------------------------------------------------- 1 | -----BEGIN EC PARAMETERS----- 2 | BggqhkjOPQMBBw== 3 | -----END EC PARAMETERS----- 4 | -----BEGIN EC PRIVATE KEY----- 5 | MHcCAQEEIHMwGqSAcIFnsy8Sa6NxlSmGuOXV13SbZbZVIobN+3xboAoGCCqGSM49 6 | AwEHoUQDQgAEi5kKar++ZfkuoWulr2i3lJugSE3JL+vlQZPtqSMg4BcFXBmSfW+b 7 | 8SxCn1UwXzKtZmQYoWYSWjRkBcDKGOf0Pg== 8 | -----END EC PRIVATE KEY----- 9 | -------------------------------------------------------------------------------- /t/certs/ocsp/index.txt: -------------------------------------------------------------------------------- 1 | V 340109124821Z 1 unknown /C=CN/OU=Apache APISIX/CN=ocsp.test.com1 2 | V 340109125024Z 2 unknown /C=CN/OU=Apache APISIX/CN=ocsp.test.com2 3 | R 340109125151Z 240109125151Z 3 unknown /C=CN/OU=Apache APISIX/CN=ocsp-revoked.test.com 4 | V 340109125746Z 5 unknown /C=CN/OU=Apache APISIX/CN=ocsp test CA signer 5 | -------------------------------------------------------------------------------- /t/certs/ocsp/signer.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDqzCCAhOgAwIBAgIBBTANBgkqhkiG9w0BAQsFADBWMQswCQYDVQQGEwJDTjES 3 | MBAGA1UECAwJR3VhbmdEb25nMQ8wDQYDVQQHDAZaaHVIYWkxDzANBgNVBAoMBmly 4 | ZXN0eTERMA8GA1UEAwwIdGVzdC5jb20wHhcNMjQwMTEyMTUwMDU1WhcNMzQwMTA5 5 | MTUwMDU1WjBDMQswCQYDVQQGEwJDTjEWMBQGA1UECwwNQXBhY2hlIEFQSVNJWDEc 6 | MBoGA1UEAwwTb2NzcCB0ZXN0IENBIHNpZ25lcjCCASIwDQYJKoZIhvcNAQEBBQAD 7 | ggEPADCCAQoCggEBAML7FQ6P5418DkSmB6tG7Rlhc9C2rfuu+xDOZIUW2tm++6xS 8 | m4nh+9ZeDaOX5c9oBSN93VNaeKtd8ZAAaRjToJKFJbTQ+/ELGbUm8mISMIKrpebk 9 | BWp/S+VavLYZiGjj3FiFtIZ0+RL+z2XarQcnTqcR2qlYWVDTETzHmxJiDBJ82+if 10 | /L5VffS2RagCDUGuAfm/XcwI8pIkHNS6Bs4TL5ik7OTuX0e5YvkwCDiIhfzLm0fM 11 | a54Z4ImvLFfGtTQRILkTltr1RGioPRQAzvpy8zpSgux5Qd96HAT6hF/xlJKHCCkr 12 | xBiBUUtMX5fdw2AI6sUHig5v0u+bbU3nsMF9aiECAwEAAaMXMBUwEwYDVR0lBAww 13 | CgYIKwYBBQUHAwkwDQYJKoZIhvcNAQELBQADggGBALd3mJXvzu9TDTqfGZMkfGqD 14 | hv/GdV0uaPpNlPZyOkS31t+iLd5R1EZz8wKLegvOdm3uKA8NFx9uB7O6mWSneJ4R 15 | VbrcJnFzl5C/SbgWIAt/N0uujO8xuC5YWlHeig5IJc8pmnacJ4y7FhTVfsw1u93d 16 | evGyCIJ3TyYcZTDVuZruaW+xIRa+QJt3Q+CvkMn+aaxs1ji08ZjodGVu9+jsbb7f 17 | DLgl3FuLf8DlKqhRh+hoOPUTI496m3ZTozb7cs0TfHFPSL0pZ2Rdbz4WGHfX0LRF 18 | E8lweAsyd12OySr2PwiRY8m18t9HrPNbk7bAaVJLqehUjvB1Am5+Lgjicdy4HNhh 19 | gDlt5hjLV2criJpq9QmKz7Veu2V42FNJR7DumnJsbUjBVlh+rgN42j8QnPAqylZ4 20 | 4gcjhu1cGJd0miEN+TjzzqdZqjVvINepBR1j6pOF3fdfea8IFtJ1dzTpkU4Bq2P5 21 | CYqmKqhkAkEIYbwQ4fqehrcMrAAno3/ikW5PqxetnQ== 22 | -----END CERTIFICATE----- 23 | -------------------------------------------------------------------------------- /t/certs/openssl-test2.conf: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | [req] 18 | distinguished_name = req_distinguished_name 19 | x509_extensions = v3_req 20 | prompt = no 21 | 22 | [req_distinguished_name] 23 | C = CN 24 | ST = GuangDong 25 | L = ZhuHai 26 | O = iresty 27 | CN = test2.com 28 | 29 | [v3_req] 30 | subjectKeyIdentifier = hash 31 | authorityKeyIdentifier = keyid,issuer 32 | basicConstraints = CA:TRUE 33 | subjectAltName = @alt_names 34 | 35 | [alt_names] 36 | DNS.1 = test2.com 37 | DNS.2 = *.test2.com 38 | 39 | ## openssl genrsa -out test2.key 3072 40 | ## openssl req -new -x509 -key test2.key -sha256 -config openssl-test2.conf -out test2.crt -days 36500 41 | -------------------------------------------------------------------------------- /t/certs/openssl.conf: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | [req] 18 | distinguished_name = req_distinguished_name 19 | x509_extensions = v3_req 20 | prompt = no 21 | 22 | [req_distinguished_name] 23 | C = CN 24 | ST = GuangDong 25 | L = ZhuHai 26 | O = iresty 27 | CN = test.com 28 | 29 | [v3_req] 30 | subjectKeyIdentifier = hash 31 | authorityKeyIdentifier = keyid,issuer 32 | basicConstraints = CA:TRUE 33 | subjectAltName = @alt_names 34 | 35 | [alt_names] 36 | DNS.1 = test.com 37 | DNS.2 = *.test.com 38 | 39 | ## openssl genrsa -out apisix.key 3072 -nodes 40 | ## openssl req -new -x509 -key apisix.key -sha256 -config openssl.conf -out apisix.crt -days 36500 41 | -------------------------------------------------------------------------------- /t/certs/public.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PUBLIC KEY----- 2 | MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA79XYBopfnVMKxI533oU2 3 | VFQbEdSPtWRD+xSl73lHLVboGP1lSIZtnEj5AcTN2uDW6AYPiWL2iA3lEEsDTs7J 4 | BUXyl6pysBPfrqC8n/MOXKaD4e8U5GAHFiwHWg2WzHlfFSlFkLjzp0vPkDK+fQ4C 5 | lrd7shAyitB7use6DHcVCKuI4bFOoFbdI5sBGeyoD833g+ql9bRkH/vf8O+rPwHA 6 | M+47r1iv3lY3ex0P45PRd7U7rq8P8UIw6qOI1tiYuKlFJmjFdcwtYG0dctxWwgL1 7 | +7njrVQoWvuOTSsc9TDMhZkmmSsU3wXjaPxJpydck1C/w9ZLqsctKK5swYWhIcbc 8 | BQIDAQAB 9 | -----END PUBLIC KEY----- 10 | -------------------------------------------------------------------------------- /t/certs/server_1024.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIBrTCCARYCFGohAv7D46F+kSOf08X/MLwtazC7MA0GCSqGSIb3DQEBCwUAMBcx 3 | FTATBgNVBAMMDGNhLmxvY2FsaG9zdDAeFw0yMzA1MjIwMjQ3MzZaFw0zMzA1MTkw 4 | MjQ3MzZaMBQxEjAQBgNVBAMMCWxvY2FsaG9zdDCBnzANBgkqhkiG9w0BAQEFAAOB 5 | jQAwgYkCgYEA2YEV7+FWPl2R9EOSvi2iPyymiUnSaYhIaTuSoqRISOjCSmgrmKpJ 6 | yDN1Cg2hqBHPkWW8BuphpV405ja+94xvOEc0qcP/Or6zDhDfWcaoqxGRAcdwHDgQ 7 | XYMfOxlhwWCp5+vWKep3FPXpHamE09PqUbKWqIa/16aK/1sFR7Q+JJkCAwEAATAN 8 | BgkqhkiG9w0BAQsFAAOBgQCA5aSfk4lZjAEFQ9mWN7Z97b9bnwLw2bv4PgAhDtas 9 | 0IxIvhuwR4ZTFv+Pe4PNNNvfnMgTRUWFVpjywUX7Km+k9WFavrikPgAGEfzkR2HR 10 | WE4ETNuS7sGxczosqD+00An4lZ+58uYGEitUOJ6xO80NIhNnOGgo5N/d4fFUTyYH 11 | bw== 12 | -----END CERTIFICATE----- 13 | -------------------------------------------------------------------------------- /t/certs/server_1024.key: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBANmBFe/hVj5dkfRD 3 | kr4toj8spolJ0mmISGk7kqKkSEjowkpoK5iqScgzdQoNoagRz5FlvAbqYaVeNOY2 4 | vveMbzhHNKnD/zq+sw4Q31nGqKsRkQHHcBw4EF2DHzsZYcFgqefr1inqdxT16R2p 5 | hNPT6lGylqiGv9emiv9bBUe0PiSZAgMBAAECgYBvf5j7S4ymk9kKWsmS7FnMANuu 6 | bUWMC+zy5TMaZRUZKxjOg/A1ZrZEBvzslmhUfCzn4DsvYF+GInEDwvTKehdY07I+ 7 | +hpv1M9Wa7v12ofRWNvZjsbMHfiWM/pFBZFYryV4sQ4qHFRj3TKgXu3pZWPx41wn 8 | ayMUtxYRR3Lez4UiMQJBAP31OIC65xbWGr1W/YJ6IwOPFBgyB6O6qFTcR/lAdJ6H 9 | 6MVVs8XEWC4o/ZTk8RGog2nWzVsRCN2pqQUGUHBGRE8CQQDbQNL6eGbsuSxM1uUS 10 | PjrAs5t9rfrwpx41ubjRoGIukEYeX1YXDf4WICe/51vE3jvVfVvFOJuvGoO9QqzB 11 | LgaXAkEAtyRG0R74VBGnSvAW9idaZNCj7yb1N2/+wOPyy59d+o2MofLCKFcGOJO6 12 | +8t2xgM+ce9EPO419JTLnSIGlFE4JQJAGueHfCjOKHpIj11HWse8Ge1wRSnWQzWe 13 | pWUW4tJVefVGRW/ZdpbG+RwVBJ11S2Eh4n6xhi/+GqycQdsuq73kHQJBAPCknTOP 14 | KpiH5qtKw84nsF+RkWZQ6BhzvP5OuW4avQBx1jQUjpjUhOWfctFH7MLI92Ti+iUS 15 | MYi+HgfT9Lx4kbc= 16 | -----END PRIVATE KEY----- 17 | -------------------------------------------------------------------------------- /t/certs/server_enc.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIB2DCCAX6gAwIBAgIBAzAKBggqgRzPVQGDdTBFMQswCQYDVQQGEwJBQTELMAkG 3 | A1UECAwCQkIxCzAJBgNVBAoMAkNDMQswCQYDVQQLDAJERDEPMA0GA1UEAwwGc3Vi 4 | IGNhMB4XDTIyMTEwMjAzMTkzNloXDTMyMTAzMDAzMTkzNlowSTELMAkGA1UEBhMC 5 | QUExCzAJBgNVBAgMAkJCMQswCQYDVQQKDAJDQzELMAkGA1UECwwCREQxEzARBgNV 6 | BAMMCnNlcnZlciBlbmMwWjAUBggqgRzPVQGCLQYIKoEcz1UBgi0DQgAED+MQrLrZ 7 | 9PbMmz/44Kb73Qc7FlMs7u034XImjJREBAn1KzZ7jqcYfCiV/buhmu1sLhMXnB69 8 | mERtf1tAaXcgIaNaMFgwCQYDVR0TBAIwADALBgNVHQ8EBAMCAzgwHQYDVR0OBBYE 9 | FBxHDo0gHhMoYkDeHWySTIJy5BZpMB8GA1UdIwQYMBaAFCTrpmbUig3JfveqAIGJ 10 | 6n+vAk2AMAoGCCqBHM9VAYN1A0gAMEUCIHtXgpOxcb3mZv2scRZHZz5YGFr45dfk 11 | VfLkF9BkrB/xAiEA8EeUg7nCFfgHzrfgB7v0wgN1Hrgj8snTUO6IDfkBKYM= 12 | -----END CERTIFICATE----- 13 | -------------------------------------------------------------------------------- /t/certs/server_enc.key: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGHAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBG0wawIBAQQgPJQ040ba9lVszMF0 3 | 7S7pzqdxyIMc2fXKr6EsU0vRk2ahRANCAAQP4xCsutn09sybP/jgpvvdBzsWUyzu 4 | 7TfhciaMlEQECfUrNnuOpxh8KJX9u6Ga7WwuExecHr2YRG1/W0BpdyAh 5 | -----END PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /t/certs/server_sign.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIB2TCCAX+gAwIBAgIBAjAKBggqgRzPVQGDdTBFMQswCQYDVQQGEwJBQTELMAkG 3 | A1UECAwCQkIxCzAJBgNVBAoMAkNDMQswCQYDVQQLDAJERDEPMA0GA1UEAwwGc3Vi 4 | IGNhMB4XDTIyMTEwMjAzMTkzNloXDTMyMTAzMDAzMTkzNlowSjELMAkGA1UEBhMC 5 | QUExCzAJBgNVBAgMAkJCMQswCQYDVQQKDAJDQzELMAkGA1UECwwCREQxFDASBgNV 6 | BAMMC3NlcnZlciBzaWduMFowFAYIKoEcz1UBgi0GCCqBHM9VAYItA0IABKGSiyHA 7 | 5oIeT13uNL3yxK+t9rKhAMHTzDTQA01ZylHYLn6XdksWugZsP6tTx/2+17NmRkaH 8 | H3wztf6ciD3WZnCjWjBYMAkGA1UdEwQCMAAwCwYDVR0PBAQDAgbAMB0GA1UdDgQW 9 | BBT28BTySSlomaLtnuex4LvaY8tM1TAfBgNVHSMEGDAWgBQk66Zm1IoNyX73qgCB 10 | iep/rwJNgDAKBggqgRzPVQGDdQNIADBFAiB4qGB+bD47KxSfSgqcedXVTd+JlL4f 11 | 174uhGLSzNkOZwIhAI33LdJlaw+60YlZqQxzffI+gbqXpSN82+3W4vAsONN0 12 | -----END CERTIFICATE----- 13 | -------------------------------------------------------------------------------- /t/certs/server_sign.key: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGHAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBG0wawIBAQQgMjFhLon1CAQdzFWt 3 | 0Mre0juQiCDbXOY8ljWqSzQN9EehRANCAAShkoshwOaCHk9d7jS98sSvrfayoQDB 4 | 08w00ANNWcpR2C5+l3ZLFroGbD+rU8f9vtezZkZGhx98M7X+nIg91mZw 5 | -----END PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /t/certs/test-dot.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIC+zCCAeOgAwIBAgIUWUtIDbrU8QF90OXlMKyClPRNRcgwDQYJKoZIhvcNAQEL 3 | BQAwETEPMA0GA1UEAwwGUk9PVENBMCAXDTI0MDcxNzE2MDcyM1oYDzIxMjQwNjIz 4 | MTYwNzIzWjAYMRYwFAYDVQQDDA13d3cudGVzdC5jb20uMIIBIjANBgkqhkiG9w0B 5 | AQEFAAOCAQ8AMIIBCgKCAQEApkX5NgwwEC/brmrUAfxSMGMaYOzjx+3BlCC23sLR 6 | 0uQ1+KMXt/Pd2QJVqREjEAiwXCMuHbB0qWD5985SfsjeRJJ8rc8CzJfcb7QESKfK 7 | GdLaD8LsyAAg+Rxm0QyVFGrLJ82sjbEimLGCkLMpYsePxEDEifKPp3Z9bRUFT0zm 8 | xcUEXojw5pzjrjIvfqVenWNP716s7bSdOFoc4RBlAdEI3pFUasLF9Lovz7BJLvtY 9 | aoqgCNfb78C6zreDLswET5/338AVf9yPYc5HOthmygxkYTniK47/fOW64RQKXQ2X 10 | EtBiIzN6dSXfTCXSpvow5XIR02rLoxsVEEwM9ODgUAJg6QIDAQABo0IwQDAdBgNV 11 | HQ4EFgQUAHYNW6/hFM+Bqd2KNBXbLgJLaxcwHwYDVR0jBBgwFoAUjwSzlti+ag+f 12 | BzoRa0wZbMaGh10wDQYJKoZIhvcNAQELBQADggEBAA1HfiDtHZV8sxJjasnNSM9f 13 | 6XTRCjT+DcABXm7k/Dmb8q5rpyqYwkUfadgAbmPx6T/dC4z7LblkcTkwD7azpkNE 14 | fXY3Hx4qxSVSbSOHWnaSOX/8BRiPbSQNWGyTGh9AK/Vp/VJU2cDPqFbjQKHFq3ZI 15 | w3GnRDerdA8vm5qzJ5/9wMF2ZsmnMiV3zX0Xisbzx/dponz6ktfygE3bk8Pb4wKt 16 | D0EjbnLIXwyHv1czJrcRq0Y8irWaTY97vdff/J2aO9582zFNx6AnsU3+6fGsDyrO 17 | ss+ggKDLK+aOBKroTNb3TgdPyPOgobUwLByFdKT/zTtWbkqyYMZzBme2SD4TWok= 18 | -----END CERTIFICATE----- 19 | -------------------------------------------------------------------------------- /t/certs/vector_logs_ca.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDazCCAlOgAwIBAgIUa34rzhtYT21pC8NwNIYf3phFciQwDQYJKoZIhvcNAQEL 3 | BQAwRTELMAkGA1UEBhMCVVMxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM 4 | GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAeFw0yMzA0MjQxMzE2NDNaFw0yMzA1 5 | MjQxMzE2NDNaMEUxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApTb21lLVN0YXRlMSEw 6 | HwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwggEiMA0GCSqGSIb3DQEB 7 | AQUAA4IBDwAwggEKAoIBAQC84FXe/8ofZB2rj5TPHasXdiBEbTCv04ti/lV92WOC 8 | MrHLKibI2+kI3YRQXaR5/1F2bXfROUhdRgkB8NOSM4WbaD1mtr/7mW2Tatxplxsp 9 | 1s0zmHHl5v0VYwBahcUs6nlSe19dgfrj4s0Wn7p4E7iSq/UDAs+We/dQowusQTVs 10 | Q2ZhjDlFY22CV/oyCYsNq3ORRgwZRm9cmVmUUF7GX70yjT1KvLkFjc7y1vwi8XJY 11 | ADhw/hjtEzAOkxdUai84+jyhpQYQWMOgrlP1DXnZw1bNKqo6NTkMzfNCS+ul5PMs 12 | Noyxcw1iyGW6Bm81LANsnMM7BLhPQATShmW7O83WUJ4vAgMBAAGjUzBRMB0GA1Ud 13 | DgQWBBRdFCb//WETC8mDxg/75e+RoVNoDjAfBgNVHSMEGDAWgBRdFCb//WETC8mD 14 | xg/75e+RoVNoDjAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQC8 15 | cKOagO+SVJBMzJppm4uGdSM6TJ2wbkn6K5/eOtZmYdKtW6fkAC9tf0DR7dVP1DUk 16 | 24lS+atR1Oe7SukxJyd+NafCZ61uf+zrMC3wgBGnufrbPWaDDVxi6c3I0I+WNaCk 17 | DHHY+9UtjvSboWKG1yuEExPN6aDeytbpscG1DNi7l96Ac3Yzs007SFljA7NBrf65 18 | So9SZYSdJVC/JrOnfK2HZPeAqvoyUO5JsCh02q5AskxTqfBGy6VUVQO5mN8bxYHV 19 | GG5XD46rpwQYNT2bWWRF5d0bRv7ecNkCoupm6hCQROg4FZHGPnqHGqDTcgCLZ59e 20 | 8rHh2gsDMMNYvSMTi+0N 21 | -----END CERTIFICATE----- 22 | -------------------------------------------------------------------------------- /t/certs/vector_logs_server.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDETCCAfkCFEynFsv9L6bzyJJVmjoaKuCoYZwkMA0GCSqGSIb3DQEBCwUAMEUx 3 | CzAJBgNVBAYTAlVTMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRl 4 | cm5ldCBXaWRnaXRzIFB0eSBMdGQwHhcNMjMwNDI0MTMxNzAwWhcNMjQwNDIzMTMx 5 | NzAwWjBFMQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UE 6 | CgwYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOC 7 | AQ8AMIIBCgKCAQEAtGvdwIHuk6k3vphBnGIdtlZ/6ImHSVBsNHz5y6E9X31a88EH 8 | wtnxT5Ang8K6Y4pQt+LsjhI0NdUY2skiKDnGpo2IkaFAn9nERQ1GJstIHr7ltal6 9 | ureV4n/Na/T6n6GPnwD4+P86XvpIwFtJZujYr2tUl4qm/t1P7zHjB/UsF9G6H/aN 10 | oCsDkG3a7+b8uWAZLkyHS4RLF3pG6pDWns8/vC/P9nTT7o3Ha2DV7TPaY0hlsXf6 11 | 0/SCSm7EonnVVwhnKyy5Z0FsCXClg7weN4ZKPb+ypF0o0/LLqw481lbSfAu5kpjE 12 | r/rHpsQonRbQrcrD9xovXmw2vdk/2jJn6wpFQwIDAQABMA0GCSqGSIb3DQEBCwUA 13 | A4IBAQBv9e8gsD75iySf+pam11JUujjL0gpqdzY72CKo4abYX5NZhMiBs6OCKicz 14 | EedR/EgRY+26RMThKC0zSy3hOO6SKPw03FLsV2B8ooDzaOa4l3F/E6NQ5yNDoK+K 15 | lT1G85fW3bQWtNoB8aa/r1/eExZy3kZF8GSl+/BvwLtOwtGXMO0Y1URo81Dl0da+ 16 | F2yv6ZGziEYIWYTUK3kxOpe0Sl4wHz33olWoli2qpYlSndUUIWoVYJr4gtH/xTEV 17 | GHxdOhxcfyMNi6ceYG4HGWyKRFR9TJAU+PRBxHI8UUpg+BG3/DQmfA5+7xgAws37 18 | dEVsm725hta8vPUSMSAdRrArBlh+ 19 | -----END CERTIFICATE----- 20 | -------------------------------------------------------------------------------- /t/chaos/e2e.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package e2e 19 | 20 | import ( 21 | _ "github.com/apache/apisix/t/chaos/delayetcd" 22 | _ "github.com/apache/apisix/t/chaos/killetcd" 23 | ) 24 | 25 | func runChaos() {} 26 | -------------------------------------------------------------------------------- /t/chaos/e2e_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package e2e 19 | 20 | import ( 21 | "testing" 22 | 23 | "github.com/onsi/ginkgo" 24 | "github.com/onsi/gomega" 25 | ) 26 | 27 | func TestRunChaos(t *testing.T) { 28 | runChaos() 29 | gomega.RegisterFailHandler(ginkgo.Fail) 30 | ginkgo.RunSpecs(t, "chaos test suites") 31 | } 32 | -------------------------------------------------------------------------------- /t/chaos/kubernetes/service.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | apiVersion: v1 19 | kind: Service 20 | metadata: 21 | name: apisix-gw-lb 22 | # namespace: default 23 | labels: 24 | app: apisix-gw # useful for service discovery, for example, prometheus-operator. 25 | spec: 26 | ports: 27 | - name: http 28 | port: 9080 29 | protocol: TCP 30 | targetPort: 9080 31 | - name: https 32 | port: 9443 33 | protocol: TCP 34 | targetPort: 9443 35 | - name: admin-port 36 | port: 9180 37 | protocol: TCP 38 | targetPort: 9180 39 | selector: 40 | app: apisix-gw 41 | type: NodePort 42 | externalTrafficPolicy: Local 43 | # sessionAffinity: None 44 | -------------------------------------------------------------------------------- /t/cli/common.sh: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | # 'make init' operates scripts and related configuration files in the current directory 19 | # The 'apisix' command is a command in the /usr/local/apisix, 20 | # and the configuration file for the operation is in the /usr/local/apisix/conf 21 | 22 | set -ex 23 | 24 | check_failure() { 25 | cat logs/error.log 26 | } 27 | 28 | clean_up() { 29 | if [ $? -gt 0 ]; then 30 | check_failure 31 | fi 32 | make stop || true 33 | git checkout conf/config.yaml 34 | } 35 | 36 | trap clean_up EXIT 37 | 38 | exit_if_not_customed_nginx() { 39 | openresty -V 2>&1 | grep apisix-nginx-module || exit 0 40 | } 41 | 42 | rm logs/error.log || true # clear previous error log 43 | unset APISIX_PROFILE 44 | -------------------------------------------------------------------------------- /t/cli/test_makefile.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # 4 | # Licensed to the Apache Software Foundation (ASF) under one or more 5 | # contributor license agreements. See the NOTICE file distributed with 6 | # this work for additional information regarding copyright ownership. 7 | # The ASF licenses this file to You under the Apache License, Version 2.0 8 | # (the "License"); you may not use this file except in compliance with 9 | # the License. You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # 19 | 20 | . ./t/cli/common.sh 21 | 22 | make run 23 | 24 | echo " 25 | deployment: 26 | admin: 27 | admin_listen: 28 | ip: 127.0.0.2 29 | port: 9181 30 | apisix: 31 | enable_admin: true 32 | " > conf/config.yaml 33 | 34 | make reload 35 | make stop 36 | 37 | if ! grep "listen 127.0.0.2:9181;" conf/nginx.conf > /dev/null; then 38 | echo "failed: regenerate nginx conf in 'make reload'" 39 | exit 1 40 | fi 41 | 42 | echo "passed: regenerate nginx conf in 'make reload'" 43 | -------------------------------------------------------------------------------- /t/cli/test_proxy_mirror_timeout.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # 4 | # Licensed to the Apache Software Foundation (ASF) under one or more 5 | # contributor license agreements. See the NOTICE file distributed with 6 | # this work for additional information regarding copyright ownership. 7 | # The ASF licenses this file to You under the Apache License, Version 2.0 8 | # (the "License"); you may not use this file except in compliance with 9 | # the License. You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # 19 | 20 | . ./t/cli/common.sh 21 | 22 | echo ' 23 | plugin_attr: 24 | proxy-mirror: 25 | timeout: 26 | connect: 2000ms 27 | read: 2s 28 | send: 2000ms 29 | ' > conf/config.yaml 30 | 31 | make init 32 | 33 | if ! grep "proxy_connect_timeout 2000ms;" conf/nginx.conf > /dev/null; then 34 | echo "failed: proxy_connect_timeout not found in nginx.conf" 35 | exit 1 36 | fi 37 | 38 | if ! grep "proxy_read_timeout 2s;" conf/nginx.conf > /dev/null; then 39 | echo "failed: proxy_read_timeout not found in nginx.conf" 40 | exit 1 41 | fi 42 | 43 | echo "passed: proxy timeout configuration is validated" 44 | -------------------------------------------------------------------------------- /t/core/profile.t: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | BEGIN { 18 | $ENV{APISIX_PROFILE} = "dev"; 19 | } 20 | 21 | use t::APISIX 'no_plan'; 22 | 23 | repeat_each(1); 24 | no_long_string(); 25 | no_root_location(); 26 | 27 | run_tests; 28 | 29 | __DATA__ 30 | 31 | === TEST 1: set env "APISIX_PROFILE" 32 | --- request 33 | GET /t 34 | --- error_code: 404 35 | 36 | 37 | 38 | === TEST 2: set env "APISIX_PROFILE" to Empty String 39 | --- config 40 | location /t { 41 | content_by_lua_block { 42 | local profile = require("apisix.core.profile") 43 | profile.apisix_home = "./test/" 44 | profile.profile = "" 45 | local local_conf_path = profile:yaml_path("config") 46 | ngx.say(local_conf_path) 47 | } 48 | } 49 | --- request 50 | GET /t 51 | --- response_body 52 | ./test/conf/config.yaml 53 | -------------------------------------------------------------------------------- /t/core/uid.t: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | use t::APISIX 'no_plan'; 18 | 19 | repeat_each(1); 20 | no_long_string(); 21 | no_root_location(); 22 | log_level("info"); 23 | 24 | run_tests; 25 | 26 | __DATA__ 27 | 28 | === TEST 1: sanity 29 | --- config 30 | location /t { 31 | content_by_lua_block { 32 | local core = require("apisix.core") 33 | 34 | ngx.say("uid: ", core.id.get()) 35 | } 36 | } 37 | --- request 38 | GET /t 39 | --- response_body_like eval 40 | qr/uid: [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/ 41 | --- error_log 42 | not found apisix uid, generate a new one 43 | -------------------------------------------------------------------------------- /t/coredns/Corefile: -------------------------------------------------------------------------------- 1 | test.local { 2 | file db.test.local 3 | log 4 | } 5 | -------------------------------------------------------------------------------- /t/fake-plugin-exit.lua: -------------------------------------------------------------------------------- 1 | -- 2 | -- Licensed to the Apache Software Foundation (ASF) under one or more 3 | -- contributor license agreements. See the NOTICE file distributed with 4 | -- this work for additional information regarding copyright ownership. 5 | -- The ASF licenses this file to You under the Apache License, Version 2.0 6 | -- (the "License"); you may not use this file except in compliance with 7 | -- the License. You may obtain a copy of the License at 8 | -- 9 | -- http://www.apache.org/licenses/LICENSE-2.0 10 | -- 11 | -- Unless required by applicable law or agreed to in writing, software 12 | -- distributed under the License is distributed on an "AS IS" BASIS, 13 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | -- See the License for the specific language governing permissions and 15 | -- limitations under the License. 16 | -- 17 | local core = require("apisix.core") 18 | 19 | local schema = { 20 | type = "object", 21 | properties = { 22 | } 23 | } 24 | 25 | 26 | local plugin_name = "uri-blocker" 27 | 28 | local _M = { 29 | version = 0.1, 30 | priority = 2900, 31 | name = plugin_name, 32 | schema = schema, 33 | } 34 | 35 | 36 | function _M.check_schema(conf) 37 | return true 38 | end 39 | 40 | 41 | function _M.rewrite(conf, ctx) 42 | core.respond.exit(400) 43 | end 44 | 45 | 46 | return _M 47 | -------------------------------------------------------------------------------- /t/fuzzing/requirements.txt: -------------------------------------------------------------------------------- 1 | psutil==5.8.0 2 | typing==3.7.4.3 3 | boofuzz==0.4.0 4 | PyYAML==5.4.1 5 | -------------------------------------------------------------------------------- /t/grpc_server_example/echo.pb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/t/grpc_server_example/echo.pb -------------------------------------------------------------------------------- /t/grpc_server_example/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/api7/grpc_server_example 2 | 3 | go 1.11 4 | 5 | require ( 6 | github.com/golang/protobuf v1.5.2 7 | golang.org/x/net v0.7.0 8 | google.golang.org/grpc v1.53.0 9 | google.golang.org/protobuf v1.33.0 10 | ) 11 | -------------------------------------------------------------------------------- /t/grpc_server_example/proto.pb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/apisix/f1630d2f2b3f834c8d6b1c172e79755962ba8493/t/grpc_server_example/proto.pb -------------------------------------------------------------------------------- /t/grpc_server_example/proto/echo.proto: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed to the Apache Software Foundation (ASF) under one or more 3 | // contributor license agreements. See the NOTICE file distributed with 4 | // this work for additional information regarding copyright ownership. 5 | // The ASF licenses this file to You under the Apache License, Version 2.0 6 | // (the "License"); you may not use this file except in compliance with 7 | // the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | 18 | syntax = "proto3"; 19 | 20 | package echo; 21 | option go_package = "./proto"; 22 | 23 | import "google/protobuf/struct.proto"; 24 | 25 | service Echo { 26 | rpc EchoStruct (StructRequest) returns (StructReply) {} 27 | } 28 | 29 | message StructRequest { 30 | google.protobuf.Struct data = 1; 31 | } 32 | 33 | message StructReply { 34 | google.protobuf.Struct data = 1; 35 | } 36 | -------------------------------------------------------------------------------- /t/grpc_server_example/proto/import.proto: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed to the Apache Software Foundation (ASF) under one or more 3 | // contributor license agreements. See the NOTICE file distributed with 4 | // this work for additional information regarding copyright ownership. 5 | // The ASF licenses this file to You under the Apache License, Version 2.0 6 | // (the "License"); you may not use this file except in compliance with 7 | // the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | 18 | syntax = "proto3"; 19 | 20 | package pkg; 21 | option go_package = "./proto"; 22 | 23 | message User { 24 | string name = 1; 25 | } 26 | 27 | message Response { 28 | string body = 1; 29 | } 30 | -------------------------------------------------------------------------------- /t/grpc_server_example/proto/src.proto: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed to the Apache Software Foundation (ASF) under one or more 3 | // contributor license agreements. See the NOTICE file distributed with 4 | // this work for additional information regarding copyright ownership. 5 | // The ASF licenses this file to You under the Apache License, Version 2.0 6 | // (the "License"); you may not use this file except in compliance with 7 | // the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | 18 | syntax = "proto3"; 19 | 20 | package helloworld; 21 | option go_package = "./proto"; 22 | 23 | import "proto/import.proto"; 24 | 25 | service TestImport { 26 | rpc Run (Request) returns (pkg.Response) {} 27 | } 28 | 29 | message Request { 30 | pkg.User user = 1; 31 | string body = 2; 32 | } 33 | -------------------------------------------------------------------------------- /t/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | import type { Config } from 'jest'; 18 | 19 | const config: Config = { 20 | coverageProvider: 'v8', 21 | testEnvironment: 'node', 22 | testRegex: '(/__tests__/.*|(\\.|/)(spec|test))\\.(ts|mts)$', 23 | transform: { 24 | '^.+\\.ts$': ['ts-jest', { useESM: false }], 25 | '^.+\\.mts$': ['ts-jest', { useESM: true, tsconfig: 'tsconfig.esm.json' }], 26 | }, 27 | extensionsToTreatAsEsm: ['.mts'], 28 | moduleFileExtensions: ['ts', 'mts', 'js'], 29 | }; 30 | 31 | export default config; 32 | -------------------------------------------------------------------------------- /t/kubernetes/configs/account.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | kind: ServiceAccount 19 | apiVersion: v1 20 | metadata: 21 | name: apisix-test 22 | namespace: default 23 | --- 24 | kind: ClusterRole 25 | apiVersion: rbac.authorization.k8s.io/v1 26 | metadata: 27 | name: apisix-test 28 | rules: 29 | - apiGroups: [ "" ] 30 | resources: [ endpoints ] 31 | verbs: [ get,list,watch ] 32 | --- 33 | apiVersion: rbac.authorization.k8s.io/v1 34 | kind: ClusterRoleBinding 35 | metadata: 36 | name: apisix-test 37 | roleRef: 38 | apiGroup: rbac.authorization.k8s.io 39 | kind: ClusterRole 40 | name: apisix-test 41 | subjects: 42 | - kind: ServiceAccount 43 | name: apisix-test 44 | namespace: default 45 | -------------------------------------------------------------------------------- /t/kubernetes/configs/endpoint.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | kind: Namespace 19 | apiVersion: v1 20 | metadata: 21 | name: ns-a 22 | --- 23 | 24 | kind: Endpoints 25 | apiVersion: v1 26 | metadata: 27 | name: ep 28 | namespace: ns-a 29 | subsets: [ ] 30 | --- 31 | 32 | kind: Namespace 33 | apiVersion: v1 34 | metadata: 35 | name: ns-b 36 | --- 37 | 38 | kind: Endpoints 39 | apiVersion: v1 40 | metadata: 41 | name: ep 42 | namespace: ns-b 43 | subsets: [ ] 44 | --- 45 | 46 | kind: Namespace 47 | apiVersion: v1 48 | metadata: 49 | name: ns-c 50 | --- 51 | 52 | kind: Endpoints 53 | apiVersion: v1 54 | metadata: 55 | name: ep 56 | namespace: ns-c 57 | subsets: [ ] 58 | --- 59 | -------------------------------------------------------------------------------- /t/kubernetes/configs/kind.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | kind: Cluster 19 | apiVersion: kind.x-k8s.io/v1alpha4 20 | networking: 21 | apiServerAddress: 127.0.0.1 22 | apiServerPort: 6443 23 | -------------------------------------------------------------------------------- /t/lib/apisix/plugins/prometheus/exporter.lua: -------------------------------------------------------------------------------- 1 | -- 2 | -- Licensed to the Apache Software Foundation (ASF) under one or more 3 | -- contributor license agreements. See the NOTICE file distributed with 4 | -- this work for additional information regarding copyright ownership. 5 | -- The ASF licenses this file to You under the Apache License, Version 2.0 6 | -- (the "License"); you may not use this file except in compliance with 7 | -- the License. You may obtain a copy of the License at 8 | -- 9 | -- http://www.apache.org/licenses/LICENSE-2.0 10 | -- 11 | -- Unless required by applicable law or agreed to in writing, software 12 | -- distributed under the License is distributed on an "AS IS" BASIS, 13 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | -- See the License for the specific language governing permissions and 15 | -- limitations under the License. 16 | -- 17 | 18 | local core = require("apisix.core") 19 | local _M = {} 20 | 21 | 22 | function _M.http_init() 23 | return true 24 | end 25 | 26 | 27 | function _M.stream_init() 28 | return true 29 | end 30 | 31 | 32 | function _M.export_metrics() 33 | local process_type = require("ngx.process").type() 34 | core.log.info("process type: ", process_type) 35 | return core.response.exit(200) 36 | end 37 | 38 | 39 | return _M 40 | -------------------------------------------------------------------------------- /t/lib/dubbo-backend/dubbo-backend-provider/src/main/resources/dubbo.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | dubbo.application.qos.enable=false 18 | -------------------------------------------------------------------------------- /t/lib/dubbo-backend/dubbo-backend-provider/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | ###set log levels### 18 | log4j.rootLogger=info, stdout 19 | ###output to the console### 20 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 21 | log4j.appender.stdout.Target=System.out 22 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 23 | log4j.appender.stdout.layout.ConversionPattern=[%d{dd/MM/yy HH:mm:ss:SSS z}] %t %5p %c{2}: %m%n 24 | -------------------------------------------------------------------------------- /t/lib/dubbo-serialization-backend/dubbo-serialization-backend-interface/src/main/java/org/apache/dubbo/backend/DubboSerializationTestService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.dubbo.backend; 18 | 19 | public interface DubboSerializationTestService { 20 | 21 | PoJo testPoJo(PoJo input); 22 | 23 | PoJo[] testPoJos(PoJo[] input); 24 | 25 | void testVoid(); 26 | 27 | void testFailure(); 28 | 29 | void testTimeout(); 30 | } 31 | -------------------------------------------------------------------------------- /t/lib/dubbo-serialization-backend/dubbo-serialization-backend-provider/src/main/resources/dubbo.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | dubbo.application.qos.enable=false 18 | -------------------------------------------------------------------------------- /t/lib/dubbo-serialization-backend/dubbo-serialization-backend-provider/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | ###set log levels### 18 | log4j.rootLogger=info, stdout 19 | ###output to the console### 20 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 21 | log4j.appender.stdout.Target=System.out 22 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 23 | log4j.appender.stdout.layout.ConversionPattern=[%d{dd/MM/yy HH:mm:ss:SSS z}] %t %5p %c{2}: %m%n 24 | -------------------------------------------------------------------------------- /t/lib/dubbo-serialization-backend/dubbo-serialization-backend-provider/target/classes/dubbo.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | dubbo.application.qos.enable=false 18 | -------------------------------------------------------------------------------- /t/lib/dubbo-serialization-backend/dubbo-serialization-backend-provider/target/classes/log4j.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | ###set log levels### 18 | log4j.rootLogger=info, stdout 19 | ###output to the console### 20 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 21 | log4j.appender.stdout.Target=System.out 22 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 23 | log4j.appender.stdout.layout.ConversionPattern=[%d{dd/MM/yy HH:mm:ss:SSS z}] %t %5p %c{2}: %m%n 24 | -------------------------------------------------------------------------------- /t/lib/etcd.proto: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | syntax = "proto3"; 19 | package etcdserverpb; 20 | 21 | message StatusRequest { 22 | } 23 | 24 | message StatusResponse { 25 | // version is the cluster protocol version used by the responding member. 26 | string version = 2; 27 | } 28 | 29 | service Maintenance { 30 | // Status gets the status of the member. 31 | rpc Status(StatusRequest) returns (StatusResponse) {} 32 | } 33 | -------------------------------------------------------------------------------- /t/node/plugin.t: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | use t::APISIX 'no_plan'; 18 | 19 | add_block_preprocessor(sub { 20 | my ($block) = @_; 21 | 22 | if (!$block->request) { 23 | $block->set_value("request", "GET /t"); 24 | } 25 | 26 | $block; 27 | }); 28 | 29 | run_tests; 30 | 31 | __DATA__ 32 | 33 | === TEST 1: set custom log format 34 | --- extra_init_by_lua 35 | local exp = require("apisix.plugins.example-plugin") 36 | exp.destroy = function() 37 | ngx.log(ngx.WARN, "destroy method called") 38 | end 39 | --- config 40 | location /t { 41 | return 200 "dummy"; 42 | } 43 | --- shutdown_error_log 44 | destroy method called 45 | -------------------------------------------------------------------------------- /t/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "apisix-test-suite", 3 | "private": true, 4 | "type": "module", 5 | "scripts": { 6 | "test": "NODE_OPTIONS=--experimental-vm-modules jest" 7 | }, 8 | "devDependencies": { 9 | "@jest/globals": "^29.7.0", 10 | "@trivago/prettier-plugin-sort-imports": "^5.2.2", 11 | "@types/jest": "29.5.14", 12 | "@types/node": "22.14.1", 13 | "axios": "^1.9.0", 14 | "docker-compose": "^1.2.0", 15 | "graphql": "^16.11.0", 16 | "graphql-request": "^7.1.2", 17 | "jest": "29.7.0", 18 | "lago-javascript-client": "^1.26.0", 19 | "simple-git": "^3.27.0", 20 | "ts-jest": "29.3.2", 21 | "ts-node": "10.9.2", 22 | "yaml": "^2.7.1" 23 | }, 24 | "packageManager": "pnpm@10.11.0+sha512.6540583f41cc5f628eb3d9773ecee802f4f9ef9923cc45b69890fb47991d4b092964694ec3a4f738a420c918a333062c8b925d312f42e4f0c263eb603551f977" 25 | } 26 | -------------------------------------------------------------------------------- /t/plugin/authz-casbin/model.conf: -------------------------------------------------------------------------------- 1 | [request_definition] 2 | r = sub, obj, act 3 | 4 | [policy_definition] 5 | p = sub, obj, act 6 | 7 | [role_definition] 8 | g = _, _ 9 | 10 | [policy_effect] 11 | e = some(where (p.eft == allow)) 12 | 13 | [matchers] 14 | m = (g(r.sub, p.sub) || keyMatch(r.sub, p.sub)) && keyMatch(r.obj, p.obj) && keyMatch(r.act, p.act) 15 | -------------------------------------------------------------------------------- /t/plugin/authz-casbin/policy.csv: -------------------------------------------------------------------------------- 1 | p, *, /, GET 2 | p, admin, *, * 3 | g, alice, admin 4 | -------------------------------------------------------------------------------- /t/plugin/ext-plugin/runner.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Licensed to the Apache Software Foundation (ASF) under one or more 4 | # contributor license agreements. See the NOTICE file distributed with 5 | # this work for additional information regarding copyright ownership. 6 | # The ASF licenses this file to You under the Apache License, Version 2.0 7 | # (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | echo "LISTEN $APISIX_LISTEN_ADDRESS" 20 | echo "EXPIRE $APISIX_CONF_EXPIRE_TIME" 21 | echo "MY_ENV_VAR $MY_ENV_VAR" 22 | sleep "$1" 23 | exit 111 24 | -------------------------------------------------------------------------------- /t/plugin/ext-plugin/runner_can_not_terminated.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Licensed to the Apache Software Foundation (ASF) under one or more 4 | # contributor license agreements. See the NOTICE file distributed with 5 | # this work for additional information regarding copyright ownership. 6 | # The ASF licenses this file to You under the Apache License, Version 2.0 7 | # (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | term() { 20 | eval sleep 1800 21 | } 22 | trap term SIGTERM 23 | sleep 1800 24 | -------------------------------------------------------------------------------- /t/plugin/grpc-web/a6/route.proto: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed to the Apache Software Foundation (ASF) under one or more 3 | // contributor license agreements. See the NOTICE file distributed with 4 | // this work for additional information regarding copyright ownership. 5 | // The ASF licenses this file to You under the Apache License, Version 2.0 6 | // (the "License"); you may not use this file except in compliance with 7 | // the License. You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | 18 | syntax = "proto3"; 19 | 20 | package a6; 21 | 22 | option go_package = "./;a6"; 23 | 24 | service RouteService { 25 | rpc GetRoute(Query) returns (Route) {} 26 | rpc GetRoutes(Query) returns (stream Route) {} 27 | } 28 | 29 | message Query { 30 | string name = 1; 31 | } 32 | 33 | message Route { 34 | string name = 1; 35 | string path = 2; 36 | } 37 | -------------------------------------------------------------------------------- /t/plugin/grpc-web/go.mod: -------------------------------------------------------------------------------- 1 | module apisix.apache.org/plugin/grpc-web 2 | 3 | go 1.16 4 | 5 | require ( 6 | github.com/golang/protobuf v1.5.2 7 | google.golang.org/grpc v1.53.0 8 | ) 9 | -------------------------------------------------------------------------------- /t/plugin/grpc-web/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "apisix-grpc-web", 3 | "dependencies": { 4 | "google-protobuf": "^3.19.1", 5 | "grpc-web": "^1.3.0", 6 | "xhr2": "^0.2.1" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /t/plugin/grpc-web/req.bin: -------------------------------------------------------------------------------- 1 |  2 | world 3 | 4 | -------------------------------------------------------------------------------- /t/plugin/grpc-web/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Licensed to the Apache Software Foundation (ASF) under one or more 4 | # contributor license agreements. See the NOTICE file distributed with 5 | # this work for additional information regarding copyright ownership. 6 | # The ASF licenses this file to You under the Apache License, Version 2.0 7 | # (the "License"); you may not use this file except in compliance with 8 | # the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | set -ex 20 | 21 | npm install 22 | 23 | CGO_ENABLED=0 go build -o grpc-web-server server.go 24 | 25 | ./grpc-web-server > grpc-web-server.log 2>&1 || (cat grpc-web-server.log && exit 1)& 26 | -------------------------------------------------------------------------------- /t/plugin/mcp/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | import type {Config} from 'jest'; 19 | 20 | const config: Config = { 21 | coverageProvider: "v8", 22 | testEnvironment: "node", 23 | transform: { 24 | "^.+\.tsx?$": ["ts-jest",{}], 25 | }, 26 | }; 27 | 28 | export default config; 29 | -------------------------------------------------------------------------------- /t/plugin/mcp/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mcp-test-suite", 3 | "private": true, 4 | "scripts": { 5 | "test": "jest" 6 | }, 7 | "devDependencies": { 8 | "@types/jest": "^29.5.14", 9 | "@types/node": "^22.14.1", 10 | "jest": "^29.7.0", 11 | "ts-jest": "^29.3.2", 12 | "@modelcontextprotocol/sdk": "^1.9.0", 13 | "ts-node": "^10.9.2" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /t/plugin/mcp/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "moduleResolution": "node", 4 | "target": "esnext", 5 | "module": "esnext", 6 | "lib": ["esnext"], 7 | "esModuleInterop": true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /t/script/script_test.lua: -------------------------------------------------------------------------------- 1 | -- 2 | -- Licensed to the Apache Software Foundation (ASF) under one or more 3 | -- contributor license agreements. See the NOTICE file distributed with 4 | -- this work for additional information regarding copyright ownership. 5 | -- The ASF licenses this file to You under the Apache License, Version 2.0 6 | -- (the "License"); you may not use this file except in compliance with 7 | -- the License. You may obtain a copy of the License at 8 | -- 9 | -- http://www.apache.org/licenses/LICENSE-2.0 10 | -- 11 | -- Unless required by applicable law or agreed to in writing, software 12 | -- distributed under the License is distributed on an "AS IS" BASIS, 13 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | -- See the License for the specific language governing permissions and 15 | -- limitations under the License. 16 | -- 17 | local core = require("apisix.core") 18 | 19 | 20 | local _M = {} 21 | 22 | 23 | function _M.access(api_ctx) 24 | core.log.warn("hit access phase") 25 | end 26 | 27 | 28 | function _M.header_filter(ctx) 29 | core.log.warn("hit header_filter phase") 30 | end 31 | 32 | 33 | function _M.body_filter(ctx) 34 | core.log.warn("hit body_filter phase") 35 | end 36 | 37 | 38 | function _M.log(ctx) 39 | core.log.warn("hit log phase") 40 | end 41 | 42 | 43 | return _M 44 | -------------------------------------------------------------------------------- /t/sse_server_example/go.mod: -------------------------------------------------------------------------------- 1 | module foo.bar/apache/sse_server_example 2 | 3 | go 1.17 4 | -------------------------------------------------------------------------------- /t/ts/admin_api.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | import axios, { 18 | type AxiosRequestConfig, 19 | type Method, 20 | type RawAxiosRequestHeaders, 21 | } from 'axios'; 22 | 23 | export const request = async ( 24 | url: string, 25 | method: Method = 'GET', 26 | body?: object, 27 | headers?: RawAxiosRequestHeaders, 28 | config?: AxiosRequestConfig, 29 | ) => { 30 | return axios.request({ 31 | method, 32 | // TODO: use 9180 for admin api 33 | baseURL: 'http://127.0.0.1:1984', 34 | url, 35 | data: body, 36 | headers: { 37 | 'X-API-KEY': 'edd1c9f034335f136f87ad84b625c8f1', 38 | ...headers, 39 | }, 40 | ...config, 41 | }); 42 | }; 43 | -------------------------------------------------------------------------------- /t/ts/utils.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | export const wait = (ms: number) => 18 | new Promise((resolve) => setTimeout(resolve, ms)); 19 | -------------------------------------------------------------------------------- /t/tsconfig.esm.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "module": "ESNext", 5 | "moduleResolution": "Bundler", 6 | "isolatedModules": true 7 | }, 8 | "include": ["**/*.mts"] 9 | } 10 | -------------------------------------------------------------------------------- /t/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "esnext", 4 | "module": "commonjs", 5 | "lib": ["esnext"], 6 | "esModuleInterop": true, 7 | "strict": true, 8 | "noEmit": true 9 | }, 10 | "include": ["**/*.ts"] 11 | } 12 | -------------------------------------------------------------------------------- /t/wasm/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/api7/wasm-nginx-module 2 | 3 | go 1.17 4 | 5 | require ( 6 | github.com/tetratelabs/proxy-wasm-go-sdk v0.16.0 7 | github.com/valyala/fastjson v1.6.3 8 | ) 9 | 10 | //replace github.com/tetratelabs/proxy-wasm-go-sdk => ../proxy-wasm-go-sdk 11 | -------------------------------------------------------------------------------- /t/wasm/go.sum: -------------------------------------------------------------------------------- 1 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 2 | github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= 3 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 4 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 5 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 6 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 7 | github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= 8 | github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 9 | github.com/tetratelabs/proxy-wasm-go-sdk v0.16.0 h1:6xhDLV4DD2+q3Rs4CDh7cqo69rQ50XgCusv/58D44o4= 10 | github.com/tetratelabs/proxy-wasm-go-sdk v0.16.0/go.mod h1:8CxNZJ+9yDEvNnAog384fC8j1tKNF0tTZevGjOuY9ds= 11 | github.com/valyala/fastjson v1.6.3 h1:tAKFnnwmeMGPbwJ7IwxcTPCNr3uIzoIj3/Fh90ra4xc= 12 | github.com/valyala/fastjson v1.6.3/go.mod h1:CLCAqky6SMuOcxStkYQvblddUtoRxhYMGLrsQns1aXY= 13 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 14 | gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 15 | gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= 16 | gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 17 | -------------------------------------------------------------------------------- /t/xds-library/export.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package main 19 | 20 | import "C" 21 | import "unsafe" 22 | 23 | //export initial 24 | func initial(config_zone unsafe.Pointer, version_zone unsafe.Pointer) { 25 | write_config(config_zone, version_zone) 26 | } 27 | -------------------------------------------------------------------------------- /utils/check-lua-code-style.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Licensed to the Apache Software Foundation (ASF) under one or more 5 | # contributor license agreements. See the NOTICE file distributed with 6 | # this work for additional information regarding copyright ownership. 7 | # The ASF licenses this file to You under the Apache License, Version 2.0 8 | # (the "License"); you may not use this file except in compliance with 9 | # the License. You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # 19 | 20 | set -ex 21 | 22 | luacheck -q apisix t/lib 23 | 24 | find apisix -name '*.lua' ! -wholename 'apisix/cli/ngx_tpl.lua' ! -wholename 'apisix/cli/config.lua' -exec ./utils/lj-releng {} + > \ 25 | /tmp/check.log 2>&1 || (cat /tmp/check.log && exit 1) 26 | 27 | grep -E "ERROR.*.lua:" /tmp/check.log > /tmp/error.log || true 28 | if [ -s /tmp/error.log ]; then 29 | echo "=====bad style=====" 30 | cat /tmp/check.log 31 | exit 1 32 | fi 33 | -------------------------------------------------------------------------------- /utils/check-merge-conflict.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Licensed to the Apache Software Foundation (ASF) under one or more 5 | # contributor license agreements. See the NOTICE file distributed with 6 | # this work for additional information regarding copyright ownership. 7 | # The ASF licenses this file to You under the Apache License, Version 2.0 8 | # (the "License"); you may not use this file except in compliance with 9 | # the License. You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # 19 | 20 | set -euo pipefail 21 | 22 | grep "^<<<<<<< HEAD" $(git grep --cached -l '' | xargs) && exit 1 23 | grep "^>>>>>>> master" $(git grep --cached -l '' | xargs) && exit 1 24 | exit 0 25 | -------------------------------------------------------------------------------- /utils/check-test-code-style.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # 4 | # Licensed to the Apache Software Foundation (ASF) under one or more 5 | # contributor license agreements. See the NOTICE file distributed with 6 | # this work for additional information regarding copyright ownership. 7 | # The ASF licenses this file to You under the Apache License, Version 2.0 8 | # (the "License"); you may not use this file except in compliance with 9 | # the License. You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | # 19 | 20 | set -x -euo pipefail 21 | 22 | find t -name '*.t' -exec grep -E "\-\-\-\s+(SKIP|ONLY|LAST|FIRST)$" {} + > /tmp/error.log || true 23 | if [ -s /tmp/error.log ]; then 24 | echo "Forbidden directives to found. Bypass test cases without reason are not allowed." 25 | cat /tmp/error.log 26 | exit 1 27 | fi 28 | 29 | find t -name '*.t' -exec ./utils/reindex {} + > \ 30 | /tmp/check.log 2>&1 || (cat /tmp/check.log && exit 1) 31 | 32 | grep "done." /tmp/check.log > /tmp/error.log || true 33 | if [ -s /tmp/error.log ]; then 34 | echo "=====bad style=====" 35 | cat /tmp/error.log 36 | echo "you need to run 'reindex' to fix them. Read CONTRIBUTING.md for more details." 37 | exit 1 38 | fi 39 | --------------------------------------------------------------------------------