blackList headers globally? Filter logs arbitrarily?

28 views
Skip to first unread message

Jonathan Detert

unread,
Aug 2, 2023, 2:17:18 PM8/2/23
to REST assured
Hello,

I have 2 questions about blacklisting/filtering logs:

  1. I know that as of v4.2.0, rest-assured supports black-listing headers from the request or response logs. I see how to do so as part of a request (i.e. in the given(). chain).  Is it possible to set this globally, for all requests?  I want to mask an apikey in the request header that's in every one of my requests.  I'd rather not have to repeat myself, and remember to do so, for each request.
  2. What about filtering the request or response body in a similar way?  I don't see anything about this in the documentation.  How can I do so?  Some of my request and response bodies have a field whose value is not important to the test, and is also on the order of 10k character long.  I'd prefer to mask it for readability of the logs.
Thanks!

Michael Pinnegar

unread,
Aug 6, 2023, 4:18:36 PM8/6/23
to rest-a...@googlegroups.com
https://github.com/rest-assured/rest-assured/wiki/Usage#default-values
You can set up a default filter for #1.

When you're inside a filter you can manipulate the body that ends up getting returned by filtering out a value for #2.


--
You received this message because you are subscribed to the Google Groups "REST assured" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rest-assured...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rest-assured/982e63e6-7661-455b-9cbb-b0243356e153n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages