-
Notifications
You must be signed in to change notification settings - Fork 2.2k
[FEATURE REQ] CosmosDB Spring Data Auditor ReactiveAuditorAware support #42115
Copy link
Copy link
Open
Labels
ClientThis issue points to a problem in the data-plane of the library.This issue points to a problem in the data-plane of the library.azure-springAll azure-spring related issuesAll azure-spring related issuescustomer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.feature-requestThis issue requires a new behavior in the product in order be resolved.This issue requires a new behavior in the product in order be resolved.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamWorkflow: This issue needs attention from Azure service team or SDK team
Milestone
Metadata
Metadata
Assignees
Labels
ClientThis issue points to a problem in the data-plane of the library.This issue points to a problem in the data-plane of the library.azure-springAll azure-spring related issuesAll azure-spring related issuescustomer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.feature-requestThis issue requires a new behavior in the product in order be resolved.This issue requires a new behavior in the product in order be resolved.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamWorkflow: This issue needs attention from Azure service team or SDK team
Type
Fields
Give feedbackNo fields configured for issues without a type.
Projects
Status
Todo
Is your feature request related to a problem? Please describe.
Using Spring WebFlux, we store the authenticated user in the Reactive context. We would like to be able to automatically write this user to the
@LastModifiedByfield in our Cosmos entities. This should be pretty straightforward since Spring Data has an Auditor concept, which this SDK enables with@EnableCosmosAuditing. However, that only looks for a bean that implementsAuditorAware, which doesn't support getting information from the Reactive context but is designed for getting information out of some sort of thread-local store or the like.Describe the solution you'd like
I'm looking for something along the lines of
@EnableReactiveCosmosAuditing, which looks for a bean implementing theReactiveAuditorAwareinterface instead. For example, with Spring Data for MongoDB, there is a@EnableReactiveMongoAuditingin addition to@EnableMongoAuditing.Describe alternatives you've considered
We could work around it by adding code to each time we save that looks up the current user in the reactive context and sets our modified-by field directly. But it would be much more convenient to just use the Spring Data auditing support which is already there.
Thank you!
Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report