Repository navigation
Support configurable credential placeholder shapes - #143
Conversation
EclipseSourceAI
left a comment
There was a problem hiding this comment.
Note
Autonomous AI review.
This review was done by an AI agent and therefore may contain mistakes. Feel free to ignore any comment you disagree with. A thumbs-down reaction on a comment marks it as rejected for follow-up reviews. Noting why in a reply helps, since replies are read too.
Resolving all AI comments does not lead to an automatic approval. A maintainer still needs to review and sign off on the overall architecture and design.
To get an updated review after pushing changes, a maintainer may re-request a review from this account.
Running in Eclipse Enclave, submitted via review-guard-mcp
Adds an optional credentials.sources.<id>.placeholder (prefix, suffix, random hex/base64url/alphanumeric body with per-encoding minimum lengths of at least 128 bits) to tool and feature specs. The shape is validated at load, passed through activeSecret to the placeholder resolver, and used instead of the default ENCLAVE_SECRET_<hex> value. The gateway needs no changes because it already matches the full registered placeholder with strings.Contains. The PR also changes placeholder generation failures from "warn and inject the real value" to "abort startup", and renames the resolver's cache key to secret ID, which is what callers already passed.
Build, the tests for the touched packages, and golangci-lint all pass locally on the merged tree.
Points for maintainers:
- Silent no-op config: a
placeholderon a credential with noserviceAuthentry is accepted and ignored, so the raw value is injected. This should fail at load like the other serviceAuth mapping checks. - Spec/model coupling: the spec struct embeds
model.SecretPlaceholderConfigdirectly instead of using aspec*type mapped inbuildSecrets. - Fail-closed change: with load-time validation, generation can now only fail if
crypto/randfails. The change is sound, but it does change behavior for the default placeholder path too. - The remaining comments are smaller cleanups: a validator named
Alphabet(), an inline normalize block that shadowscopy, a deadelse, import grouping, and field ordering.
EclipseSourceAI
left a comment
There was a problem hiding this comment.
Note
Autonomous AI review.
This review was done by an AI agent and therefore may contain mistakes. Feel free to ignore any comment you disagree with. A thumbs-down reaction on a comment marks it as rejected for follow-up reviews. Noting why in a reply helps, since replies are read too.
Resolving all AI comments does not lead to an automatic approval. A maintainer still needs to review and sign off on the overall architecture and design.
To get an updated review after pushing changes, a maintainer may re-request a review from this account.
Running in Eclipse Enclave, submitted via review-guard-mcp
Only one commit landed since my last review (adf9300). It addresses all seven points I raised: the silent no-op (placeholder without network.serviceAuth) now fails at spec load, with a new test covering sandbox/mixin and several network shapes; the spec schema now has its own specCredentialPlaceholder/specCredentialPlaceholderRandom mapped in buildSecrets instead of embedding the model type; the Alphabet()/copy shadowing issue is gone via ValidatedAlphabet() and a normalizeSecretPlaceholder helper matching the existing normalize pattern; the dead else in auth_manager.go is flattened; the import grouping nit is fixed; and Placeholder was moved to the end of SecretConfig, specCredentialSource, and activeSecret to keep the diff minimal.
Build, go build ./..., and tests for the touched packages (config, model, auth, runtime) pass on the merged tree. No new issues found in the fix-up commit, nothing further to flag inline.
These previous comments can be resolved as they are now handled:
- reject a
placeholderwith no matchingserviceAuthentry at spec load instead of silently injecting the raw value - stop embedding
model.SecretPlaceholderConfigdirectly in the spec schema, use a mappedspec*type instead - pull the inline placeholder normalization into a
normalizeSecretPlaceholderhelper and drop thecopyshadowing - rename
Alphabet()since it also validates prefix/suffix - flatten the dead
elseafterreturn - put
enclave/internal/modelin its own import group - move
Placeholderto the end of the structs instead of the first field
I can't resolve them myself as I would need write permission on this repository.
tortmayr
left a comment
There was a problem hiding this comment.
Code looks good to me and everything works as expected during testing.
One thing i noticed, which we should probably handle in a follow-up:
If a feature is enabled explicitly via -- features and it fails do load e.g because the secret format does not match it is just skipped with a warning.
IMO explicitly enabled features should probably hard error instead of a warning and silent skip
What it does
Adds optional
credentials.sources.<id>.placeholdersettings for tools and features: prefix, suffix, random-body encoding and length. This lets extensions accommodate client-side token format checks without exposing the real secret. Existing defaults and gateway release restrictions remain unchanged. Invalid shapes are rejected; generation failures abort startup instead of injecting the real credential.Fixes #142.
Addresses the generic compatibility problem reported in #128, without adding that tool.
How to test
make build && make test && make lint.network.serviceAuth, add this under its credential source:./bin/enclave --tool <tool> shellwith the gateway enabled. Inspect that credential's env var: expectvendor_, 32 lowercase hex characters, and_end, not the dummy value. A fresh session should get a different value.1: startup should reject the configuration. Removeplaceholder: expect the originalENCLAVE_SECRET_format again. Restore the local extension afterward.The gateway tests cover replacement of custom placeholders and denial on HTTP or unauthorized hosts. The dummy credential check does not test upstream authentication.
Follow-ups
Rebase #128 after this lands and configure its credential shape there.
Breaking changes
Review checklist