Skip to content

feat: as default not to log the session val#17

Merged
mansonchor merged 25 commits intoeggjs:masterfrom
clChenLiang:master
Mar 23, 2021
Merged

feat: as default not to log the session val#17
mansonchor merged 25 commits intoeggjs:masterfrom
clChenLiang:master

Conversation

@clChenLiang
Copy link
Copy Markdown
Contributor

Checklist
  • npm test passes
  • commit message follows commit guidelines
Affected core subsystem(s)
Description of change

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 4, 2021

Codecov Report

Merging #17 (12a9c6a) into master (a21e6fe) will decrease coverage by 57.14%.
The diff coverage is 50.00%.

❗ Current head 12a9c6a differs from pull request most recent head fba5392. Consider uploading reports for the commit fba5392 to get more accurate results
Impacted file tree graph

@@             Coverage Diff             @@
##           master      #17       +/-   ##
===========================================
- Coverage   96.42%   39.28%   -57.15%     
===========================================
  Files           4        4               
  Lines          28       28               
===========================================
- Hits           27       11       -16     
- Misses          1       17       +16     
Impacted Files Coverage Δ
config/config.default.js 100.00% <ø> (ø)
app.js 70.00% <50.00%> (-20.00%) ⬇️
app/extend/application.js 12.50% <0.00%> (-87.50%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a21e6fe...fba5392. Read the comment docs.

app.js Outdated
});
app.on('session:expired', ({ ctx, key, value }) => {
ctx.coreLogger.warn('[session][expired] key(%s) value(%j)', key, value);
ctx.coreLogger.warn('[session][expired] key(%s) value(%j)', key, app.config.logValue ? value : '');
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里应该是 config.session.logValue 吧

httpOnly: true,
encrypt: true,
// sameSite: null,
logValue: false,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

默认应该是 true,否则就 break 了

@mansonchor
Copy link
Copy Markdown
Member

要补单测的

@mansonchor mansonchor requested review from atian25 and killagu March 4, 2021 09:37
@jasonslyvia
Copy link
Copy Markdown

ping

Copy link
Copy Markdown
Member

@dead-horse dead-horse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

文档里面说明一下这个参数吧

@mansonchor
Copy link
Copy Markdown
Member

LGTM

@mansonchor mansonchor merged commit fb47f1b into eggjs:master Mar 23, 2021
app.expectLog('[session][expired] key(undefined) value("")', 'coreLogger');
});

it.only('when logValue is false, valid false, should not log the session value', async () => {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only 了

@popomore
Copy link
Copy Markdown
Member

@mansonchor 这个覆盖率低了

@popomore
Copy link
Copy Markdown
Member

  • egg-session@3.3.0

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants