File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize};
44use uuid:: Uuid ;
55
66use crate :: DgwState ;
7- use crate :: extract:: { AgentManagementReadAccess , AgentManagementWriteAccess } ;
7+ use crate :: extract:: { AgentManagementDeleteAccess , AgentManagementReadAccess } ;
88use crate :: http:: HttpError ;
99
1010#[ derive( Deserialize ) ]
@@ -148,7 +148,7 @@ async fn get_agent(
148148
149149/// Delete (unregister) an agent by ID.
150150async fn delete_agent (
151- _access : AgentManagementWriteAccess ,
151+ _access : AgentManagementDeleteAccess ,
152152 State ( DgwState {
153153 agent_tunnel_handle, ..
154154 } ) : State < DgwState > ,
Original file line number Diff line number Diff line change @@ -478,13 +478,13 @@ where
478478 }
479479}
480480
481- /// Grants write access to agent management endpoints.
481+ /// Grants delete access to agent management endpoints.
482482///
483483/// Accepts scope tokens with `AgentDelete` or `Wildcard` scope.
484484#[ derive( Clone , Copy ) ]
485- pub struct AgentManagementWriteAccess ;
485+ pub struct AgentManagementDeleteAccess ;
486486
487- impl < S > FromRequestParts < S > for AgentManagementWriteAccess
487+ impl < S > FromRequestParts < S > for AgentManagementDeleteAccess
488488where
489489 S : Send + Sync ,
490490{
@@ -500,9 +500,9 @@ where
500500 AccessTokenClaims :: Scope ( scope) => match scope. scope {
501501 AccessScope :: Wildcard | AccessScope :: AgentDelete => Ok ( Self ) ,
502502 _ => Err ( HttpError :: forbidden ( )
503- . msg ( "invalid scope for agent management write (require one of: gateway.agent.delete, *)" ) ) ,
503+ . msg ( "invalid scope for agent management delete (require one of: gateway.agent.delete, *)" ) ) ,
504504 } ,
505- _ => Err ( HttpError :: forbidden ( ) . msg ( "scope token required for agent management write " ) ) ,
505+ _ => Err ( HttpError :: forbidden ( ) . msg ( "scope token required for agent management delete " ) ) ,
506506 }
507507 }
508508}
You can’t perform that action at this time.
0 commit comments