* set editor config and geany project configuration * closes https://codeberg.org/minenux/minenux-skindb-webdb/issues/2 * closes https://codeberg.org/minetest-stuffs/minetest-skindb-skindata/issues/1
4.0 KiB
4.0 KiB
skindb-webdb API reference
Is based on now defunct skin database (http://minetest.fensta.bplaced.net), that will be now at https://skindb.sourceforge.io/
This documents the proposals, may change or not to be made
login
This case is still in proposal, cos we are thinking to use git only
pre conditions
- 1 send POST parameters
username
: REQUIRED : github/codeberg/gitlab it dependsuserpass
: REQUIRED : contraseña entre 6 y 20 caracteres alfanumericosuserkey
: REQUIRED : palabra de 60 caracteres alfanumerica
workflow
- 2 check DB api parameters, the database is sqlite
good workflow
- 3 response sucess
- mensaje json user data
- id : internal id of the user
- name : human name if any
- username : must match the POST username
- userkey : must match the POST userkey, this is the api key
- type : 0 or 1, 1 is admin user
- apikey : same as userkey
- mensaje json user data
{
"sucess": true,
"message": "auth success"
"data": [
{
"id": Int,
"name": "String",
"username": "String",
"userkey": "String",
"type": Int,
"apikey": "String"
}
]
}
- NOTE only one ip can be at the same time per session per user, to avoid conflicts in git filesystem
failed workflow
- 2 response fails
- mensaje json de datos incorrectos session invalida
{
"sucess": false,
"message": "auth fail"
"data": [
{
".. invalid api key"
}
]
}
load skin
This case is still in proposal, cos we are thinking to use git only
Pre conditions
- #4 login
- only one ip can be at the same time per session per user, to avoid conflicts on git filesystem
- 1 send POST parameters with data
name
: REQUIRED : String : skin name, of the skin player, 12 chars maximunauthor
: REQUIRED : String : auto filled withusername
session, 12 chars maximundescription
: OPTIONAL : String : long details of the skin made, 64 chars maximuncomment
: OPTIONAL : String : short details of the skin made, 32 chars maximunlicense
: REQUEIRED : String : SPDX licence identifier as https://spdx.org/licenses/skin
: REQUIRED : Base64 : png fileapikey
: REQUIRED : string - alphanumeric 64 chars key for apiusername
: REQUIRED : user session if login
workflow
- 2 check and validations, then
- create the metadata file as player skin format
- decode base64 png file and dump into temp filesystem
good workflow
- 3 create id skin and store into git
- create new id format YYYYMMDDHHmmss
- save the metadata file into filesystem git submodule as in data files
- save the png dump file into filesystem git submodule as in data files
- save the metadata into sqlite database for cache search as in data files
- schedule commit to the git filesystem
- 4 Response
{
"sucess": true,
"message": "skin stored",
"page": 1,
"pages": 1,
"per_page": 10,
"skins": [
{
"id": Int,
"name": "String",
"author": "String",
"license": "String",
"type": "String",
"img": "String",
"comment": "String"
}
]
}
failed workflow
- 3 failed response
{
"sucess": false,
"message": "skin error data",
"page": 1,
"pages": 1,
"per_page": 10,
"skins": [
{
"id": Int,
"name": "String",
"author": "String",
"license": "String",
"type": "String",
"img": "String",
"comment": "String"
}
]
}