You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2020/05/19 23:16:44 UTC

[GitHub] [maven-resolver] spyhunter99 commented on a change in pull request #51: MNG-5583 per endpoint support for PKI authentication to maven repos

spyhunter99 commented on a change in pull request #51:
URL: https://github.com/apache/maven-resolver/pull/51#discussion_r427652722



##########
File path: maven-resolver-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/WagonTransporter.java
##########
@@ -185,32 +184,21 @@ private AuthenticationInfo getAuthenticationInfo( RemoteRepository repository,
 
         if ( authContext != null )
         {
-            auth = new AuthenticationInfo()
-            {
-                @Override
-                public String getUserName()
-                {
-                    return authContext.get( AuthenticationContext.USERNAME );
-                }
-
-                @Override
-                public String getPassword()
-                {
-                    return authContext.get( AuthenticationContext.PASSWORD );
-                }
-
-                @Override
-                public String getPrivateKey()
-                {
-                    return authContext.get( AuthenticationContext.PRIVATE_KEY_PATH );
-                }
-
-                @Override
-                public String getPassphrase()
-                {
-                    return authContext.get( AuthenticationContext.PRIVATE_KEY_PASSPHRASE );
-                }
-            };
+            auth = new AuthenticationInfo();
+            auth.setUserName( authContext.get( AuthenticationContext.USERNAME ) );
+            auth.setPassword( authContext.get( AuthenticationContext.PASSWORD ) );
+            auth.setPrivateKey( authContext.get( AuthenticationContext.PRIVATE_KEY_PATH ) );
+            auth.setPassphrase( authContext.get( AuthenticationContext.PRIVATE_KEY_PASSPHRASE ) );
+            //MNG-5583 per endpoint PKI authentication
+            auth.setKeyAlias( authContext.get( "getKeyAlias" ) );

Review comment:
       see the other PR for maven core. I was a bit hesitant on this too but i figured someone else with more knowledge that me would chime in with the right answer. I can add these keys in the AuthenticationContext class as constants, would that work?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org