Skip to content

feat: possible to deploy with only token#36868

Open
BrageHK wants to merge 4 commits into
masterfrom
bragehk/token-auth-deployment-config-model
Open

feat: possible to deploy with only token#36868
BrageHK wants to merge 4 commits into
masterfrom
bragehk/token-auth-deployment-config-model

Conversation

@BrageHK
Copy link
Copy Markdown
Contributor

@BrageHK BrageHK commented May 13, 2026

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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 with write permission.
  • Updated mTLS connector configuration in public cloud to not require security/clients.pem when 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));
@BrageHK BrageHK requested a review from johansolbakken May 19, 2026 13:45
Copy link
Copy Markdown
Contributor

@johansolbakken johansolbakken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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; }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is public API, you need to run mvn package -Dabicheck.writeSpec in the config-model-api folder.

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.

3 participants