You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bind Provider creation, update, and delete to exact resource identities #5931
Codex report. A controller that owns Provider registration and retirement needs the Gateway to enforce the resource identities the controller authorized. The Gateway can resolve a different resource under the same name between the controller's read and its write. This follows up on inactive issue #2722 and adds the registration and retirement cases.
Reproduction
I used OpenShell Gateway 0.1.10-dev.100+g152c59d31, a disposable SQLite store, and synthetic credentials.
Create a Provider in a Workspace and record its ID and resource version.
As another authorized Workspace administrator, delete it and create a Provider under the same name. The two IDs differ and both initial versions are 1.
Call UpdateProvider with the former Provider's ID, name, and version and a new synthetic credential. The Gateway returns the replacement's ID. An operator credential read confirms that the replacement received the update.
Call DeleteProvider for the same name. The Gateway deletes the replacement. The delete request has no field for the original ID.
Requested behavior
On Provider creation, let the caller require the intended Workspace incarnation and profile revision. Refuse before storing material if either precondition fails.
On Provider update and delete, let the caller require the intended Provider ID. If a same-name replacement exists, refuse before changing its credential or deleting it. Preserve the existing resource version check for updates to the same Provider.
Expose a capability or RPC contract that lets clients require these guarantees before sending a write.
Reproduced on main 152c59d with a focused test: create → delete → recreate the same name → UpdateProvider carrying the original metadata.id and resource_version: 1 succeeds, writes the new credential to the replacement, and returns the replacement's ID.
Cause: update_provider_record_validating resolves by name and never compares the request's provider.metadata.id (crates/openshell-server/src/grpc/provider.rs:483-491); candidate is the resolved record (provider.rs:532) and the CAS is version-only (provider.rs:616-625), so the version-1 replacement passes the stale write. DeleteProviderRequest has no identity field (proto/openshell.proto:2465-2472); delete resolves by name (provider.rs:705-711), and the guard at provider.rs:744-750 only covers a replacement created after resolution.
Given the #5794/#5872 response that name reuse is a workspace coordination concern, the narrowest change that does not depend on that: reject a non-empty provider.metadata.id that differs from the resolved object before any credential staging, and add an optional expected ID to delete. Empty stays legacy behavior, so the CLI (id: "", resource_version: 0) is unaffected. For the create side, the profile catalog already computes a revision (crates/openshell-server/src/provider_profile_sources.rs:600-613) that could back a profile-revision precondition.
Would that narrower form be acceptable upstream, or is name-only semantics intended and worth documenting as such?
Activity
yjjnls commentedon Nov 24, 2026
Reproduced on main
152c59dwith a focused test: create → delete → recreate the same name →UpdateProvidercarrying the originalmetadata.idandresource_version: 1succeeds, writes the new credential to the replacement, and returns the replacement's ID.Cause:
update_provider_record_validatingresolves by name and never compares the request'sprovider.metadata.id(crates/openshell-server/src/grpc/provider.rs:483-491);candidateis the resolved record (provider.rs:532) and the CAS is version-only (provider.rs:616-625), so the version-1 replacement passes the stale write.DeleteProviderRequesthas no identity field (proto/openshell.proto:2465-2472); delete resolves by name (provider.rs:705-711), and the guard atprovider.rs:744-750only covers a replacement created after resolution.Given the #5794/#5872 response that name reuse is a workspace coordination concern, the narrowest change that does not depend on that: reject a non-empty
provider.metadata.idthat differs from the resolved object before any credential staging, and add an optional expected ID to delete. Empty stays legacy behavior, so the CLI (id: "",resource_version: 0) is unaffected. For the create side, the profile catalog already computes a revision (crates/openshell-server/src/provider_profile_sources.rs:600-613) that could back a profile-revision precondition.Would that narrower form be acceptable upstream, or is name-only semantics intended and worth documenting as such?
FrostGod commentedon Nov 24, 2026
thanks for opening this @yjjnls , I'll take a look at this