mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-05-09 05:35:30 +02:00
[GH-ISSUE #1182] [Feature]: Allow API Keys to access cloud presets #857
Labels
No labels
A1
automated
automated
bug
bug
Closed due to inactivity
contrib
dependencies
dependencies
duplicate
enhancement
feedback
hold
invalid
Notes
P1S
pull-request
security
security
ThumbsUp
user-report
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/bambuddy#857
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @turulix on GitHub (Apr 30, 2026).
Original GitHub issue: https://github.com/maziggy/bambuddy/issues/1182
Originally assigned to: @maziggy on GitHub.
Problem or Use Case
I am currently working on building a fully automated, headless pipeline to manage my 3D prints. A crucial step in this workflow is automatically slicing the 3D models on my server before sending them to the printer.
However, as discussed in #665, the current APIs are unable to access cloud data. Because the API cannot interact with the cloud to retrieve user presets.
Proposed Solution
The most straight forward way would be to allow API keys to access cloud data of the user that has created them
Alternatives Considered
No response
Feature Category
API
Priority
Critical for my use case
Mockups or Examples
No response
Contribution
Checklist
@maziggy commented on GitHub (May 1, 2026):
You didn't fill out the bug report completely. I'm missing important details.
@turulix commented on GitHub (May 1, 2026):
What details do you still need?
@maziggy commented on GitHub (May 1, 2026):
The bug report form has all required infos.
@turulix commented on GitHub (May 1, 2026):
I made this using the feature request form, and these are all the infos it asked for, this is not a bug and was done on purpose in #665
@maziggy commented on GitHub (May 1, 2026):
I'm sorry, mixed up the issues. Need to grab a coffee first.
@maziggy commented on GitHub (May 1, 2026):
Available/Fixed in branch dev and available with the next release or daily build. Please let me know if it works for you.
Docs -> https://wiki.bambuddy.cool/features/api-keys/
If you find Bambuddy useful, please consider giving it a ⭐ on GitHub — it helps others discover the project!
@turulix commented on GitHub (May 1, 2026):
Got around to testing it thanks for the fast implementation, its not quite working as i need it, i can now successfully get the needed ids from:
/api/v1/cloud/settingsSending a request to
/v1/library/files/<file_id>/slicewith the payload:successfully starts a slicing task, but checking the status of the slicing task under
/api/v1/slice-jobs/<job_id>results in:
@maziggy commented on GitHub (May 2, 2026):
Good catch — and apologies that the first fix only covered half the surface. You found the gap: the /cloud/* router got the owner-resolution treatment, but the slice route lives on /library/* with its own router, so when the auth gate returned None for your API key the slice path called get_stored_token(db, user=None) and fell through to the auth-disabled global Settings table, which is empty on every auth-enabled deployment. Same bug as #1182, just on a different router.
The shape that landed:
resolve_api_key_cloud_ownerin cloud.py. It's permissive on purpose: returns the API key's owner User when the key hascan_access_cloud=true, otherwise None — never raises. That lets us add it to non-/cloud/* routes without breaking the local-presets path. A request via an API key that lacks the cloud scope still slices fine against local presets and only 400s with the existing "no Bambu Cloud session" error if the request actually selects a cloud preset.current_user or api_key_cloud_ownerinstead of falling back to None.
current_user is None.Available/Fixed in branch dev and available with the next release or daily build. Please let me know if it works for you.
If you find Bambuddy useful, please consider giving it a ⭐ on GitHub — it helps others discover the project!