[#1581] services/session: Use user.ID.EncodeToString() where possible
All checks were successful
Vulncheck / Vulncheck (push) Successful in 4m25s
Tests and linters / Run gofumpt (push) Successful in 4m33s
Build / Build Components (push) Successful in 5m14s
Pre-commit hooks / Pre-commit (push) Successful in 5m23s
Tests and linters / Staticcheck (push) Successful in 5m43s
Tests and linters / gopls check (push) Successful in 5m47s
Tests and linters / Tests (push) Successful in 6m0s
Tests and linters / Tests with -race (push) Successful in 6m6s
Tests and linters / Lint (push) Successful in 6m21s

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 committed by Evgenii Stratonikov
parent ea868e09f8
commit f6c5222952
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()