Repository navigation
Conversation
repr and str show [sealed] for sealed fields. Cipher(cls) checks the class again and finds the credentials, with no request and no HTTP client. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Credentials are found without building an HTTP client, and each refusal names the variable or file to fix. Redaction reads the class's own dict, covers rich, and runs no descriptor that may do work. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
repr and str show [sealed] for sealed fields. Cipher(cls) checks the class again and finds the credentials, with no request. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueComment |
This branch has not been deployed
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.
Summary
A declared class no longer prints plaintext:
repr,strand rich's__rich_repr__show<sealed>for every sealed field.Cipher(User)now exists. It checks that the class is declared and unchanged, then finds the credentials the way every SDK does, with no request.encrypt,decryptandquerycome in later tickets.Changes
Redaction (
_redact.py).@stackencrypt.modelreplaces__repr__,__str__and__rich_repr__. A passthrough field shows its value, a sealed field shows<sealed>, and anIgnorefield is left out. A value is read from the instance's__dict__or a storage slot only, so a SQLAlchemy column that is not loaded runs no SELECT. A generated method is replaced. A hand-written one is refused withdeclaration_repr_present, unless the decorator is givenredact=False.Cipher(_cipher.py).Cipher(cls)refuses an undeclared class, a subclass of a declared class, or a non-class withdeclaration_not_decorated. A class changed after decoration isdeclaration_class_changed, with reasonmethods,fieldsorconstructor. Then it calls the engine for the credentials. A refusal is anAuthenticationErrorwith the engine's code, such asstack_auth_not_authenticated.Credentials (
crates/core/src/credentials.rs). stack-auth'sAutoStrategyreadsCS_CLIENT_ACCESS_KEYandCS_WORKSPACE_CRN, then the profilestash auth loginwrites. It is given a transport that sends nothing, so no HTTP client is built and thehttpfeature stays off. Each refusal names the variable or file to fix.Placeholder. Python prints
<sealed>, not Go's[sealed].[sealed]is a valid tag in rich's markup, sorich.print(repr(user))would show the field as empty. The ADR and the spec record it.Verification
NamedTupleand SQLAlchemy.cargo test --locked, clippy,cargo fmt --check, mypy strict, and pyright are clean.pnpm run test:scripts: 83 of 83 files pass.Related
Closes #1388. Part of #1341.
Review notes
_redact.hand_writtenand_value, thencheck_unchangedin_declaration.py.dataclasses.asdict,model_dumpandvarsstill return plaintext, by design.Ignorefield underAnnotatedloads as one object, not a list. That is a spec problem, noted on Python SDK: core call over psycopg, on EQL v4 and Stack Encrypt #1341.🤖 Generated with Claude Code