[#1152] go.mod: Update api-go and sdk versions
All checks were successful
DCO action / DCO (pull_request) Successful in 5m23s
Build / Build Components (1.22) (pull_request) Successful in 7m33s
Build / Build Components (1.21) (pull_request) Successful in 7m43s
Tests and linters / Lint (pull_request) Successful in 8m51s
Tests and linters / Tests (1.22) (pull_request) Successful in 14m33s
Pre-commit hooks / Pre-commit (pull_request) Successful in 15m48s
Vulncheck / Vulncheck (pull_request) Successful in 15m12s
Tests and linters / Tests (1.21) (pull_request) Successful in 16m38s
Tests and linters / gopls check (pull_request) Successful in 19m24s
Tests and linters / Staticcheck (pull_request) Successful in 21m29s
Tests and linters / Tests with -race (pull_request) Successful in 23m16s
All checks were successful
DCO action / DCO (pull_request) Successful in 5m23s
Build / Build Components (1.22) (pull_request) Successful in 7m33s
Build / Build Components (1.21) (pull_request) Successful in 7m43s
Tests and linters / Lint (pull_request) Successful in 8m51s
Tests and linters / Tests (1.22) (pull_request) Successful in 14m33s
Pre-commit hooks / Pre-commit (pull_request) Successful in 15m48s
Vulncheck / Vulncheck (pull_request) Successful in 15m12s
Tests and linters / Tests (1.21) (pull_request) Successful in 16m38s
Tests and linters / gopls check (pull_request) Successful in 19m24s
Tests and linters / Staticcheck (pull_request) Successful in 21m29s
Tests and linters / Tests with -race (pull_request) Successful in 23m16s
* 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
92e19feb57
commit
0b367007fc
4 changed files with 32 additions and 31 deletions
|
@ -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"
|
||||
|
@ -83,13 +84,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
|
||||
}
|
||||
|
@ -105,7 +106,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
|
||||
|
@ -119,16 +120,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
|
||||
|
@ -137,7 +138,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
|
||||
|
@ -151,15 +152,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
|
||||
|
@ -168,7 +169,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
|
||||
|
@ -183,21 +184,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…
Add table
Add a link
Reference in a new issue