WorkerCoordination and GetSession API refactoring (#354)

* Possible api changes.

* Worker API update.

* Updating import alias name.

* Moving session down a level as a member of the GetSessionResponse.

* Marshal the auth flag into the GetSessionResponse proto instead of the session.
This commit is contained in:
Todd Knight authored and GitHub committed 2020-09-12 21:54:18 -07:00
1 parent 2914b4c14c
commit 33e7b4538e
18 files changed
+1923 -936

No files matched your search

+4 -3
View File
@@ -17,7 +17,7 @@ import (
"github.com/golang/protobuf/proto"
"github.com/hashicorp/boundary/globals"
"github.com/hashicorp/boundary/internal/cmd/base"
"github.com/hashicorp/boundary/internal/gen/controller/api/services"
wpbs "github.com/hashicorp/boundary/internal/gen/controller/servers/services"
"github.com/hashicorp/boundary/internal/proxy"
"github.com/hashicorp/go-cleanhttp"
"github.com/hashicorp/vault/sdk/helper/base62"
@@ -147,11 +147,12 @@ func (c *Command) Run(args []string) int {
return 1
}
sessionInfo := new(services.ValidateSessionResponse)
if err := proto.Unmarshal(marshaled, sessionInfo); err != nil {
sessionResponseInfo := new(wpbs.GetSessionResponse)
if err := proto.Unmarshal(marshaled, sessionResponseInfo); err != nil {
c.UI.Error(fmt.Errorf("Unable to proto-decode authorization string: %w", err).Error())
return 1
}
sessionInfo := sessionResponseInfo.GetSession()
if len(sessionInfo.GetWorkerInfo()) == 0 {
c.UI.Error("No workers found in authorization string")