Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/cmd/root.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,11 @@ impl EntityType {
EntityType::Agent(AgentCommand {
subcommand: AgentSubcommand::Profiles(_),
}) => false,
// Local Docker only: images, networks, containers and the
// persistent home volume. `build --profile` reads a local profile.
EntityType::Agent(AgentCommand {
subcommand: AgentSubcommand::Docker(_),
}) => false,
// File-only agent profiles require no Stashbase authentication.
// Remote fallback is validated after the profile and local overrides
// have been resolved.
Expand Down Expand Up @@ -223,4 +228,19 @@ mod tests {
assert!(!cli.entity_type.requires_api_key(), "{args:?}");
}
}

#[test]
fn agent_docker_commands_do_not_require_an_api_key() {
for args in [
vec!["stashbase", "agent", "docker", "build"],
vec!["stashbase", "agent", "docker", "build", "--profile", "demo"],
vec!["stashbase", "agent", "docker", "status"],
vec!["stashbase", "agent", "docker", "cleanup"],
vec!["stashbase", "agent", "docker", "doctor"],
vec!["stashbase", "agent", "docker", "shell"],
] {
let cli = Cli::try_parse_from(&args).unwrap();
assert!(!cli.entity_type.requires_api_key(), "{args:?}");
}
}
}
Loading