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:
1 parent
c30fd5620e
commit
cf3fa4522d
10 files changed
+44
-35
No files matched your search
@@ -8,7 +8,6 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/btcsuite/btcutil/base58"
|
||||
"github.com/hashicorp/boundary/globals"
|
||||
"github.com/hashicorp/boundary/internal/gen/controller/api/resources/scopes"
|
||||
"github.com/hashicorp/boundary/internal/gen/controller/tokens"
|
||||
@@ -23,6 +22,7 @@ import (
|
||||
"github.com/hashicorp/go-hclog"
|
||||
wrapping "github.com/hashicorp/go-kms-wrapping"
|
||||
"github.com/kr/pretty"
|
||||
"github.com/mr-tron/base58"
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
@@ -500,7 +500,12 @@ func (v *verifier) decryptToken() {
|
||||
v.requestInfo.TokenFormat = AuthTokenTypeUnknown
|
||||
return
|
||||
}
|
||||
marshaledToken := base58.Decode(v.requestInfo.EncryptedToken[len(globals.ServiceTokenV1):])
|
||||
marshaledToken, err := base58.FastBase58Decoding(v.requestInfo.EncryptedToken[len(globals.ServiceTokenV1):])
|
||||
if err != nil {
|
||||
v.logger.Trace("decrypt bearer token: error unmarshaling base58 token; continuing as anonymous user", "error", err)
|
||||
v.requestInfo.TokenFormat = AuthTokenTypeUnknown
|
||||
return
|
||||
}
|
||||
|
||||
blobInfo := new(wrapping.EncryptedBlobInfo)
|
||||
if err := proto.Unmarshal(marshaledToken, blobInfo); err != nil {
|
||||
|
||||
Reference in new issue
Block a user