You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
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?
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!
Trying to delete an object for a container while using an intermediary key and signing 'out of band'
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?
The text was updated successfully, but these errors were encountered: