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

Username for accessing servers via Maven must not be encrypted #1389

Open
ohecker opened this issue Oct 10, 2024 · 2 comments · Fixed by devonfw/ide-settings#62
Open

Username for accessing servers via Maven must not be encrypted #1389

ohecker opened this issue Oct 10, 2024 · 2 comments · Fixed by devonfw/ide-settings#62
Assignees
Labels
bug Something isn't working good-first-issue Good for newcomers
Milestone

Comments

@ohecker
Copy link
Member

ohecker commented Oct 10, 2024

Expected behavior

As a user of Maven within the devonFW IDE, I want to use the given settings.xml template (https://github.com/devonfw/ide-settings/blob/main/templates/conf/mvn/settings.xml) to generate my local configuration when setting up the IDE.

Actual behavior

The templating mechanism uses the maven password encryption mechanism for every encountered variable $[...] to be replaced. Within the given default template this results in also the username (not just the password) to be encrypted:
https://github.com/devonfw/ide-settings/blob/b1d63fbc7849e9585d52595d786c30362212c34e/templates/conf/mvn/settings.xml#L20-L26.

Using the generated settings.xml results in HTTP 401 Unauthorized.

Steps to reproduce (bug) / Use Case of feature request (enhancement)

See above.

Related/Dependent Issues

Comments/Hints:

Using encryption on all variables to be replaced was a design decision documented in #542 . This decision was obviously based on the assumption that encrypting variables is a universal feature and can be used throughout the whole settings.xml. This is not correct: The option to use encryption in the settings.xml is only available for server passwords.

Possible quick fix/workaround: If the user name to be used is the name of the current OS user then

<servers>
   <server>
     <id>repository</id>
     <username>${env.USERNAME}</username>
     <password>$[mavenRepoPassword]</password>
   </server>
 </servers>

or

  <servers>
    <server>
      <id>repository</id>
      <username>${user.name}</username>
      <password>$[mavenRepoPassword]</password>
    </server>
  </servers>

will do the job.

If this is not the required user name, then probably the templating mechanism need to be extended to allow choosing if a variable should be encrypted or not.

Affected version:

  • OS: all
  • Browser: N/A
@ohecker ohecker added the bug Something isn't working label Oct 10, 2024
@hohwille hohwille added the good-first-issue Good for newcomers label Oct 11, 2024
@github-project-automation github-project-automation bot moved this to 🆕 New in IDEasy board Oct 11, 2024
@hohwille
Copy link
Member

was auto-closed by github.
Reopening since only fixed for IDEasy but not for devonfw-ide.

@hohwille hohwille reopened this Oct 25, 2024
@hohwille hohwille added this to the settings milestone Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good-first-issue Good for newcomers
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

4 participants