Skip to content

[PM-41448] feat: add unified collection PATCH endpoint with delta access - #8138

Draft
r-tome wants to merge 2 commits into
ac/pm-41270/collection-group-auth-handlerfrom
ac/pm-41448/unified-collection-endpoint
Draft

[PM-41448] feat: add unified collection PATCH endpoint with delta access#8138
r-tome wants to merge 2 commits into
ac/pm-41270/collection-group-auth-handlerfrom
ac/pm-41448/unified-collection-endpoint

Conversation

@r-tome

@r-tome r-tome commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-41448

📔 Objective

Adds a feature-flagged PATCH organizations/{orgId}/collections/{id} Minimal API endpoint that updates collection metadata and applies user/group access deltas in a single atomic transaction. The existing PUT endpoint is unchanged — when the flag is off, clients continue using it as before.

Also resolves PM-35161 by adding the PM35160CollectionAuthorizationHandlers feature flag constant back to src/Core/Constants.cs.

📸 Screenshots

N/A — server-only change.

Comment on lines +26 to +33
catch (Exception exception)
{
var endpointName = context.HttpContext.GetEndpoint()?.DisplayName;
context.HttpContext.RequestServices.GetRequiredService<ILogger<AdminConsoleExceptionHandlerEndpointFilter>>()
.LogError(exception, "Unhandled exception in {EndpointName}", endpointName);
return TypedResults.Json(
new ErrorResponseModel("An error has occurred."), statusCode: StatusCodes.Status500InternalServerError);
}
await sutProvider.GetDependency<IModifyCollectionUserAccessCommand>().Received(1)
.ModifyAsync(Arg.Is<ModifyCollectionUserAccessRequest>(r =>
r.PerformingOrganizationUserId == callerOrgUserId
&& r.AllowAdminAccessToAllCollectionItems == true));
await sutProvider.GetDependency<IModifyCollectionGroupAccessCommand>().Received(1)
.ModifyAsync(Arg.Is<ModifyCollectionGroupAccessRequest>(r =>
r.PerformingOrganizationUserId == callerOrgUserId
&& r.AllowAdminAccessToAllCollectionItems == true));
@codecov

codecov Bot commented Aug 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.80519% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.49%. Comparing base (6e27e01) to head (e1a4022).

Files with missing lines Patch % Lines
.../AdminConsole/Utilities/CommandResultExtensions.cs 79.16% 4 Missing and 1 partial ⚠️
.../Api/AdminConsole/Endpoints/CollectionEndpoints.cs 88.88% 1 Missing ⚠️
...ters/AdminConsoleExceptionHandlerEndpointFilter.cs 94.11% 0 Missing and 1 partial ⚠️
...sole/Endpoints/Handlers/UpdateCollectionHandler.cs 98.70% 1 Missing ⚠️
Additional details and impacted files
@@                              Coverage Diff                              @@
##           ac/pm-41270/collection-group-auth-handler    #8138      +/-   ##
=============================================================================
- Coverage                                      66.92%   62.49%   -4.44%     
=============================================================================
  Files                                           2309     2318       +9     
  Lines                                         100539   100669     +130     
  Branches                                        9087     9098      +11     
=============================================================================
- Hits                                           67284    62909    -4375     
- Misses                                         30976    35575    +4599     
+ Partials                                        2279     2185      -94     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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