@@ -182,9 +182,9 @@ impl Server {
182182 web:: resource ( "/info" ) . route (
183183 web:: get ( )
184184 . to ( http:: prism_logstream:: get_info)
185- . authorize_for_stream ( Action :: GetStreamInfo )
186- . authorize_for_stream ( Action :: GetStats )
187- . authorize_for_stream ( Action :: GetRetention ) ,
185+ . authorize_for_resource ( Action :: GetStreamInfo )
186+ . authorize_for_resource ( Action :: GetStats )
187+ . authorize_for_resource ( Action :: GetRetention ) ,
188188 ) ,
189189 ) ,
190190 )
@@ -195,9 +195,9 @@ impl Server {
195195 "" ,
196196 web:: post ( )
197197 . to ( http:: prism_logstream:: post_datasets)
198- . authorize_for_stream ( Action :: GetStreamInfo )
199- . authorize_for_stream ( Action :: GetStats )
200- . authorize_for_stream ( Action :: GetRetention ) ,
198+ . authorize_for_resource ( Action :: GetStreamInfo )
199+ . authorize_for_resource ( Action :: GetStats )
200+ . authorize_for_resource ( Action :: GetRetention ) ,
201201 )
202202 }
203203
@@ -394,13 +394,13 @@ impl Server {
394394 . route (
395395 web:: put ( )
396396 . to ( logstream:: put_stream)
397- . authorize_for_stream ( Action :: CreateStream ) ,
397+ . authorize_for_resource ( Action :: CreateStream ) ,
398398 )
399399 // POST "/logstream/{logstream}" ==> Post logs to given log stream
400400 . route (
401401 web:: post ( )
402402 . to ( ingest:: post_event)
403- . authorize_for_stream ( Action :: Ingest )
403+ . authorize_for_resource ( Action :: Ingest )
404404 . wrap ( from_fn (
405405 resource_check:: check_resource_utilization_middleware,
406406 ) ) ,
@@ -409,7 +409,7 @@ impl Server {
409409 . route (
410410 web:: delete ( )
411411 . to ( logstream:: delete)
412- . authorize_for_stream ( Action :: DeleteStream ) ,
412+ . authorize_for_resource ( Action :: DeleteStream ) ,
413413 )
414414 . app_data ( web:: JsonConfig :: default ( ) . limit ( MAX_EVENT_PAYLOAD_SIZE ) ) ,
415415 )
@@ -418,23 +418,23 @@ impl Server {
418418 web:: resource ( "/info" ) . route (
419419 web:: get ( )
420420 . to ( logstream:: get_stream_info)
421- . authorize_for_stream ( Action :: GetStreamInfo ) ,
421+ . authorize_for_resource ( Action :: GetStreamInfo ) ,
422422 ) ,
423423 )
424424 . service (
425425 // GET "/logstream/{logstream}/schema" ==> Get schema for given log stream
426426 web:: resource ( "/schema" ) . route (
427427 web:: get ( )
428428 . to ( logstream:: get_schema)
429- . authorize_for_stream ( Action :: GetSchema ) ,
429+ . authorize_for_resource ( Action :: GetSchema ) ,
430430 ) ,
431431 )
432432 . service (
433433 // GET "/logstream/{logstream}/stats" ==> Get stats for given log stream
434434 web:: resource ( "/stats" ) . route (
435435 web:: get ( )
436436 . to ( logstream:: get_stats)
437- . authorize_for_stream ( Action :: GetStats ) ,
437+ . authorize_for_resource ( Action :: GetStats ) ,
438438 ) ,
439439 )
440440 . service (
@@ -443,13 +443,13 @@ impl Server {
443443 . route (
444444 web:: put ( )
445445 . to ( logstream:: put_retention)
446- . authorize_for_stream ( Action :: PutRetention ) ,
446+ . authorize_for_resource ( Action :: PutRetention ) ,
447447 )
448448 // GET "/logstream/{logstream}/retention" ==> Get retention for given logstream
449449 . route (
450450 web:: get ( )
451451 . to ( logstream:: get_retention)
452- . authorize_for_stream ( Action :: GetRetention ) ,
452+ . authorize_for_resource ( Action :: GetRetention ) ,
453453 ) ,
454454 )
455455 . service (
@@ -458,17 +458,17 @@ impl Server {
458458 . route (
459459 web:: put ( )
460460 . to ( logstream:: put_stream_hot_tier)
461- . authorize_for_stream ( Action :: PutHotTierEnabled ) ,
461+ . authorize_for_resource ( Action :: PutHotTierEnabled ) ,
462462 )
463463 . route (
464464 web:: get ( )
465465 . to ( logstream:: get_stream_hot_tier)
466- . authorize_for_stream ( Action :: GetHotTierEnabled ) ,
466+ . authorize_for_resource ( Action :: GetHotTierEnabled ) ,
467467 )
468468 . route (
469469 web:: delete ( )
470470 . to ( logstream:: delete_stream_hot_tier)
471- . authorize_for_stream ( Action :: DeleteHotTierEnabled ) ,
471+ . authorize_for_resource ( Action :: DeleteHotTierEnabled ) ,
472472 ) ,
473473 ) ,
474474 )
@@ -480,7 +480,7 @@ impl Server {
480480 . route (
481481 web:: post ( )
482482 . to ( ingest:: ingest)
483- . authorize_for_stream ( Action :: Ingest ) ,
483+ . authorize_for_resource ( Action :: Ingest ) ,
484484 )
485485 . app_data ( web:: JsonConfig :: default ( ) . limit ( MAX_EVENT_PAYLOAD_SIZE ) )
486486 }
@@ -493,7 +493,7 @@ impl Server {
493493 . route (
494494 web:: post ( )
495495 . to ( ingest:: handle_otel_logs_ingestion)
496- . authorize_for_stream ( Action :: Ingest ) ,
496+ . authorize_for_resource ( Action :: Ingest ) ,
497497 )
498498 . app_data ( web:: JsonConfig :: default ( ) . limit ( MAX_EVENT_PAYLOAD_SIZE ) ) ,
499499 )
@@ -502,7 +502,7 @@ impl Server {
502502 . route (
503503 web:: post ( )
504504 . to ( ingest:: handle_otel_metrics_ingestion)
505- . authorize_for_stream ( Action :: Ingest ) ,
505+ . authorize_for_resource ( Action :: Ingest ) ,
506506 )
507507 . app_data ( web:: JsonConfig :: default ( ) . limit ( MAX_EVENT_PAYLOAD_SIZE ) ) ,
508508 )
@@ -511,7 +511,7 @@ impl Server {
511511 . route (
512512 web:: post ( )
513513 . to ( ingest:: handle_otel_traces_ingestion)
514- . authorize_for_stream ( Action :: Ingest ) ,
514+ . authorize_for_resource ( Action :: Ingest ) ,
515515 )
516516 . app_data ( web:: JsonConfig :: default ( ) . limit ( MAX_EVENT_PAYLOAD_SIZE ) ) ,
517517 )
0 commit comments