Issue deleting object with Wallet Connect as the signature generator #207

Open
opened 2025-12-28 18:07:25 +00:00 by sami · 4 comments
Owner

Originally created by @amlwwalker on GitHub (Nov 6, 2023).

Trying to delete an object for a container while using an intermediary key and signing 'out of band'

    pl, err := m.Pool(false)
    if err != nil {
        log.Println("error retrieving pool ", err)
        return nil, err
    }
    cliSdk, err := pl.RawClient()
    if err != nil {
        log.Println("delete could not get client")
        return nil, err
    }
    gateSigner := user.NewAutoIDSignerRFC6979(m.gateAccount.PrivateKey().PrivateKey)
    netInfo, err := cliSdk.NetworkInfo(context.Background(), client.PrmNetworkInfo{})
    if err != nil {
        return nil, fmt.Errorf("read current network info: %w", err)
    }

    var sessionToken session.Object
    sessionToken.SetAuthKey(gateSigner.Public()) 
    sessionToken.SetID(uuid.New())
    sessionToken.SetIat(netInfo.CurrentEpoch())
    sessionToken.SetNbf(netInfo.CurrentEpoch())
    sessionToken.SetExp(netInfo.CurrentEpoch() + 100) // or particular exp value
    sessionToken.BindContainer(cnrID)
    sessionToken.ForVerb(session.VerbObjectDelete)
    if err := m.TemporarySignObjectTokenWithPrivateKey(&sessionToken); err != nil {
        log.Println("error signing session token to create a object", err)
        return nil, err
    }

    var prmDelete client.PrmObjectDelete
    prmDelete.WithinSession(sessionToken)
    if _, err := pl.ObjectDelete(m.ctx, cnrID, objID, gateSigner, prmDelete); err != nil {
        ...
    }

gives me the error

Object xxxx could not be deleted: status: code = 4096 message = session token not found and could not be deleted: status: code = 4096 message = session token not found map[]

I have this working for creating/listing/downloading objects but for some reason can't get working for deleting. Any obvious mistake I've made here?

Originally created by @amlwwalker on GitHub (Nov 6, 2023). Trying to delete an object for a container while using an intermediary key and signing 'out of band' ``` pl, err := m.Pool(false) if err != nil { log.Println("error retrieving pool ", err) return nil, err } cliSdk, err := pl.RawClient() if err != nil { log.Println("delete could not get client") return nil, err } gateSigner := user.NewAutoIDSignerRFC6979(m.gateAccount.PrivateKey().PrivateKey) netInfo, err := cliSdk.NetworkInfo(context.Background(), client.PrmNetworkInfo{}) if err != nil { return nil, fmt.Errorf("read current network info: %w", err) } var sessionToken session.Object sessionToken.SetAuthKey(gateSigner.Public()) sessionToken.SetID(uuid.New()) sessionToken.SetIat(netInfo.CurrentEpoch()) sessionToken.SetNbf(netInfo.CurrentEpoch()) sessionToken.SetExp(netInfo.CurrentEpoch() + 100) // or particular exp value sessionToken.BindContainer(cnrID) sessionToken.ForVerb(session.VerbObjectDelete) if err := m.TemporarySignObjectTokenWithPrivateKey(&sessionToken); err != nil { log.Println("error signing session token to create a object", err) return nil, err } var prmDelete client.PrmObjectDelete prmDelete.WithinSession(sessionToken) if _, err := pl.ObjectDelete(m.ctx, cnrID, objID, gateSigner, prmDelete); err != nil { ... } ``` gives me the error `Object xxxx could not be deleted: status: code = 4096 message = session token not found and could not be deleted: status: code = 4096 message = session token not found map[]` I have this working for creating/listing/downloading objects but for some reason can't get working for deleting. Any obvious mistake I've made here?
Author
Owner

@amlwwalker commented on GitHub (Dec 7, 2023):

Any progress here by any chance?

@amlwwalker commented on GitHub (Dec 7, 2023): Any progress here by any chance?
Author
Owner

@roman-khimov commented on GitHub (Dec 7, 2023):

@carpawell, could it be related to https://github.com/nspcc-dev/neofs-node/issues/2261?

@roman-khimov commented on GitHub (Dec 7, 2023): @carpawell, could it be related to https://github.com/nspcc-dev/neofs-node/issues/2261?
Author
Owner

@carpawell commented on GitHub (Dec 13, 2023):

Hi @amlwwalker, sorry for the huge delay. Can you, please, provide the version you used?

Also, can you, please, provide the exact error message you got? Is Object xxxx could not be deleted from the SDK? session token not found map[] too (especially map[])?

Could you briefly describe what are you trying to do? What does TemporarySignObjectTokenWithPrivateKey do? Could you, please, provide the ACL settings of the container you used (container itself and an eACL policy if set)?

I have this working for creating

The code succeed looks almost the same but ObjectPutInit instead of Delete? What payload size did you use?

@carpawell commented on GitHub (Dec 13, 2023): Hi @amlwwalker, sorry for the huge delay. Can you, please, provide the version you used? Also, can you, please, provide the exact error message you got? Is `Object xxxx could not be deleted` from the SDK? `session token not found map[]` too (especially `map[]`)? Could you briefly describe what are you trying to do? What does `TemporarySignObjectTokenWithPrivateKey` do? Could you, please, provide the ACL settings of the container you used (container itself and an eACL policy if set)? > I have this working for creating The code succeed looks almost the same but `ObjectPutInit` instead of `Delete`? What payload size did you use?
Author
Owner

@amlwwalker commented on GitHub (Jan 19, 2024):

Hi @carpawell - Apologies, I've been working on the Wallet Connect stuff and haven't looked back at this bug. Once my app is rebuilt I'll get you these answers!

@amlwwalker commented on GitHub (Jan 19, 2024): Hi @carpawell - Apologies, I've been working on the Wallet Connect stuff and haven't looked back at this bug. Once my app is rebuilt I'll get you these answers!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nspcc-dev/neofs-sdk-go#207
No description provided.