Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
ruby-passwordstate
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LiU IT - Infrastructure
ruby-passwordstate
Commits
5bf35423
Verified
Commit
5bf35423
authored
4 years ago
by
Alexander Olofsson
Browse files
Options
Downloads
Patches
Plain Diff
Improve body cleaner for debug output
parent
c27aab89
No related branches found
No related tags found
No related merge requests found
Pipeline
#17829
failed
4 years ago
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/passwordstate/client.rb
+9
-1
9 additions, 1 deletion
lib/passwordstate/client.rb
with
9 additions
and
1 deletion
lib/passwordstate/client.rb
+
9
−
1
View file @
5bf35423
...
...
@@ -152,9 +152,17 @@ module Passwordstate
return
if
http
.
body
.
nil?
body_cleaner
=
lambda
do
|
obj
|
obj
.
each
{
|
k
,
v
|
v
.
replace
(
'[ REDACTED ]'
)
if
k
.
is_a?
(
String
)
&&
%w[password apikey]
.
include?
(
k
.
downcase
)
}
if
obj
.
is_a?
Hash
end
clean_body
=
JSON
.
parse
(
http
.
body
)
rescue
nil
if
clean_body
clean_body
=
clean_body
.
each
{
|
k
,
v
|
v
.
replace
(
'[ REDACTED ]'
)
if
k
.
is_a?
(
String
)
&&
%w[password apikey]
.
include?
(
k
.
downcase
)
}.
to_json
if
http
.
body
if
clean_body
.
is_a?
Array
clean_body
.
each
{
|
val
|
body_cleaner
.
call
(
val
)
}
else
body_cleaner
.
call
(
clean_body
)
end
else
clean_body
=
http
.
body
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment