container: Marhal public key in short format for APE #954

Merged
fyrchik merged 1 commit from fyrchik/frostfs-node:fix-ape-key into master 2024-02-02 17:51:41 +00:00
2 changed files with 6 additions and 4 deletions
Showing only changes of commit d7741e3aa4 - Show all commits

View file

@ -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
}

View file

@ -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,
},
},