Skip to content

Conversation

@ferstl
Copy link

@ferstl ferstl commented Oct 9, 2018

We need to use a custom HttpTraceRepository to persist all HTTP requests and responses for auditing reasons.

Persisting HttpTrace objects is not a problem. However, recreating them (HttpTraceRepository.findAll()) is not possible in custom HttpTraceRepository implementations due to the package-private constructors in HttpTrace and its inner classes.

This PR does:

  • add a public no-arg constructor to HttpTrace
  • add public setters for timestamp, request and principal
  • add public constructors for the inner classes of HttpTrace
  • add @JsonCreator and @JsonProperty annotations for proper deserialization
  • add a test for JSON serialization and deserialization

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Oct 9, 2018
@wilkinsona
Copy link
Member

wilkinsona commented Oct 9, 2018

Thanks for the proposal. I’m not keen on opening up the HttpTrace API like this. We don’t intend HttpTrace instances to be created from JSON only serialised to JSON. Making things like the timestamp mutable is also problematic.

Can we please take a step back? Can you open an issue that describes what you’d like to do? I think you want to be able to persist and recreate HttpTrace instances on the server-side, although you haven’t said that in so many words. Once we fully understand the problem we can hopefully agree on some changes that solve that problem.

@wilkinsona wilkinsona closed this Oct 9, 2018
@wilkinsona wilkinsona added status: declined A suggestion or change that we don't feel we should currently apply and removed status: waiting-for-triage An issue we've not yet triaged labels Oct 9, 2018
@ferstl
Copy link
Author

ferstl commented Oct 9, 2018

Ok, I'll do that...

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

Labels

status: declined A suggestion or change that we don't feel we should currently apply

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants