-
Couldn't load subscription status.
- Fork 9
Sim w/o global session #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: simple
Are you sure you want to change the base?
Conversation
…tup.cfg, add new settings in pyproject.toml, and adjust .editorconfig for improved code style. Update Python version to 3.12 and version to 4.0.0. Enhance signal handling in signals.py and implement encryption/decryption functions in util.py.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New security issues found
|
|
||
| client = MagicClient( | ||
| app_name="My App", | ||
| public_api_key="4700aed5ee9f76f7be6398cd4b00b586", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
security (generic-api-key): Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
Source: gitleaks
| auth_users=[ | ||
| AuthUser( | ||
| email="[email protected]", | ||
| current_session_token="97ee741d53e11a490460927c8a2ce4a3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
security (generic-api-key): Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
Source: gitleaks
| quart auth add-client | ||
| ``` | ||
| ``` | ||
| Created client 2VolejRejNmG with public_api_key: 5f794cf72d0cef2dd008be2c0b7a632b |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
security (generic-api-key): Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
Source: gitleaks
| # Create new auth_user via api | ||
| ```shell | ||
| curl -X POST localhost:8081/api/auth_user/ \ | ||
| -H 'X-Public-API-Key: 5f794cf72d0cef2dd008be2c0b7a632b' \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
security (generic-api-key): Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
Source: gitleaks
| "data": { | ||
| "auth_user": { | ||
| "client_id": "2VolejRejNmG", | ||
| "current_session_token": "69ee9af5b9296a09f90be5b71c1dda38", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
security (generic-api-key): Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
Source: gitleaks
| curl -X POST localhost:8081/api/auth_user/ \ | ||
| -H 'X-Public-API-Key: 5f794cf72d0cef2dd008be2c0b7a632b' \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
security (curl-auth-header): Discovered a potential authorization token provided in a curl command header, which could compromise the curl accessed resource.
Source: gitleaks
| curl -X GET localhost:8081/api/auth_user/ \ | ||
| -H 'X-Public-API-Key: 5f794cf72d0cef2dd008be2c0b7a632b' \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
security (curl-auth-header): Discovered a potential authorization token provided in a curl command header, which could compromise the curl accessed resource.
Source: gitleaks
| curl -X POST localhost:8081/api/auth_wallet/sync \ | ||
| -H 'X-Public-API-Key: 5f794cf72d0cef2dd008be2c0b7a632b' \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
security (curl-auth-header): Discovered a potential authorization token provided in a curl command header, which could compromise the curl accessed resource.
Source: gitleaks
| curl -X GET localhost:8081/api/magic_client/ \ | ||
| -H 'X-Public-API-Key: 5f794cf72d0cef2dd008be2c0b7a632b' \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
security (curl-auth-header): Discovered a potential authorization token provided in a curl command header, which could compromise the curl accessed resource.
Source: gitleaks
| curl -X POST localhost:8081/api/magic_client/ \ | ||
| -H 'X-Public-API-Key: 5f794cf72d0cef2dd008be2c0b7a632b' \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
security (curl-auth-header): Discovered a potential authorization token provided in a curl command header, which could compromise the curl accessed resource.
Source: gitleaks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is being reviewed by Cursor Bugbot
Details
You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
Bug: Reactivation Method Incorrectly Sets Status
The reactivate method currently sets an entity's is_active status to False. This seems like a bug, as reactivating an entity should likely set is_active to True.
src/quart_sqlalchemy/sim/repo.py#L287-L289
quart-sqlalchemy/src/quart_sqlalchemy/sim/repo.py
Lines 287 to 289 in 38cf5a1
| def reactivate(self, session: sa.orm.Session, id_: EntityIdT) -> EntityT: | |
| return self.update(session, id_, dict(is_active=False)) |
examples/repository/sqla.py#L216-L220
quart-sqlalchemy/examples/repository/sqla.py
Lines 216 to 220 in 38cf5a1
| if self.has_soft_delete: | |
| raise RuntimeError("Can't delete entity that uses soft-delete semantics.") | |
| entity = self.get(id_) | |
| if not entity: |
| continue | ||
| def __lt__(self: ORMModel, other: ORMModel) -> bool: | ||
| if type(self).__name__ != type(other).__name__: | ||
| raise NotImplemented |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ... | ||
| """ | ||
| try: | ||
| return Bind._instances[name]() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Object Misuse as Function
There are two places where an object is incorrectly called as a function:
- In
Bind.get_instance, theBindinstance retrieved from_instancesis called with(), which will raise aTypeError. - In
AuthWalletHandler.get_by_public_address,self.logic.AuthWalletis called with(), which is likely unintended and may cause an error when accessingget_by_public_address.
Additional Locations (1)
| builder: StatementBuilder | ||
|
|
||
| def __init__(self, session: sa.orm.Session, **kwargs): | ||
| def __init__(self, model: sa.orm.Session, **kwargs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| return | ||
|
|
||
| if name in Bind._instances: | ||
| raise ValueError("Bind instance `{name}` already exists, use another name.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|




Note
Introduces a full simulation app (auth/web3) and extensively refactors the core library (Base/binds/sessions/signals/CLI), with Python 3.12 + tooling/deps updates and breaking API changes.
ModelwithBase/BaseMixins; new default metadata/type maps.Bind/AsyncBind: named instances, URL-first config, thread-safe init,transaction()helpers, improved test transactions.Emptysentinel;SQLAlchemyConfig.from_frameworkand defaults.Operator, refineColumnExpr; utilities add ID encrypt/decrypt.Base.registry.db info/create/drop/recreateand fixtures loader; improved outputs.IntPK,UUID,ULID,Created,Updated; JSON default fix.src/quart_sqlalchemy/sim):SessionT; addget_by_field; decorators to provide sessions.uv; add deps (bases, blinker, cryptography, reedsolo, simonspeckciphers, python-ulid); remove flake8 configs.docs/usage.mdanddocs/Simulation.mdwith configuration and examples.Written by Cursor Bugbot for commit 38cf5a1. This will update automatically on new commits. Configure here.