Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there any way to replace the feign header 's value as "secret"? #1561

Closed
MGunel opened this issue Dec 30, 2021 · 6 comments
Closed

Is there any way to replace the feign header 's value as "secret"? #1561

MGunel opened this issue Dec 30, 2021 · 6 comments
Labels
feedback provided Feedback has been provided to the author question General usage or 'how-to' questions

Comments

@MGunel
Copy link

MGunel commented Dec 30, 2021

Is there any way to replace the feign header's value in log ? I found the way to exclude headers from logs but I want to replace feign header's value as "secret" .I did this by overriding shouldLogRequestHeader method

@MGunel MGunel changed the title Is there any way to replace the feign header ? Is there any way to replace the feign header 's value as "secret"? Dec 30, 2021
@sakibulalam
Copy link

if you want to exclude secret values from the logs, why not configure your logger to mask those. We use logback and use pathMask and valueMask to mask sensitive values in the log.

@MGunel
Copy link
Author

MGunel commented Jan 4, 2022

if you want to exclude secret values from the logs, why not configure your logger to mask those. We use logback and use pathMask and valueMask to mask sensitive values in the log.

I use logbook for project but logbook. removeheader does not affect feign log ,because feign log use slf4J by default when it is logging.And So I can see sensitive data in log when request sent.
Can Logback framework do it for feign log that automatcally logged?

@MGunel
Copy link
Author

MGunel commented Jan 4, 2022

I found (https://github.com/OpenFeign/feign/pull/1530)this .It is exculude but I want to replace with"secret"

@vitalijr2
Copy link
Collaborator

vitalijr2 commented Jan 23, 2022

@MGunel Logback can be used as implementation of slf4j: you can configure excluding as @sakibulalam said.

For me it is better way than to add masking logic to Feign's Logger.

@kdavisk6
Copy link
Member

Echoing @radio-rogal, You will need to provide your own Logger implementation for this sort of customized handling. Our provided Logger implementations do not allow for pattern customization at this time. Could be a good candidate for an enhancement. If this is something you are interested in, feel free to submit a proposal.

@kdavisk6 kdavisk6 added feedback provided Feedback has been provided to the author question General usage or 'how-to' questions labels Mar 24, 2022
@kdavisk6 kdavisk6 closed this as completed Oct 7, 2022
@kdavisk6
Copy link
Member

kdavisk6 commented Oct 7, 2022

Given there's been no update or proposal, I'm assuming you are good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feedback provided Feedback has been provided to the author question General usage or 'how-to' questions
Projects
None yet
Development

No branches or pull requests

4 participants