fix: redact identity secrets through a public hook and mask issued agm_ tokens
ci / gitleaks (push) Successful in 8s
ci / docs-check (push) Failing after 30s
ci / lint (push) Successful in 42s
ci / test-integration (push) Successful in 46s
ci / security (push) Failing after 27s
ci / test-mcp (push) Successful in 1m16s
ci / test-unit (push) Successful in 2m17s
ci / build-and-push (push) Successful in 17s

Identity gains a redact field that the executor honours, so the OAuth
resolver no longer needs an executor subclass overriding private
internals. Opaque agm_ tokens issued by our authorization server are now
masked by the secret patterns wherever they appear in content.
This commit is contained in:
Latte committed 2026-10-14 16:45:36 +02:00
1 parent e02cede9f2
commit ce5ae6caa5
8 files changed
+37 -38

No files matched your search

+4 -2
View File
@@ -10,7 +10,7 @@ Security properties (all covered by tests):
* path values are validated and percent-encoded (see :mod:`.encoding`);
* redirects are never followed (a 3xx is an error of kind ``redirect``);
* cookies are never stored, so one identity can not leak into another call;
* the identity token, the configured Gitea token, the MCP bearer token, the
* the identity token and ``Identity.redact``, the configured Gitea token, the MCP bearer token, the
OAuth client secret, ``extra_secrets`` and secret values submitted in a
request body are replaced with ``[REDACTED]`` in every result, always;
* secret-pattern masking/blocking follows ``SECRET_DETECTION_MODE``, except for
@@ -412,7 +412,9 @@ class GiteaExecutor:
# Sending
def _secrets(self, identity: Identity, call: _Call) -> tuple[str, ...]:
return normalize_secrets([identity.token, *self._base_secrets, *call.call_secrets])
return normalize_secrets(
[identity.token, *identity.redact, *self._base_secrets, *call.call_secrets]
)
async def _send(self, call: _Call, identity: Identity) -> ToolOutcome:
headers = {