add request signatures and GET/POST requests

This commit is contained in:
sam 2024-01-17 15:51:16 +01:00
parent 0e71e9dc5f
commit 7a694623e5
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
24 changed files with 690 additions and 30 deletions

View file

@ -0,0 +1,32 @@
{
"db_name": "PostgreSQL",
"query": "SELECT * FROM instance WHERE id = 1",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Int4"
},
{
"ordinal": 1,
"name": "public_key",
"type_info": "Text"
},
{
"ordinal": 2,
"name": "private_key",
"type_info": "Text"
}
],
"parameters": {
"Left": []
},
"nullable": [
false,
false,
false
]
},
"hash": "29b5c01c2511f63be1ae213d8b1999becab8ab1c5f6da712db7f759f30f2bca8"
}

View file

@ -0,0 +1,62 @@
{
"db_name": "PostgreSQL",
"query": "select\n a.id, a.username, a.email, a.password, a.role as \"role: Role\", a.avatar\n from accounts a\n join tokens t on t.account_id = a.id\n where t.account_id = $1",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Text"
},
{
"ordinal": 1,
"name": "username",
"type_info": "Text"
},
{
"ordinal": 2,
"name": "email",
"type_info": "Text"
},
{
"ordinal": 3,
"name": "password",
"type_info": "Text"
},
{
"ordinal": 4,
"name": "role: Role",
"type_info": {
"Custom": {
"name": "account_role",
"kind": {
"Enum": [
"user",
"admin"
]
}
}
}
},
{
"ordinal": 5,
"name": "avatar",
"type_info": "Text"
}
],
"parameters": {
"Left": [
"Text"
]
},
"nullable": [
false,
false,
false,
false,
false,
true
]
},
"hash": "3402be9906900efd5c0e9f7ec10e9303a3068b728142dc90bb66389069608e28"
}

View file

@ -0,0 +1,31 @@
{
"db_name": "PostgreSQL",
"query": "insert into accounts (id, username, email, password) values ($1, $2, $3, $4) returning id, username",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Text"
},
{
"ordinal": 1,
"name": "username",
"type_info": "Text"
}
],
"parameters": {
"Left": [
"Text",
"Text",
"Text",
"Text"
]
},
"nullable": [
false,
false
]
},
"hash": "665e75d8304aab441acb50e78793092e5c603089672bceff3a4fa17dd624d933"
}

View file

@ -0,0 +1,62 @@
{
"db_name": "PostgreSQL",
"query": "select\n id, username, email, password, role as \"role: Role\", avatar\n from accounts where username = $1",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Text"
},
{
"ordinal": 1,
"name": "username",
"type_info": "Text"
},
{
"ordinal": 2,
"name": "email",
"type_info": "Text"
},
{
"ordinal": 3,
"name": "password",
"type_info": "Text"
},
{
"ordinal": 4,
"name": "role: Role",
"type_info": {
"Custom": {
"name": "account_role",
"kind": {
"Enum": [
"user",
"admin"
]
}
}
}
},
{
"ordinal": 5,
"name": "avatar",
"type_info": "Text"
}
],
"parameters": {
"Left": [
"Text"
]
},
"nullable": [
false,
false,
false,
false,
false,
true
]
},
"hash": "acb98db00095d510a139a8a4fd61edcd04e1570c96869993b6b20d16ad71da3c"
}

View file

@ -0,0 +1,20 @@
{
"db_name": "PostgreSQL",
"query": "select exists(select * from instance)",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "exists",
"type_info": "Bool"
}
],
"parameters": {
"Left": []
},
"nullable": [
null
]
},
"hash": "ad1116f3443ba2c3093c6c7605508d7c7ce717e42f970ea30fd7e828c8c9ef06"
}

View file

@ -0,0 +1,65 @@
{
"db_name": "PostgreSQL",
"query": "insert into chat_instances\n (id, domain, base_url, public_key) values ($1, $2, $3, $4)\n returning id, domain, base_url, public_key,\n status as \"status: InstanceStatus\", reason",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Text"
},
{
"ordinal": 1,
"name": "domain",
"type_info": "Text"
},
{
"ordinal": 2,
"name": "base_url",
"type_info": "Text"
},
{
"ordinal": 3,
"name": "public_key",
"type_info": "Text"
},
{
"ordinal": 4,
"name": "status: InstanceStatus",
"type_info": {
"Custom": {
"name": "instance_status",
"kind": {
"Enum": [
"active",
"suspended"
]
}
}
}
},
{
"ordinal": 5,
"name": "reason",
"type_info": "Text"
}
],
"parameters": {
"Left": [
"Text",
"Text",
"Text",
"Text"
]
},
"nullable": [
false,
false,
false,
false,
false,
true
]
},
"hash": "bdf6cfaad2176b76f5092898e796580047c45469fc9a867a4cc93a49343a5333"
}

View file

@ -0,0 +1,15 @@
{
"db_name": "PostgreSQL",
"query": "insert into tokens (token, account_id) values ($1, $2)",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Text",
"Text"
]
},
"nullable": []
},
"hash": "d125d3c97a59ac5c4ba04eb02d9a8a35d5dc84b0860ba22a8c105d457cb8b4e6"
}

View file

@ -0,0 +1,62 @@
{
"db_name": "PostgreSQL",
"query": "select id, domain, base_url, public_key,\n status as \"status: InstanceStatus\", reason\n from chat_instances where domain = $1",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Text"
},
{
"ordinal": 1,
"name": "domain",
"type_info": "Text"
},
{
"ordinal": 2,
"name": "base_url",
"type_info": "Text"
},
{
"ordinal": 3,
"name": "public_key",
"type_info": "Text"
},
{
"ordinal": 4,
"name": "status: InstanceStatus",
"type_info": {
"Custom": {
"name": "instance_status",
"kind": {
"Enum": [
"active",
"suspended"
]
}
}
}
},
{
"ordinal": 5,
"name": "reason",
"type_info": "Text"
}
],
"parameters": {
"Left": [
"Text"
]
},
"nullable": [
false,
false,
false,
false,
false,
true
]
},
"hash": "dab570575b63e52a4bee944f139121074794c172310c88bdcdd8bef083df9431"
}

View file

@ -0,0 +1,15 @@
{
"db_name": "PostgreSQL",
"query": "insert into instance (public_key, private_key) values ($1, $2)",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Text",
"Text"
]
},
"nullable": []
},
"hash": "e8680ec00d42254b8fc8240636d8e91cbd34ef31391418828f4a0bb4e9e2a4ce"
}