ValidateWorkspaceName (valid/workspace.go)

atlantis · server/core/config/valid/workspace.go · go · Apache-2.0
infra

Validates workspace names for Terraform tools to ensure safe filenames and command arguments.

// Source: https://github.com/runatlantis/atlantis | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
// Copyright 2025 The Atlantis Authors
// SPDX-License-Identifier: Apache-2.0

package valid

import (
	"errors"
	"strings"
	"unicode"
)

// ValidateWorkspaceName checks that a workspace name is safe for the two things
// Atlantis does with it: using it as a Terraform command argument, and using it
// as a component of the paths Atlantis writes (plan files, env/<workspace>.tfvars,
// the plan directory).
//
// Atlantis builds its Terraform command lines as argument vectors rather than
// shell source, so this check deliberately does not exclude shell
// metacharacters. Terraform acce

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key