[#1581] services/session: Use user.ID.EncodeToString() where possible
All checks were successful
DCO action / DCO (pull_request) Successful in 3m55s
Vulncheck / Vulncheck (pull_request) Successful in 4m17s
Tests and linters / Run gofumpt (pull_request) Successful in 4m43s
Pre-commit hooks / Pre-commit (pull_request) Successful in 5m6s
Build / Build Components (pull_request) Successful in 5m12s
Tests and linters / Staticcheck (pull_request) Successful in 5m46s
Tests and linters / gopls check (pull_request) Successful in 5m44s
Tests and linters / Tests with -race (pull_request) Successful in 6m11s
Tests and linters / Lint (pull_request) Successful in 6m25s
Tests and linters / Tests (pull_request) Successful in 6m31s

gopatch:
```
@@
var id expression
@@
-base58.Encode(id.WalletBytes())
+id.EncodeToString()
```

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2024-12-25 12:15:56 +03:00
parent 2832f44437
commit 9692e7304f
Signed by: fyrchik
SSH key fingerprint: SHA256:m/TTwCzjnRkXgnzEx9X92ccxy1CcVeinOgDb3NPWWmg
2 changed files with 2 additions and 2 deletions

View file

@ -38,7 +38,7 @@ func (s *TokenStore) Create(_ context.Context, body *session.CreateRequestBody)
s.mtx.Lock()
s.tokens[key{
tokenID: base58.Encode(uidBytes),
ownerID: base58.Encode(id.WalletBytes()),
ownerID: id.EncodeToString(),
}] = storage.NewPrivateToken(&sk.PrivateKey, body.GetExpiration())
s.mtx.Unlock()

View file

@ -41,7 +41,7 @@ func (s *TokenStore) Get(ownerID user.ID, tokenID []byte) *storage.PrivateToken
s.mtx.RLock()
t := s.tokens[key{
tokenID: base58.Encode(tokenID),
ownerID: base58.Encode(ownerID.WalletBytes()),
ownerID: ownerID.EncodeToString(),
}]
s.mtx.RUnlock()