Skip to content

Saimon/edge filer quotas - #373

Merged
saimonation merged 5 commits into
masterfrom
saimon/edge-filer-quotas
Oct 11, 2026
Merged

saimonation merged 5 commits into
masterfrom
saimon/edge-filer-quotas

Conversation

@saimonation

@saimonation saimonation commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

No description provided.

@saimonation
saimonation merged commit ea104be into master Oct 11, 2026
6 checks passed

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 4 potential issues.

Fix All in Cursor

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit fb394a4. Configure here.

Comment thread cterasdk/core/quotas.py
'quotaMb': quota,
'shouldEnforce': enforce
}
response = self._core.clients.v2.post('portals/cterademo-saimon/subfolder-quotas', param)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hardcoded demo tenant in add

High Severity

Subfolders.add posts to portals/cterademo-saimon/subfolder-quotas instead of the session tenant used by all and remove. Every create goes to that demo portal, so quota rules are never created in the caller’s tenant.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit fb394a4. Configure here.

Comment thread cterasdk/core/quotas.py
'ownerId': parse_base_object_ref(drive.owner).uid,
'quotaMb': quota,
'shouldEnforce': enforce
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add payload uses camelCase keys

High Severity

Subfolders.add sends camelCase fields such as cloudDriveId and quotaMb. The same v2 resource is read with snake_case (cloud_drive_id, quota_mb), and other v2 writes in this SDK (for example shares) also use snake_case. The server is likely to ignore or reject the body, so creates silently fail or persist empty values.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit fb394a4. Configure here.

Comment thread cterasdk/core/quotas.py
"""
path = f"{path.rstrip('/')}/"
for rule in self.all():
if path == rule.path and rule.owner == owner:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove path comparison never matches

High Severity

Subfolders.remove appends a trailing slash to the caller path, then compares it to rule.path. all() builds that path as name + subfolder_path with no trailing slash, and add() stores the subfolder the same way. The equality check therefore fails for documented paths, so deletes log “not found” and leave the rule in place.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit fb394a4. Configure here.

self.groups = groups.Groups(self)
self.logs = logs.Logs(self)
self.plans = plans.Plans(self)
self.quotas = quotas.Quotas(self)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quotas omitted from stringify filters

Low Severity

self.quotas was added on Portal and Edge but not listed in _omit_fields. __str__ serializes every non-omitted public attribute, so printing a portal or filer object now tries to JSON-encode the Quotas command and raises AttributeError.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit fb394a4. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant