AUT-11295 Manage workspace secrets via dedicated secrets pipeline - #50
Draft
piotrek-janus wants to merge 8 commits into
Draft
AUT-11295 Manage workspace secrets via dedicated secrets pipeline#50piotrek-janus wants to merge 8 commits into
piotrek-janus wants to merge 8 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Jira task - https://secureauth.atlassian.net/browse/AUT-11295
Release Notes Description (public)
Manage workspace secrets as config-as-code using the dedicated secret system APIs. New
--workspace-secrets <workspace>flag onpull,push, anddiffoperates exclusively on secrets:pullscaffolds env-injected stub files,pushreconciles remote secrets from local definitions (create/update, delete with--prune), anddiffcompares local definitions against the remote workspace. Secret values are never stored in the repository — each secret file references an environment variable resolved at push time.Implementation details (internal)
Alternative to #30 (same Jira). Instead of threading a
Patch/Extenvelope through everySource/Storage/Validator/diffsignature, secrets get a self-contained vertical slice; the existing config pipeline is untouched.internal/cac/secrets: local model, pure plan computation (ComputePlan→ create/update/delete sets), andDirStoreforworkspaces/<wid>/secrets/*.yaml.ListIDsreads raw YAML (no env vars needed, used by pull/diff);Listrenders{{ env }}templates and rejects empty values before any API call (used by push).internal/cac/client/secrets_api.go:SecretsAPIStoreover the system Secrets CRUD API.value: '{{ env "CAC_SECRET_<ID>" }}'— single-quoted so files parse as plain YAML while remaining valid Go templates.pullnever overwrites existing secret files.--workspace-secretsis mutually exclusive with--workspace/--tenant/--filter;push --methodanddiff --source/--targetare validated in RunE so they stay required for config mode only.push --dry-runprints exactly the plan a real push would apply.Information for QA
Additional QA Procedures (Optional)
Suggested manual flow against a dev tenant:
pull --workspace-secrets <wid>(stubs created, re-run skips), setCAC_SECRET_*env vars,push --workspace-secrets <wid> --dry-run(plan lists IDs only), real push,diff --workspace-secrets <wid>, andpush --pruneafter deleting a local file.