Added ownership and app existence validation to the user app secrets routes.
This commit is contained in:
+2
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"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) DO UPDATE SET\n secret_hash = EXCLUDED.secret_hash,\n expires_at = EXCLUDED.expires_at\n WHERE user_app_secrets.app_id = EXCLUDED.app_id\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 ",
|
||||
"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": [
|
||||
{
|
||||
@@ -87,5 +87,5 @@
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "b01b27f9cdf2ec1c9aa28be0e760d66d01c6083166bd6a6f53784ddcdc92f12c"
|
||||
"hash": "594090231079a7874dbe6d8b9696c92e30ca688f496cc02c79f265f870540153"
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "SELECT user_id FROM user_apps WHERE id = $1 FOR SHARE",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"ordinal": 0,
|
||||
"name": "user_id",
|
||||
"type_info": "Uuid",
|
||||
"origin": {
|
||||
"Table": {
|
||||
"table": "user_apps",
|
||||
"name": "user_id"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Uuid"
|
||||
]
|
||||
},
|
||||
"nullable": [
|
||||
false
|
||||
]
|
||||
},
|
||||
"hash": "f9a9d0e201e0f1c912d940fb6d0e4c27664bf4a0dbc2e71b2ade48df2e8dcd6e"
|
||||
}
|
||||
Reference in New Issue
Block a user