Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Error loading a file into the container created by the account wallet-rest.json #282

Open
tatiana-nspcc opened this issue Nov 22, 2023 · 0 comments
Labels
bug Something isn't working I4 No visible changes S4 Routine U4 Nothing urgent

Comments

@tatiana-nspcc
Copy link

I can't upload the file to the container that was created by the wallet-rest.json account and is available for uploading.

Expected Behavior

Successful file upload.

Current Behavior

status: code = 2048 message = access to object operation denied

Possible Solution

I don't know.

Steps to Reproduce (for bugs)

I'm trying to follow the instructions from https://github.com/nspcc-dev/neofs-http-gw/blob/0b22557622db8551bfbfc8d0ff0fde51fbdea9c3/README.md#example

  1. I have a container that was created as follows:
neofs-cli -r localhost:8080 -w ./config/wallet-rest.json  --basic-acl 0x0FFFCFFF container create --policy "REP 1"  --await

CID 5p6BUHVQThKhGoQWVyjKNjXEoMEMvr6Q3degGRACj45Y
Address from wallet-rest.json:
"address": "NPFCqWHfi9ixCJRu7DABRbVfXRbkSEr9Vo",
2. Then I encoded the CID and address:

echo '5p6BUHVQThKhGoQWVyjKNjXEoMEMvr6Q3degGRACj45Y' | base58 --decode | base64
R37nQztU279LICrFus4C1bPfVW9vf7NzXViBTQ3X8dM=

echo 'NPFCqWHfi9ixCJRu7DABRbVfXRbkSEr9Vo' | base58 --decode | base64
NSSLrQB6gIku+V7oMAHXinR47Juhw3qlfg==
  1. I composed the next bearer.json:
{
    "body": {
        "eaclTable": {
            "version": {
                "major": 0,
                "minor": 0
            },
            "containerID": {
                "value": "R37nQztU279LICrFus4C1bPfVW9vf7NzXViBTQ3X8dM="
            },
            "records": []
        },
        "ownerID": {
            "value": "NSSLrQB6gIku+V7oMAHXinR47Juhw3qlfg=="
        },
        "lifetime": {
            "exp": "10000",
            "nbf": "0",
            "iat": "0"
        }
    },
    "signature": null
}
  1. Signed and encoded:
aio:/# neofs-cli util sign bearer-token --from bearer.json --to signed.json -w ./config/wallet-rest.json
Enter password > 
signed bearer token was successfully dumped to signed.json
aio:/# base64 -w 0 signed.json
CkoKJgoAEiIKIEd+50M7VNu/SyAqxbrOAtWz31Vvb3+zc11YgU0N1/HTEhsKGTUki60AeoCJLvle6DAB14p0eOybocN6pX4aAwiQThJnCiECcuPzZCZ2VyDsm2jKEOMnU6xEWO2bF1dvOvBWTDFYB1YSQCuodbGajPo++quC00TPGxfV8V98R4FdXEwjnds8UeFvcFaJymM29u0SgTToJKfcVexPwH27VnIZrlU9uLJgM14YAQ==
  1. And when I try to upload the file, it says:
 curl -F 'file=@test.txt;filename=test.txt' -H "Authorization: Bearer CkoKJgoAEiIKIEd+50M7VNu/SyAqxbrOAtWz31Vvb3+zc11YgU0N1/HTEhsKGTUki60AeoCJLvle6DAB14p0eOybocN6pX4aAwiQThJnCiECcuPzZCZ2VyDsm2jKEOMnU6xEWO2bF1dvOvBWTDFYB1YSQCuodbGajPo++quC00TPGxfV8V98R4FdXEwjnds8UeFvcFaJymM29u0SgTToJKfcVexPwH27VnIZrlU9uLJgM14YAQ==" http://localhost:8082/upload/5p6BUHVQThKhGoQWVyjKNjXEoMEMvr6Q3degGRACj45Y
write: status: code = 2048 message = access to object operation denied

Please, note, that accounts of the gate and the container owner are matching (the same one).

Context

I'm just trying to reproduce readme instruction but something goes wrong.

Regression

Your Environment

  • Version used:
  • Server setup and configuration:
  • Operating System and version (uname -a):
    I'm using AIO-container c659a6c1a86a273d3b836ce204c2ebc70f9f5b2a upgraded to 0.38.1
@roman-khimov roman-khimov added bug Something isn't working U4 Nothing urgent S4 Routine I4 No visible changes and removed triage labels Dec 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working I4 No visible changes S4 Routine U4 Nothing urgent
Projects
None yet
Development

No branches or pull requests

2 participants