Skip to content

[CI only] fix: keep ${{VAR}} values as strings where the config schema expects a string - #2

Draft
moonming wants to merge 316 commits into
masterfrom
fix/env-var-keep-string-fields
Draft

moonming wants to merge 316 commits into
masterfrom
fix/env-var-keep-string-fields

Conversation

@moonming

Copy link
Copy Markdown
Owner

Temporary pull request inside this fork, opened only to run the upstream CI workflows (CLI, test-nginx, kubernetes, tars, lint) on this branch. It is not for merge and will be closed when CI finishes. The change itself targets apache#14178.

cybersec-jochenarnold and others added 30 commits July 10, 2026 14:42
ruanweihong-aaa and others added 30 commits November 9, 2026 18:16
* docs: add Wordfully to powered-by list

* docs: clarify Wordfully usage description
Bumps [@modelcontextprotocol/sdk](https://github.com/modelcontextprotocol/typescript-sdk) from 1.26.0 to 1.32.0.
- [Release notes](https://github.com/modelcontextprotocol/typescript-sdk/releases)
- [Commits](modelcontextprotocol/typescript-sdk@v1.26.0...1.32.0)

---
updated-dependencies:
- dependency-name: "@modelcontextprotocol/sdk"
  dependency-version: 1.32.0
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
)

* build(deps): bump actions/setup-python from 6.2.0 to 7.0.0

Bumps [actions/setup-python](https://github.com/actions/setup-python) from 6.2.0 to 7.0.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](actions/setup-python@a309ff8...5fda3b9)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* ci: update Python setup references for current workflows

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ming Wen <moonbingbing@gmail.com>
* build(deps): bump actions/setup-node from 6.2.0 to 7.0.0

Bumps [actions/setup-node](https://github.com/actions/setup-node) from 6.2.0 to 7.0.0.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](actions/setup-node@6044e13...8207627)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* ci: update OpenAPI workflow to setup-node v7

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ming Wen <moonbingbing@gmail.com>
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 6.3.0 to 7.0.0.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](actions/setup-go@4b73464...b7ad1da)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ming Wen <moonbingbing@gmail.com>
Signed-off-by: kayx23 <trakydeng@gmail.com>
* docs: repair body-transformer SOAP example

* docs: align SOAP example with plugin style

* docs: make SOAP service startup repeatable
* docs(jwt-auth): refresh Vault secret example

* docs(jwt-auth): sync current API7 Vault workflow
* docs: clarify opentelemetry plugin enablement

* docs(opentelemetry): sync current enablement paths
* docs(authz-keycloak): refresh Keycloak authorization guide

* docs(authz-keycloak): refresh Chinese guide

* docs(authz-keycloak): scope current configuration workflows
Bumps [axios](https://github.com/axios/axios) from 1.16.0 to 1.20.0.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](axios/axios@v1.16.0...v1.20.0)

---
updated-dependencies:
- dependency-name: axios
  dependency-version: 1.20.0
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ming Wen <moonbingbing@gmail.com>
…a string

When config.yaml takes a value from an environment variable, the CLI turns
it into a number or a boolean if it looks like one. An admin key such as
APISIX_ADMIN_KEY=123456 therefore became the number 123456, and the Admin
API rejected every request, because the request header is compared as a
string. The admin key schema did not catch this, because its `items` was
nested under `properties` and never applied.

- Move `items` of deployment.admin.admin_key to the right level, so that
  name, key and role are checked as strings.
- Skip the conversion where the CLI schema, or the schema of a configured
  service discovery, only accepts a string: for example the admin key, the
  etcd user and password, the data encryption keyring, the nacos secret_key
  and the kubernetes service port. Other fields, such as admin_listen.port,
  are converted as before.

An admin key written in config.yaml as a YAML number, boolean or null now
fails validation, instead of starting with an Admin API that rejects every
request.

Fixes apache#14178
A key written as `key:` is loaded as YAML null. Such a key matches no
request, but it has always passed validation, and templates produce it,
for example the Helm chart when the viewer key is left empty, so
rejecting it would stop such deployments from starting. Accept a string
or a YAML null for the name, key and role of an admin key, and keep
rejecting numbers and booleans.
Review follow-ups:

- Check only `key` of an admin key entry. name and role have never been
  checked, and `name: 1` with a valid key works today, so typing them
  would stop such configurations from starting.
- Substitute `${{VAR}}` in a config key before the schema is looked up,
  so that a key written as a variable gets the type of the real field.
- When several anyOf/oneOf alternatives describe a key, use all of them.
- Say in the docs that quoting `${{VAR}}` does not prevent the conversion
  and that sections without a schema, such as plugin_attr, are converted.
- Test a boolean admin key, the keyring written as a single key, and the
  kubernetes discovery schema.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.