Resolves #36087 (one of several PRs). ## Testing - [x] QA'd all new/changed functionality manually. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Dry-run support when creating secret variables. * **Improvements** * Standardized API models for secret-variables and targets for more consistent behavior. * List secret variables now includes pagination metadata. * More consistent error reporting across secret-variables and targets APIs. * Target search/count behavior refined: pre-selected built-in labels are omitted as expected. * **Tests** * Integration tests updated to validate the new request/response behavior and target-selection logic. <!-- review_stack_entry_start --> [](https://app.coderabbit.ai/change-stack/fleetdm/fleet/pull/46196?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
14 lines
465 B
Go
14 lines
465 B
Go
package service
|
|
|
|
import "github.com/fleetdm/fleet/v4/server/fleet"
|
|
|
|
func (c *Client) SaveSecretVariables(secretVariables []fleet.SecretVariable, dryRun bool) error {
|
|
verb, path := "PUT", "/api/latest/fleet/spec/secret_variables"
|
|
params := fleet.CreateSecretVariablesRequest{
|
|
SecretVariables: secretVariables,
|
|
DryRun: dryRun,
|
|
}
|
|
var responseBody fleet.CreateSecretVariablesResponse
|
|
return c.authenticatedRequest(params, verb, path, &responseBody)
|
|
}
|