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

Fixes #667 and correct a few details #705

Merged
merged 8 commits into from
Mar 9, 2018
Merged

Fixes #667 and correct a few details #705

merged 8 commits into from
Mar 9, 2018

Conversation

AnomalRoil
Copy link
Member

This primarily adds the config option requested in #667.

I've added back the notion or erroring in case of a show action on an
entry with only a password and the safe content option enabled.

Also I've fixed the way the String() function of the StoreConfig forgot
to display the Notification value in its output.

I've also handled the merge conflict caused by #703.

Now, this does NOT work for the generate action, for a reason I do not yet fully understand. I hope you'll be able to help me there.
In the show action, the context seems to correctly use the config values set.

However, when running the Generate action, ctxutil.HasAutoClip(ctx) returns false, even if gopass config autoclip returns true.
As per the default value of AutoClip, IsAutoClip will return true is HasAutoClip is false...

This makes no sense to me, it's just like if the Generate action had not loaded the context correctly.

Yolan Romailler added 6 commits March 9, 2018 11:28
This primarily adds the config option requested in #667.
I've added back the notion or erroring in case of a show action on an
entry with only a password and the safe content option enabled
Also I've fixed the way the String() function of the StoreConfig forgot
to display the Notification value in its output.
@AnomalRoil
Copy link
Member Author

It seems that the Generate action does not use the correct context and has not the correct settings.

I suspect this might be related to the newly added #701. I've tried using Store.GetContext, to no avail...

@codecov
Copy link

codecov bot commented Mar 9, 2018

Codecov Report

Merging #705 into master will decrease coverage by 0.08%.
The diff coverage is 42.86%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #705      +/-   ##
==========================================
- Coverage   65.66%   65.59%   -0.08%     
==========================================
  Files         150      150              
  Lines        8556     8578      +22     
==========================================
+ Hits         5618     5626       +8     
- Misses       2272     2286      +14     
  Partials      666      666
Impacted Files Coverage Δ
commands.go 92.12% <ø> (ø) ⬆️
store/root/write.go 50% <0%> (-50%) ⬇️
config/config.go 88.89% <100%> (+0.21%) ⬆️
config/context.go 100% <100%> (ø) ⬆️
config/store_config.go 76.12% <100%> (ø) ⬆️
action/generate.go 59.63% <50%> (+1.54%) ⬆️
action/show.go 52.87% <75%> (-0.07%) ⬇️
utils/ctxutil/ctxutil.go 94.74% <9.09%> (-5.26%) ⬇️

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 e2fcbbe...ccdbc8c. Read the comment docs.

@AnomalRoil
Copy link
Member Author

Alright, I've found it: when Setting the password in the store, the correct Store context wasn't retrieved since there was no "SetContext" function doing the same as the "GetContext" does.

@dominikschulz
Copy link
Member

Yes, I was just about the state this but you beat me by a few minutes ;)

The PR looks good. Thanks for fixing some existing flaws 👍

Copy link
Member

@dominikschulz dominikschulz left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks a lot!

@dominikschulz dominikschulz merged commit 081af2f into gopasspw:master Mar 9, 2018
@AnomalRoil
Copy link
Member Author

I'm afraid I forgot some tests as Codecov said.
Here they are:
AnomalRoil@4b4f00e

@dominikschulz
Copy link
Member

Alright, I'll just pull them from there. Thanks a lot!

kpitt pushed a commit to kpitt/gopass that referenced this pull request Jul 21, 2022
* Fixes gopasspw#667 and correct a few details

This primarily adds the config option requested in gopasspw#667.
I've added back the notion or erroring in case of a show action on an
entry with only a password and the safe content option enabled
Also I've fixed the way the String() function of the StoreConfig forgot
to display the Notification value in its output.

* Adding tests for autoclip

* adding a clip flag back

* correcting an old copy-paste mistake

* trying to correct the problem

* Correcting the error caused by gopasspw#701
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.

2 participants