-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2801 from subutai-io/dev
#2797 Dev -> Master
- Loading branch information
Showing
7 changed files
with
213 additions
and
1 deletion.
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
40 changes: 40 additions & 0 deletions
40
...er/local-peer-cli/src/main/java/io/subutai/core/localpeer/cli/AddSshKeyToUserCommand.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,40 @@ | ||
package io.subutai.core.localpeer.cli; | ||
|
||
|
||
import org.apache.karaf.shell.commands.Argument; | ||
import org.apache.karaf.shell.commands.Command; | ||
|
||
import io.subutai.common.peer.LocalPeer; | ||
import io.subutai.core.identity.rbac.cli.SubutaiShellCommandSupport; | ||
|
||
|
||
@Command( scope = "localpeer", name = "add-ssh-key" ) | ||
public class AddSshKeyToUserCommand extends SubutaiShellCommandSupport | ||
{ | ||
private final LocalPeer localPeer; | ||
|
||
@Argument( index = 0, name = "container id", required = true, description = "target container id" ) | ||
String containerId; | ||
|
||
@Argument( index = 1, name = "user", required = true, description = "username of target user" ) | ||
String username; | ||
|
||
@Argument( index = 2, name = "ssh public key", required = true, description = "public ssh key to add" ) | ||
String pubSshKey; | ||
|
||
|
||
public AddSshKeyToUserCommand( final LocalPeer localPeer ) | ||
{ | ||
this.localPeer = localPeer; | ||
} | ||
|
||
|
||
@Override | ||
protected Object doExecute() throws Exception | ||
{ | ||
|
||
localPeer.addAuthorizedSshKeyToUser( containerId, username, pubSshKey ); | ||
|
||
return null; | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
...local-peer-cli/src/main/java/io/subutai/core/localpeer/cli/RemoveSshKeyToUserCommand.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,40 @@ | ||
package io.subutai.core.localpeer.cli; | ||
|
||
|
||
import org.apache.karaf.shell.commands.Argument; | ||
import org.apache.karaf.shell.commands.Command; | ||
|
||
import io.subutai.common.peer.LocalPeer; | ||
import io.subutai.core.identity.rbac.cli.SubutaiShellCommandSupport; | ||
|
||
|
||
@Command( scope = "localpeer", name = "remove-ssh-key" ) | ||
public class RemoveSshKeyToUserCommand extends SubutaiShellCommandSupport | ||
{ | ||
private final LocalPeer localPeer; | ||
|
||
@Argument( index = 0, name = "container id", required = true, description = "target container id" ) | ||
String containerId; | ||
|
||
@Argument( index = 1, name = "user", required = true, description = "username of target user" ) | ||
String username; | ||
|
||
@Argument( index = 2, name = "ssh public key", required = true, description = "public ssh key to add" ) | ||
String pubSshKey; | ||
|
||
|
||
public RemoveSshKeyToUserCommand( final LocalPeer localPeer ) | ||
{ | ||
this.localPeer = localPeer; | ||
} | ||
|
||
|
||
@Override | ||
protected Object doExecute() throws Exception | ||
{ | ||
|
||
localPeer.removeAuthorizedSshKeyFromUser( containerId, username, pubSshKey ); | ||
|
||
return null; | ||
} | ||
} |
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