Implement REST API #1
Loading…
Reference in New Issue
Block a user
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?
We need an HTTP APIs to interact with remote agents (for example a webapp or an app).
The design proposal is:
POST /auth
paramsusername
andpassword
To get an authentication cookie. The cookie should be bound to the
/<username>
path and have a sensible expiration time (600s?)GET /<username>/status
Should answer a serialized data structure with the relevant info encoded (json).
Should give back 403 if no or invalid auth cookie is provided by the client.
POST /<username>/checkin
POST /<username>/checkout
Should answer 200 and a json object with at least the
result
key. The possible values can besuccess
,failed
,timeout
.Should give back 403 if no or invalid auth cookie is provided by the client.
The possible implementation could be
Flask
oraiohttp
.What do you thin about FastApi?
Nice! I didn't know it. The truth is that I wanted to learn
asyncio
andaiohttp
.If you take a look at the Starlette code (that underlies FasApi) you will find something similar to what I did: