Compare commits

...
Sign in to create a new pull request.

2 commits

Author SHA1 Message Date
12955be08b [#1389] cli: Make ape-manager list performed with generated wallet
Some checks failed
DCO action / DCO (pull_request) Successful in 41s
Build / Build Components (pull_request) Successful in 1m31s
Pre-commit hooks / Pre-commit (pull_request) Successful in 1m32s
Tests and linters / gopls check (pull_request) Successful in 2m25s
Tests and linters / Run gofumpt (pull_request) Successful in 3m15s
Tests and linters / Tests with -race (pull_request) Successful in 4m14s
Tests and linters / Staticcheck (pull_request) Successful in 4m16s
Tests and linters / Tests (pull_request) Successful in 4m35s
Tests and linters / Lint (pull_request) Successful in 5m1s
Vulncheck / Vulncheck (pull_request) Failing after 1m4s
Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
2025-02-07 12:34:26 +03:00
44913898ef [#1389] apemanager: Make list not validate sender key
Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
2025-02-07 12:33:58 +03:00
2 changed files with 5 additions and 9 deletions

View file

@ -23,7 +23,7 @@ var listCmd = &cobra.Command{
func list(cmd *cobra.Command, _ []string) {
target := parseTarget(cmd)
key := key.Get(cmd)
key := key.GetOrGenerate(cmd)
cli := internalclient.GetSDKClientByFlag(cmd, key, commonflags.RPC)
resp, err := cli.APEManagerListChains(cmd.Context(),

View file

@ -177,19 +177,15 @@ func (s *Service) RemoveChain(ctx context.Context, req *apemanagerV2.RemoveChain
return resp, nil
}
func (s *Service) ListChains(ctx context.Context, req *apemanagerV2.ListChainsRequest) (*apemanagerV2.ListChainsResponse, error) {
pub, err := getSignaturePublicKey(req.GetVerificationHeader())
if err != nil {
return nil, err
}
func (s *Service) ListChains(_ context.Context, req *apemanagerV2.ListChainsRequest) (*apemanagerV2.ListChainsResponse, error) {
var target policy_engine.Target
switch targetType := req.GetBody().GetTarget().GetTargetType(); targetType {
case apeV2.TargetTypeContainer:
reqCID := req.GetBody().GetTarget().GetName()
if err = s.validateContainerTargetRequest(ctx, reqCID, pub); err != nil {
return nil, err
var cidSDK cidSDK.ID
if err := cidSDK.DecodeString(reqCID); err != nil {
return nil, fmt.Errorf("invalid CID format: %w", err)
}
target = policy_engine.ContainerTarget(reqCID)
default: