feat: possible to deploy with only token#36868
Conversation
There was a problem hiding this comment.
Pull request overview
Enables hosted/public cloud container deployments to be configured with only token-based clients (no client certificate authority), by relaxing model validation and mTLS connector setup when token clients are present.
Changes:
- Relaxed
<clients>validation to allow deployments without any certificate-based client as long as there is at least one token client withwritepermission. - Updated mTLS connector configuration in public cloud to not require
security/clients.pemwhen token clients exist. - Added a unit test covering successful token-only client configuration and connector output.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| config-model/src/main/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilder.java | Allows token-only deployments by adjusting client validation and public-cloud mTLS connector CA requirements. |
| config-model/src/test/java/com/yahoo/vespa/model/container/xml/CloudTokenDataPlaneFilterTest.java | Adds coverage for token-only client deployments and asserts expected connector/filter config behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| assertEquals(List.of("read", "write"), tokenClient.permissions()); | ||
| assertFalse(tokenClient.tokens().isEmpty()); | ||
| } | ||
|
|
| .anyMatch(client -> client.permissions().contains(WRITE)); | ||
|
|
||
| if (!atLeastOneClientWithCertificate && !atLeastOneClientWithWriteToken) | ||
| throw new IllegalArgumentException("At least one client must require a certificate or a write token"); |
| assertTrue(connectorCfg.ssl().caCertificate().isEmpty(), | ||
| "Token-only: mTLS connector must not have a CA certificate configured"); | ||
|
|
||
| assertNotNull(connectorConfig(8444)); |
johansolbakken
left a comment
There was a problem hiding this comment.
Generally looks fine to me. But could not get it to compile yet. See comments:
| "Takes effect at redeployment", | ||
| TENANT_ID, APPLICATION, INSTANCE_ID); | ||
|
|
||
| public static final UnboundedBooleanFlag TOKEN_AUTH_FOR_DEPLOY = defineFeatureFlag( |
There was a problem hiding this comment.
Probably meant UnboundBooleanFlag
| public static final UnboundedBooleanFlag TOKEN_AUTH_FOR_DEPLOY = defineFeatureFlag( | ||
| "token-auth-for-deploy", | ||
| List.of("bragehk"), "2026-05-19", "2026-09-01" | ||
| false, |
There was a problem hiding this comment.
The default value should be the second parameter.
| @ModelFeatureFlag(owners = {"hmusum"}) default String unknownConfigDefinition() { return "warn"; } | ||
| @ModelFeatureFlag(owners = {"havardpe"}) default boolean sortBlueprintsByCost() { return false; } | ||
| @ModelFeatureFlag(owners = {"olaa"}) default boolean logserverOtelCol() { return false; } | ||
| @ModelFeatureFlag(owners = {"bragehk"}) default boolean tokenAuthForDeploy() { return false; } |
There was a problem hiding this comment.
Since this is public API, you need to run mvn package -Dabicheck.writeSpec in the config-model-api folder.
I confirm that this contribution is made under the terms of the license found in the root directory of this repository's source tree and that I have the authority necessary to make this contribution on behalf of its copyright owner.
I will also make PR for CLI to add support for this.