-
Notifications
You must be signed in to change notification settings - Fork 1
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
Unified, no more logic than dispatch in SecDispatcher, and is self-describable #75
Conversation
Also introduce two "test" ones, one dispatcher and one source, usable ONLY for testing, as those two have nothing with "encryption".
} | ||
|
||
public static void main(String[] args) throws IOException { | ||
Result<String> pinResult = new PinEntry("/usr/bin/pinentry-gnome3") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on macos we have:
% which pinentry
/opt/homebrew/bin/pinentry
% which pinentry-mac
/opt/homebrew/bin/pinentry-mac
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, change the executable and just run main from IDE to see it in action 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My original goal was to make it work with https://github.com/jorgelbg/pinentry-touchid (so maven encryption with touchID on mac, yay!) but the project seems dead or unsure, but the app did not work on my mac with macOS 15.0.1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, this is the important bit:
.setKeyInfo("maven:masterPassword")
as this is the "handle" for sensitive data, so this is the name of your master pw in keychain, if it is in keychain. According to pinentry doco, this is usually either keyGrip (for PGP keys) or "app:something" formed id.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, this is how my settings-security.xml
looks like:
<?xml version='1.0' encoding='UTF-8'?>
<settingsSecurity xmlns="http://codehaus-plexus.github.io/plexus-sec-dispatcher/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://codehaus-plexus.github.io/plexus-sec-dispatcher/4.0.0 https://codehaus-plexus.github.io/xsd/plexus-sec-dispatcher-4.0.0.xsd">
<modelVersion>4.0</modelVersion>
<defaultDispatcher>master</defaultDispatcher>
<configurations>
<configuration>
<name>master</name>
<properties>
<property>
<name>source</name>
<value>pinentry-prompt:/usr/bin/pinentry-gnome3</value>
</property>
<property>
<name>cipher</name>
<value>AES/GCM/NoPadding</value>
</property>
</properties>
</configuration>
</configurations>
</settingsSecurity>
As you guessed, format is pinentry-prompt:$pathToPinentry
. Just make yours like this, or use mvnenc init
and then edit it manually (as mvnenc is not yet fully done).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I do not. mvn3 encryption is so badly broken, I can share the details in private, but I have no intent to make it backward compat.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead, we may want to upgrade sec-dispatcher to 4.0 in mvn 3.10? But we would lose "mvnenc init" (use mvn4 for that), and also --encrypt-master-password
as well...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think about add a backward compatibility ...
Oh, now I realized: mvn3 would fail to load the new format... so maybe we need new file name / path for sec-dispatcher 4?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Radically simplifies this library, removed all mumbo jumbo about default config file, and Java System property overrides, it is now purely the duty of integrating app how will this be integrated. Also, integrating app "knows" what it needs, and using globals like Java system properties is anyway something is not nice from library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Backward compat solved @slawekjaranowski Now mvn4 will warn if legacy encrypted pw found, and am adding new goal "migrate". If you use mvn3 and mvn4 on same workstation and you insist on encryption, you must use the (broken) mvn3 encryption, and live with warnings mvn4 will emit.
Do not provide "bad" and "never used" defaults as before as it was just the source of confusion, as old component had to be "redefined" in Plexus XML or alike anyway, to be usable in Maven.
...java/org/codehaus/plexus/components/secdispatcher/internal/dispatchers/LegacyDispatcher.java
Dismissed
Show resolved
Hide resolved
Why not have this all sec-dispatcher part of/module inside Maven 4 ? With having possibility to extend/add own encoders if needed as extensions? I don't think this component will be used outside of mvn anyway. |
This lib will not change a lot, it had now a disturbance as we reworked all the bad parts of this (and cipher), and I envision next change (to cipher) when CodeQL declares currently used Cipher "unsafe" (like it did with existing Cipher in 2.0) and we will need to migrate to even newer thing. This is good to have it here. |
@slachiewicz @slawekjaranowski @gnodet pls review, I want to release this soon, and then merge the mvn PR as well: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I'm not convinced by the short attributes, is space so much an issue that we need one-char attributes ?
- the 5
MasterSource
and 2Dispatcher
implementations still have jsr330 annotations
Space is not a problem, these passwords are in Maven settings only, so "space saver short attributes" are meaningless.
Hence, moved version to 4.x.
Changes:
Dispatcher
implementation OOTBDispatcher
andMasterSource
interfaces have corresponding "meta" interfaces where they can "describe themselves"Self describe and validation in action:
https://asciinema.org/a/9kmtQWhKJC9elFp3tiDlxpOTE