Swap base58 libraries (#472)

* Swap base58 libraries

This doesn't reduce binary size but it removes a metric ton of
dependencies.
This commit is contained in:
Jeff Mitchell authored and GitHub committed 2020-09-26 14:01:49 -04:00
1 parent c30fd5620e
commit cf3fa4522d
10 files changed
+44 -35

No files matched your search

@@ -78,6 +78,7 @@ func TestGetSession(t *testing.T) {
ExpirationTime: sess.ExpirationTime.GetTimestamp(),
Scope: &scopes.ScopeInfo{Id: p.GetPublicId(), Type: scope.Project.String()},
States: []*pb.SessionState{{Status: session.StatusPending.String(), StartTime: sess.CreateTime.GetTimestamp()}},
Certificate: sess.Certificate,
}
cases := []struct {
@@ -191,6 +192,7 @@ func TestList(t *testing.T) {
Scope: &scopes.ScopeInfo{Id: pWithSessions.GetPublicId(), Type: scope.Project.String()},
Status: status,
States: states,
Certificate: sess.Certificate,
})
}
@@ -299,6 +301,7 @@ func TestCancel(t *testing.T) {
ExpirationTime: sess.ExpirationTime.GetTimestamp(),
Scope: &scopes.ScopeInfo{Id: p.GetPublicId(), Type: scope.Project.String()},
Status: session.StatusCanceling.String(),
Certificate: sess.Certificate,
}
version := wireSess.GetVersion()
@@ -7,7 +7,6 @@ import (
"math/rand"
"net/url"
"github.com/btcsuite/btcutil/base58"
"github.com/golang/protobuf/ptypes/wrappers"
"github.com/hashicorp/boundary/internal/auth"
"github.com/hashicorp/boundary/internal/db"
@@ -25,6 +24,7 @@ import (
"github.com/hashicorp/boundary/internal/types/action"
"github.com/hashicorp/boundary/internal/types/resource"
"github.com/hashicorp/boundary/internal/types/scope"
"github.com/mr-tron/base58"
"google.golang.org/grpc/codes"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/types/known/timestamppb"
@@ -401,13 +401,15 @@ HostSetIterationLoop:
if err != nil {
return nil, err
}
encodedMarshaledSad := base58.FastBase58Encoding(marshaledSad)
ret := &pb.SessionAuthorization{
SessionId: sess.PublicId,
TargetId: t.GetPublicId(),
Scope: authResults.Scope,
CreatedTime: sess.CreateTime.GetTimestamp(),
Type: t.GetType(),
AuthorizationToken: base58.Encode(marshaledSad),
AuthorizationToken: string(encodedMarshaledSad),
UserId: authResults.UserId,
HostId: chosenId.hostId,
HostSetId: chosenId.hostSetId,