Cristian Caloian
01/30/2023, 2:08 PMcreation_date
and status 201
). I am using same id and policy statement. This happens both when using the lakectl
api 0.55.0
, the Golang api v0.89.0
, and curl
. I expected to get a 409
status code, as described in the API. Is this intended behaviour? Thanks!Elad Lachmi
01/30/2023, 2:14 PMcurl
, I get an HTTP status 409 with an "Already exists" message in the body, which would be the expected behavior
$ curl -v '<http://127.0.0.1:8000/api/v1/auth/policies>' \
-H 'Cookie: XXXX' \
-H 'accept: application/json' \
-H 'content-type: application/json' \
--data-raw '{"statement":[{"action":["fs:List*","fs:Read*"],"effect":"allow","resource":"*"}],"id":"test"}' \
--compressed
* Trying 127.0.0.1:8000...
* Connected to 127.0.0.1 (127.0.0.1) port 8000 (#0)
> POST /api/v1/auth/policies HTTP/1.1
> Host: 127.0.0.1:8000
> User-Agent: curl/7.79.1
> Accept-Encoding: deflate, gzip
> Cookie: XXXX
> accept: application/json
> content-type: application/json
> Content-Length: 94
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 409 Conflict
< Content-Type: application/json
< X-Content-Type-Options: nosniff
< X-Request-Id: f38f22b0-d6d8-4905-8d66-a33ecc4ba136
< Date: Mon, 30 Jan 2023 16:44:20 GMT
< Content-Length: 29
<
{"message":"Already exists"}
0.89.0
was released recently
I'd suspect maybe the version of lakectl
doesn't support the separation between endpoints for create/update, but if you're seeing the same behavior with using curl
directly, that probably rules that outcurl
command you tried so I can further investigate?Cristian Caloian
01/31/2023, 2:41 PMcurl
command as you pasted above. Do you think I get this behaviour because our version of LakeFS is 0.61.0
?Elad Lachmi
01/31/2023, 2:44 PM0.61.0
?
For some reason I thought you wrote you were on version 0.89.0
Let me check when that was released vs. when the fix commit was done
One momentCristian Caloian
01/31/2023, 2:45 PM0.89.0
. It is my bad, I should’ve make it clear. The deployed LakeFS server is 0.61.0
.Elad Lachmi
01/31/2023, 2:46 PM0.61.0
was released before this fix0.83.3
Cristian Caloian
01/31/2023, 2:48 PMapi
and auth
. But api
contains all the functionality for /auth
endpoints. Is it okay to use only code from api
?Elad Lachmi
01/31/2023, 2:52 PMapi
is the way to go, but I'm not in all of the details of this area of the code base, so let me check that for you
I'll reach out to a colleague, so it may take a few minutes
I'll let you know as soon as I have an updateCristian Caloian
01/31/2023, 2:58 PMElad Lachmi
01/31/2023, 3:08 PMauth
spec is for use with an external API
It only defines the contract and leaves to the API all of the implementation details - would be very hard to implement an API that will provide the built-in functionality
The mirrored endpoints in the lakeFS spec are what's implemented inside of lakeFS, so that would probably be the way to goCristian Caloian
01/31/2023, 6:17 PMElad Lachmi
01/31/2023, 6:28 PM