@@ -27,7 +27,13 @@ app.post('/', middlewareKey(['all', 'write']), async (c) => {
2727 const apikey = c . get ( 'apikey' ) as Database [ 'public' ] [ 'Tables' ] [ 'apikeys' ] [ 'Row' ]
2828
2929 cloudlog ( { requestId : c . get ( 'requestId' ) , message : 'body' , body } )
30- cloudlog ( { requestId : c . get ( 'requestId' ) , message : 'apikey' , apikey } )
30+ cloudlog ( {
31+ requestId : c . get ( 'requestId' ) ,
32+ message : 'apikey context' ,
33+ apikeyId : apikey . id ,
34+ userId : apikey . user_id ,
35+ mode : apikey . mode ,
36+ } )
3137
3238 // Rate limit: max 1 set per second per device+app, and same channel set max once per 60 seconds
3339 // Note: We check device_id && app_id only (not channel) so op-level rate limiting applies even for invalid requests
@@ -53,7 +59,13 @@ app.get('/', middlewareKey(['all', 'write', 'read']), async (c) => {
5359 const body = await getBodyOrQuery < DeviceLink > ( c )
5460 const apikey = c . get ( 'apikey' ) as Database [ 'public' ] [ 'Tables' ] [ 'apikeys' ] [ 'Row' ]
5561 cloudlog ( { requestId : c . get ( 'requestId' ) , message : 'body' , body } )
56- cloudlog ( { requestId : c . get ( 'requestId' ) , message : 'apikey' , apikey } )
62+ cloudlog ( {
63+ requestId : c . get ( 'requestId' ) ,
64+ message : 'apikey context' ,
65+ apikeyId : apikey . id ,
66+ userId : apikey . user_id ,
67+ mode : apikey . mode ,
68+ } )
5769
5870 // Rate limit: max 1 get per second per device+app
5971 if ( body . device_id && body . app_id ) {
@@ -78,7 +90,13 @@ app.delete('/', middlewareKey(['all', 'write']), async (c) => {
7890 const body = await getBodyOrQuery < DeviceLink > ( c )
7991 const apikey = c . get ( 'apikey' ) as Database [ 'public' ] [ 'Tables' ] [ 'apikeys' ] [ 'Row' ]
8092 cloudlog ( { requestId : c . get ( 'requestId' ) , message : 'body' , body } )
81- cloudlog ( { requestId : c . get ( 'requestId' ) , message : 'apikey' , apikey } )
93+ cloudlog ( {
94+ requestId : c . get ( 'requestId' ) ,
95+ message : 'apikey context' ,
96+ apikeyId : apikey . id ,
97+ userId : apikey . user_id ,
98+ mode : apikey . mode ,
99+ } )
82100
83101 // Rate limit: max 1 delete per second per device+app
84102 if ( body . device_id && body . app_id ) {
0 commit comments