-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue 46: Pravega CLI to work in environments with security enabled
- Making changes to the CLI to allow for functioning in TLS settings. - Changing the config and code to make TLS support togglable. Signed-off-by: anirudhkovuru <[email protected]>
- Loading branch information
Showing
21 changed files
with
772 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
.../src/main/java/io/pravega/tools/pravegacli/commands/utils/ControllerHostnameVerifier.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** | ||
* Copyright (c) 2017 Dell Inc., or its subsidiaries. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
*/ | ||
package io.pravega.tools.pravegacli.commands.utils; | ||
|
||
import javax.net.ssl.HostnameVerifier; | ||
import javax.net.ssl.SSLSession; | ||
|
||
public class ControllerHostnameVerifier implements HostnameVerifier { | ||
@Override | ||
public boolean verify(String s, SSLSession sslSession) { | ||
return s.equalsIgnoreCase(sslSession.getPeerHost()); | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
...test/java/io/pravega/tools/pravegacli/AuthEnabledControllerDescribeStreamCommandTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/** | ||
* Copyright (c) Dell Inc., or its subsidiaries. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
*/ | ||
package io.pravega.tools.pravegacli; | ||
|
||
import io.pravega.client.ClientConfig; | ||
import io.pravega.client.stream.impl.DefaultCredentials; | ||
import io.pravega.test.common.SecurityConfigDefaults; | ||
import org.junit.After; | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
|
||
import java.net.URI; | ||
|
||
public class AuthEnabledControllerDescribeStreamCommandTest extends ControllerDescribeStreamCommandTest{ | ||
@Before | ||
public void setUp() throws Exception { | ||
this.AUTH_ENABLED = true; | ||
super.setUp(); | ||
} | ||
|
||
@Override | ||
ClientConfig prepareValidClientConfig() { | ||
return ClientConfig.builder() | ||
.controllerURI(URI.create(this.localPravega.getInProcPravegaCluster().getControllerURI())) | ||
|
||
// Auth-related | ||
.credentials(new DefaultCredentials(SecurityConfigDefaults.AUTH_ADMIN_PASSWORD, | ||
SecurityConfigDefaults.AUTH_ADMIN_USERNAME)) | ||
.build(); | ||
} | ||
|
||
@Test | ||
@Override | ||
public void testDescribeStreamCommand() throws Exception { | ||
super.testDescribeStreamCommand(); | ||
} | ||
|
||
@After | ||
@Override | ||
public void tearDown() throws Exception { | ||
super.tearDown(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.