storj/multinode/console/controllers
Clement Sam 7e5025cac0 {storagenode,multinode/nodes}: use multinodeauth.Secret instead of []byte for APISecret
When enconding structs into JSON, byte slices are marshalled as base64
encoded string using the base64.StdEncoding.Encode():
ea9c3fd42d/src/encoding/json/encode.go (L833-L861)

We, however, expect API Secrets to be encoded as base64URL, so when
an marshalled secret (with byte slice type) is added to the multinode
dashboard, it fails with `illegal base64 data at input byte XX`.

This change changes the type of APISecret field in the
multinode/nodes.Nodes struct to use multinodeauth.Secret type instead
of []byte.
multinodeauth.Secret is extended with custom MarshalJSON and
UnmarshalJSON methods which implement the json.Marshaler and
json.Unmarshaler interfaces, respectively.

Resolves https://github.com/storj/storj/issues/4949

Change-Id: Ib14b5f49ceaac109620c25d7ff83be865c698343
2022-08-23 11:04:04 +00:00
..
bandwidth.go multinode/bandwidth: added monthly bandwidth summaries 2021-06-11 16:31:59 +00:00
common.go multinode/console: node list and get api 2020-12-17 16:19:57 +02:00
nodes.go {storagenode,multinode/nodes}: use multinodeauth.Secret instead of []byte for APISecret 2022-08-23 11:04:04 +00:00
operators.go multinode/console: operators controller added 2021-06-01 19:01:14 +03:00
payouts.go multinode/console: held amount summary use satellite address 2021-06-10 15:55:43 +03:00
reputation.go multinode/console: add reputation satellite api 2021-07-05 15:32:22 +00:00
storage.go multinode/console: add summary to storage usage API 2021-07-07 15:00:05 +03:00