[#934] containersvc: Marhal public key in short format for APE
All checks were successful
DCO action / DCO (pull_request) Successful in 3m31s
Vulncheck / Vulncheck (pull_request) Successful in 3m59s
Tests and linters / Staticcheck (pull_request) Successful in 4m48s
Build / Build Components (1.21) (pull_request) Successful in 5m21s
Build / Build Components (1.20) (pull_request) Successful in 5m24s
Tests and linters / Lint (pull_request) Successful in 6m33s
Tests and linters / Tests (1.20) (pull_request) Successful in 7m56s
Tests and linters / Tests (1.21) (pull_request) Successful in 8m18s
Tests and linters / Tests with -race (pull_request) Successful in 7m9s
All checks were successful
DCO action / DCO (pull_request) Successful in 3m31s
Vulncheck / Vulncheck (pull_request) Successful in 3m59s
Tests and linters / Staticcheck (pull_request) Successful in 4m48s
Build / Build Components (1.21) (pull_request) Successful in 5m21s
Build / Build Components (1.20) (pull_request) Successful in 5m24s
Tests and linters / Lint (pull_request) Successful in 6m33s
Tests and linters / Tests (1.20) (pull_request) Successful in 7m56s
Tests and linters / Tests (1.21) (pull_request) Successful in 8m18s
Tests and linters / Tests with -race (pull_request) Successful in 7m9s
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
befbaf9d56
commit
d7741e3aa4
2 changed files with 6 additions and 4 deletions
|
@ -6,6 +6,7 @@ import (
|
|||
"crypto/ecdsa"
|
||||
"crypto/elliptic"
|
||||
"crypto/sha256"
|
||||
"encoding/hex"
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
@ -133,7 +134,7 @@ func (ac *apeChecker) List(ctx context.Context, req *container.ListRequest) (*co
|
|||
}
|
||||
|
||||
reqProps := map[string]string{
|
||||
nativeschema.PropertyKeyActorPublicKey: pk.String(),
|
||||
nativeschema.PropertyKeyActorPublicKey: hex.EncodeToString(pk.Bytes()),
|
||||
nativeschema.PropertyKeyActorRole: role,
|
||||
}
|
||||
|
||||
|
@ -178,7 +179,7 @@ func (ac *apeChecker) Put(ctx context.Context, req *container.PutRequest) (*cont
|
|||
}
|
||||
|
||||
reqProps := map[string]string{
|
||||
nativeschema.PropertyKeyActorPublicKey: pk.String(),
|
||||
nativeschema.PropertyKeyActorPublicKey: hex.EncodeToString(pk.Bytes()),
|
||||
nativeschema.PropertyKeyActorRole: role,
|
||||
}
|
||||
|
||||
|
@ -391,7 +392,7 @@ func (ac *apeChecker) getRequestProps(mh *session.RequestMetaHeader, vh *session
|
|||
return nil, err
|
||||
}
|
||||
return map[string]string{
|
||||
nativeschema.PropertyKeyActorPublicKey: pk.String(),
|
||||
nativeschema.PropertyKeyActorPublicKey: hex.EncodeToString(pk.Bytes()),
|
||||
nativeschema.PropertyKeyActorRole: role,
|
||||
}, nil
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package container
|
|||
import (
|
||||
"context"
|
||||
"crypto/ecdsa"
|
||||
"encoding/hex"
|
||||
"errors"
|
||||
"fmt"
|
||||
"testing"
|
||||
|
@ -524,7 +525,7 @@ func testDenyListContainersForPK(t *testing.T) {
|
|||
{
|
||||
Object: chain.ObjectRequest,
|
||||
Key: nativeschema.PropertyKeyActorPublicKey,
|
||||
Value: pk.PublicKey().String(),
|
||||
Value: hex.EncodeToString(pk.PublicKey().Bytes()),
|
||||
Op: chain.CondStringEquals,
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue