[#XX] go.mod: Update api-go and sdk versions
* Resolve conflicts for apemanager since api-go contains ape and apemanager packages and SDK only ape package. Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
This commit is contained in:
parent
3627b44e92
commit
b319714371
4 changed files with 32 additions and 26 deletions
|
@ -9,7 +9,7 @@ import (
|
|||
"git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-cli/internal/key"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-cli/modules/util"
|
||||
commonCmd "git.frostfs.info/TrueCloudLab/frostfs-node/cmd/internal/common"
|
||||
apemanager_sdk "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/apemanager"
|
||||
apeSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/ape"
|
||||
client_sdk "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client"
|
||||
cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id"
|
||||
apechain "git.frostfs.info/TrueCloudLab/policy-engine/pkg/chain"
|
||||
|
@ -51,7 +51,7 @@ var addCmd = &cobra.Command{
|
|||
},
|
||||
}
|
||||
|
||||
func parseTarget(cmd *cobra.Command) (ct apemanager_sdk.ChainTarget) {
|
||||
func parseTarget(cmd *cobra.Command) (ct apeSDK.ChainTarget) {
|
||||
typ, _ := cmd.Flags().GetString(targetTypeFlag)
|
||||
name, _ := cmd.Flags().GetString(targetNameFlag)
|
||||
|
||||
|
@ -59,22 +59,22 @@ func parseTarget(cmd *cobra.Command) (ct apemanager_sdk.ChainTarget) {
|
|||
|
||||
switch typ {
|
||||
case namespaceTarget:
|
||||
ct.TargetType = apemanager_sdk.TargetTypeNamespace
|
||||
ct.TargetType = apeSDK.TargetTypeNamespace
|
||||
case containerTarget:
|
||||
var cnr cid.ID
|
||||
commonCmd.ExitOnErr(cmd, "can't decode container ID: %w", cnr.DecodeString(name))
|
||||
ct.TargetType = apemanager_sdk.TargetTypeContainer
|
||||
ct.TargetType = apeSDK.TargetTypeContainer
|
||||
case userTarget:
|
||||
ct.TargetType = apemanager_sdk.TargetTypeUser
|
||||
ct.TargetType = apeSDK.TargetTypeUser
|
||||
case groupTarget:
|
||||
ct.TargetType = apemanager_sdk.TargetTypeGroup
|
||||
ct.TargetType = apeSDK.TargetTypeGroup
|
||||
default:
|
||||
commonCmd.ExitOnErr(cmd, "read target type error: %w", errUnknownTargetType)
|
||||
}
|
||||
return ct
|
||||
}
|
||||
|
||||
func parseChain(cmd *cobra.Command) apemanager_sdk.Chain {
|
||||
func parseChain(cmd *cobra.Command) apeSDK.Chain {
|
||||
chainID, _ := cmd.Flags().GetString(chainIDFlag)
|
||||
hexEncoded, _ := cmd.Flags().GetBool(chainIDHexFlag)
|
||||
|
||||
|
@ -101,7 +101,7 @@ func parseChain(cmd *cobra.Command) apemanager_sdk.Chain {
|
|||
util.PrintHumanReadableAPEChain(cmd, chain)
|
||||
|
||||
serialized := chain.Bytes()
|
||||
return apemanager_sdk.Chain{
|
||||
return apeSDK.Chain{
|
||||
Raw: serialized,
|
||||
}
|
||||
}
|
||||
|
|
7
go.mod
7
go.mod
|
@ -2,12 +2,17 @@ module git.frostfs.info/TrueCloudLab/frostfs-node
|
|||
|
||||
go 1.21
|
||||
|
||||
replace (
|
||||
git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240516133103-0803bc6ded00 => git.frostfs.info/aarifullin/frostfs-api-go/v2 v2.15.1-0.20240529131858-20283620283f
|
||||
git.frostfs.info/TrueCloudLab/frostfs-sdk-go v0.0.0-20240520111414-c5c6272029fe => git.frostfs.info/aarifullin/frostfs-sdk-go v0.0.0-20240529154247-a1656defb048
|
||||
)
|
||||
|
||||
require (
|
||||
code.gitea.io/sdk/gitea v0.17.1
|
||||
git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240516133103-0803bc6ded00
|
||||
git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3-0.20240409111539-e7a05a49ff45
|
||||
git.frostfs.info/TrueCloudLab/frostfs-observability v0.0.0-20231101111734-b3ad3335ff65
|
||||
git.frostfs.info/TrueCloudLab/frostfs-sdk-go v0.0.0-20240517121628-3de256d05e32
|
||||
git.frostfs.info/TrueCloudLab/frostfs-sdk-go v0.0.0-20240520111414-c5c6272029fe
|
||||
git.frostfs.info/TrueCloudLab/hrw v1.2.1
|
||||
git.frostfs.info/TrueCloudLab/policy-engine v0.0.0-20240513163744-1f6f4163d40d
|
||||
git.frostfs.info/TrueCloudLab/tzhash v1.8.0
|
||||
|
|
BIN
go.sum
BIN
go.sum
Binary file not shown.
|
@ -8,7 +8,8 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
|
||||
apemanager_v2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager"
|
||||
apeV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/ape"
|
||||
apemanagerV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs"
|
||||
session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session"
|
||||
ape_contract "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/ape/contract_storage"
|
||||
|
@ -85,13 +86,13 @@ func (s *Service) validateContainerTargetRequest(cid string, pubKey *keys.Public
|
|||
return nil
|
||||
}
|
||||
|
||||
func (s *Service) AddChain(_ context.Context, req *apemanager_v2.AddChainRequest) (*apemanager_v2.AddChainResponse, error) {
|
||||
func (s *Service) AddChain(_ context.Context, req *apemanagerV2.AddChainRequest) (*apemanagerV2.AddChainResponse, error) {
|
||||
pub, err := getSignaturePublicKey(req.GetVerificationHeader())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
chain, err := decodeAndValidateChain(req.GetBody().GetChain().GetKind().(*apemanager_v2.ChainRaw).GetRaw())
|
||||
chain, err := decodeAndValidateChain(req.GetBody().GetChain().GetKind().(*apeV2.ChainRaw).GetRaw())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -107,7 +108,7 @@ func (s *Service) AddChain(_ context.Context, req *apemanager_v2.AddChainRequest
|
|||
var target policy_engine.Target
|
||||
|
||||
switch targetType := req.GetBody().GetTarget().GetTargetType(); targetType {
|
||||
case apemanager_v2.TargetTypeContainer:
|
||||
case apeV2.TargetTypeContainer:
|
||||
reqCID := req.GetBody().GetTarget().GetName()
|
||||
if err = s.validateContainerTargetRequest(reqCID, pub); err != nil {
|
||||
return nil, err
|
||||
|
@ -121,16 +122,16 @@ func (s *Service) AddChain(_ context.Context, req *apemanager_v2.AddChainRequest
|
|||
return nil, err
|
||||
}
|
||||
|
||||
body := new(apemanager_v2.AddChainResponseBody)
|
||||
body := new(apemanagerV2.AddChainResponseBody)
|
||||
body.SetChainID(chain.ID)
|
||||
|
||||
resp := new(apemanager_v2.AddChainResponse)
|
||||
resp := new(apemanagerV2.AddChainResponse)
|
||||
resp.SetBody(body)
|
||||
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
func (s *Service) RemoveChain(_ context.Context, req *apemanager_v2.RemoveChainRequest) (*apemanager_v2.RemoveChainResponse, error) {
|
||||
func (s *Service) RemoveChain(_ context.Context, req *apemanagerV2.RemoveChainRequest) (*apemanagerV2.RemoveChainResponse, error) {
|
||||
pub, err := getSignaturePublicKey(req.GetVerificationHeader())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -139,7 +140,7 @@ func (s *Service) RemoveChain(_ context.Context, req *apemanager_v2.RemoveChainR
|
|||
var target policy_engine.Target
|
||||
|
||||
switch targetType := req.GetBody().GetTarget().GetTargetType(); targetType {
|
||||
case apemanager_v2.TargetTypeContainer:
|
||||
case apeV2.TargetTypeContainer:
|
||||
reqCID := req.GetBody().GetTarget().GetName()
|
||||
if err = s.validateContainerTargetRequest(reqCID, pub); err != nil {
|
||||
return nil, err
|
||||
|
@ -153,15 +154,15 @@ func (s *Service) RemoveChain(_ context.Context, req *apemanager_v2.RemoveChainR
|
|||
return nil, err
|
||||
}
|
||||
|
||||
body := new(apemanager_v2.RemoveChainResponseBody)
|
||||
body := new(apemanagerV2.RemoveChainResponseBody)
|
||||
|
||||
resp := new(apemanager_v2.RemoveChainResponse)
|
||||
resp := new(apemanagerV2.RemoveChainResponse)
|
||||
resp.SetBody(body)
|
||||
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
func (s *Service) ListChains(_ context.Context, req *apemanager_v2.ListChainsRequest) (*apemanager_v2.ListChainsResponse, error) {
|
||||
func (s *Service) ListChains(_ context.Context, req *apemanagerV2.ListChainsRequest) (*apemanagerV2.ListChainsResponse, error) {
|
||||
pub, err := getSignaturePublicKey(req.GetVerificationHeader())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -170,7 +171,7 @@ func (s *Service) ListChains(_ context.Context, req *apemanager_v2.ListChainsReq
|
|||
var target policy_engine.Target
|
||||
|
||||
switch targetType := req.GetBody().GetTarget().GetTargetType(); targetType {
|
||||
case apemanager_v2.TargetTypeContainer:
|
||||
case apeV2.TargetTypeContainer:
|
||||
reqCID := req.GetBody().GetTarget().GetName()
|
||||
if err = s.validateContainerTargetRequest(reqCID, pub); err != nil {
|
||||
return nil, err
|
||||
|
@ -185,21 +186,21 @@ func (s *Service) ListChains(_ context.Context, req *apemanager_v2.ListChainsReq
|
|||
return nil, err
|
||||
}
|
||||
|
||||
res := make([]*apemanager_v2.Chain, 0, len(chs))
|
||||
res := make([]*apeV2.Chain, 0, len(chs))
|
||||
for _, ch := range chs {
|
||||
v2chraw := new(apemanager_v2.ChainRaw)
|
||||
v2chraw := new(apeV2.ChainRaw)
|
||||
v2chraw.SetRaw(ch.Bytes())
|
||||
|
||||
v2ch := new(apemanager_v2.Chain)
|
||||
v2ch := new(apeV2.Chain)
|
||||
v2ch.SetKind(v2chraw)
|
||||
|
||||
res = append(res, v2ch)
|
||||
}
|
||||
|
||||
body := new(apemanager_v2.ListChainsResponseBody)
|
||||
body := new(apemanagerV2.ListChainsResponseBody)
|
||||
body.SetChains(res)
|
||||
|
||||
resp := new(apemanager_v2.ListChainsResponse)
|
||||
resp := new(apemanagerV2.ListChainsResponse)
|
||||
resp.SetBody(body)
|
||||
|
||||
return resp, nil
|
||||
|
|
Loading…
Reference in a new issue