mirror of
https://github.com/nspcc-dev/neofs-rest-gw.git
synced 2026-03-01 04:29:14 +00:00
How to use this gateway to read and write files with HTTP only? #101
Labels
No labels
I2
I3
I3
I4
S2
S3
S3
S4
U0
U1
U2
U3
U3
U3
U4
blocked
bug
config
documentation
enhancement
feature
go
help wanted
question
test
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nspcc-dev/neofs-rest-gw#101
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Hecate2 on GitHub (Mar 4, 2025).
Problem
How to use this gateway to read and write files with HTTP only?
Context
requirements:
base58==2.1.1
ecdsa==0.19.0
httpx==0.28.1
pycryptodome==3.21.0
@roman-khimov commented on GitHub (Mar 4, 2025):
@mike-petrov, @cthulhu-rider
@cthulhu-rider commented on GitHub (Mar 4, 2025):
@Hecate2 pls share what error do u get and at what stage
@Hecate2 commented on GitHub (Mar 4, 2025):
I got an HTTP response code 400 at the end of
main.py. Also I just do not know what to do next.@cthulhu-rider commented on GitHub (Mar 4, 2025):
does the response contain any message? It should be present and indicate why the request is incorrectly formulated and help u in debug
@Hecate2 commented on GitHub (Mar 4, 2025):
It responds that
{'message': "invalid session token: can't unmarshal session token: invalid session UUID version 1", 'type': 'GW'}I found the message in
github.com/nspcc-dev/neofs-sdk-go@v1.0.0-rc.12/session/common.go,return fmt.Errorf("invalid session UUID version %d", ver)Is it because my signMessage process is wrong? Or am I missing any header?
And, the latest https://github.com/nspcc-dev/neofs-sdk-go/blob/master/session/common.go does not have error message about uuid
@cthulhu-rider commented on GitHub (Mar 4, 2025):
it complains about the token field that you send in the
Authorizationheader. IIUC u attach it hereunderstanding what bearer token is sent would help
as i can see, @Hecate2 u dont modify UUID field intentionally, so either the GW sends u invalid token or u should handle response in other way
@mike-petrov @smallhive
@mike-petrov commented on GitHub (Mar 13, 2025):
@Hecate2 At first we thought the problem was in the logic of your tokens, but it turns out to be simpler than that. You get this response in tokens:
The first one is for object, the second one is for container. But then you refer to the first object even though you're creating a container. So you just need to replace
auth_resp[0]withauth_resp[1].You also need to pass the body for the request with the necessary parameters, your code should look like this:
@mike-petrov commented on GitHub (Mar 13, 2025):
We have a good example of using all the functionality in one interface: https://github.com/nspcc-dev/panel-fs-neo-org, I recommend running it. It can also be used for debugging purposes to see what happens when python scripts are executed.
@roman-khimov commented on GitHub (Mar 25, 2025):
Seems to be done to me.