Commit Graph

6 Commits

Author SHA1 Message Date
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
Qweder93
8f4505f532 multinode: handling offline nodes added
nodes/service and payouts/service returns node with status offline
or 0 in case if node is offline.

Change-Id: I74c03dcba9ddc9c05885ab329f80f3b14fe8c0fa
2021-07-07 13:25:32 +00:00
Qweder93
cff3da7647 multinode/operators: using old api instead of new until nodes updated.
Change-Id: I210e300f11d03d705ff98e95ab0d9debad59c9d6
2021-06-24 18:37:04 +03:00
crawter
b445e7d397 multinode/operators: operator entity extended with nodeID and undistributed amount
Change-Id: I423fe79b0aefe09d0b0ddab490d7a39e2b3f3249
2021-06-08 20:01:09 +03:00
crawter
4af0037a67 multinode/console: operators controller added
Change-Id: I170371baec3c6996bd2af3c332620bd6fee3ed63
2021-06-01 19:01:14 +03:00
crawter
0b3ee4bda7 multinode/operators: domain entities and service created
Change-Id: I146229df0a279b95ce4d3ffec658509ccd6ff59a
2021-06-01 16:51:48 +03:00