Added ownership and app existence validation to the user app secrets routes.

This commit is contained in:
2026-10-09 12:11:42 +02:00
parent 381c229bd4
commit e68f103c29
11 changed files with 129 additions and 37 deletions
@@ -0,0 +1,91 @@
{
"db_name": "PostgreSQL",
"query": "\n INSERT INTO user_app_secrets (id, app_id, secret_hash, expires_at)\n VALUES ($1, $2, $3, $4)\n ON CONFLICT (id, app_id) DO UPDATE SET\n secret_hash = EXCLUDED.secret_hash,\n expires_at = EXCLUDED.expires_at\n RETURNING WITH (OLD AS old_row, NEW AS new_row)\n old_row.id AS \"old_id?\",\n new_row.id AS \"id!\",\n new_row.app_id AS \"app_id!\",\n new_row.secret_hash AS \"secret_hash!\",\n new_row.expires_at AS \"expires_at!\",\n new_row.created_at AS \"created_at!\"\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "old_id?",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "user_app_secrets",
"name": "id"
}
}
},
{
"ordinal": 1,
"name": "id!",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "user_app_secrets",
"name": "id"
}
}
},
{
"ordinal": 2,
"name": "app_id!",
"type_info": "Uuid",
"origin": {
"Table": {
"table": "user_app_secrets",
"name": "app_id"
}
}
},
{
"ordinal": 3,
"name": "secret_hash!",
"type_info": "Bytea",
"origin": {
"Table": {
"table": "user_app_secrets",
"name": "secret_hash"
}
}
},
{
"ordinal": 4,
"name": "expires_at!",
"type_info": "Timestamptz",
"origin": {
"Table": {
"table": "user_app_secrets",
"name": "expires_at"
}
}
},
{
"ordinal": 5,
"name": "created_at!",
"type_info": "Timestamptz",
"origin": {
"Table": {
"table": "user_app_secrets",
"name": "created_at"
}
}
}
],
"parameters": {
"Left": [
"Uuid",
"Uuid",
"Bytea",
"Timestamptz"
]
},
"nullable": [
false,
false,
false,
false,
false,
false
]
},
"hash": "594090231079a7874dbe6d8b9696c92e30ca688f496cc02c79f265f870540153"
}