bastion 0.61.0
This commit is contained in:
+13
-2
@@ -1162,7 +1162,7 @@ func stepupPairing(host string) (*Config, error) {
|
||||
return nil, err
|
||||
}
|
||||
if len(cfgs) == 0 {
|
||||
return nil, fmt.Errorf("not paired yet — run `privatae-bastion pair <token>` first")
|
||||
return nil, fmt.Errorf("not paired yet — connect a Host first: %s", asAdmin("pair <token>"))
|
||||
}
|
||||
switch {
|
||||
case host != "":
|
||||
@@ -1341,7 +1341,7 @@ func readApprovals(o readOpts) (approvalsRead, error) {
|
||||
func cmdStepupApprovals(host string, machine, asJSON bool) error {
|
||||
r, err := readMachine("approvals", readOpts{Host: host, Machine: machine}, readApprovals)
|
||||
if err != nil {
|
||||
return laneRefusalError("approvals", err)
|
||||
return laneRefusalError(strings.TrimSpace(stepupCommand("approvals", host, machine, "")), err)
|
||||
}
|
||||
if asJSON {
|
||||
return printJSON(os.Stdout, r)
|
||||
@@ -1388,6 +1388,9 @@ func findRequest(m map[string]stepupRequest, prefix string) (string, error) {
|
||||
|
||||
// privatae-bastion approve [--host <host> | --machine] <request id>
|
||||
func cmdStepupApprove(host string, machine bool, prefix string) error {
|
||||
if readsGoThroughLane() {
|
||||
return ownerApproveViaLane(host, machine, prefix)
|
||||
}
|
||||
t, err := resolveStepupTarget(host, machine)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -1425,6 +1428,14 @@ func cmdStepupApprove(host string, machine bool, prefix string) error {
|
||||
|
||||
// privatae-bastion deny [--host <host> | --machine] <request id>
|
||||
func cmdStepupDeny(host string, machine bool, prefix string) error {
|
||||
if readsGoThroughLane() {
|
||||
done, err := actViaSock(agentAskRequest{Act: "deny", Host: host, Machine: machine, ID: prefix})
|
||||
if err != nil {
|
||||
return laneRefusalError(stepupCommand("deny", host, machine, prefix), err)
|
||||
}
|
||||
fmt.Println(done)
|
||||
return nil
|
||||
}
|
||||
t, err := resolveStepupTarget(host, machine)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user