Loading src/open_exposure_gateway/api/camara/quality_on_demand/v1_1_0/router.py +13 −0 Changes for src/open_exposure_gateway/api/camara/quality_on_demand/v1_1_0/router.py: 13 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ from open_exposure_gateway.api.camara.common import XCorrelatorHeader from open_exposure_gateway.api.camara.quality_on_demand.v1_1_0.schemas import ( CreateSession, ExtendSessionDuration, RetrieveSessionsInput, SessionInfo, ) from open_exposure_gateway.application.services.quality_on_demand_service import ( Loading Loading @@ -137,3 +138,15 @@ async def delete_qod_session( ) async def extend_qod_session_duration(sessionId: str, request: ExtendSessionDuration) -> Any: raise NotImplementedException(message="Session duration extension is not implemented") @router.post( "/retrieve-sessions", tags=["QoS Sessions"], summary="Get QoS session information for a device", response_model=list[SessionInfo], response_model_exclude_none=True, responses=_responses(400, 401, 403, 404, 422, 429, 500, 501, 503), ) async def retrieve_qod_sessions_by_device(request: RetrieveSessionsInput) -> Any: raise NotImplementedException(message="Retrieving sessions by device is not implemented") src/open_exposure_gateway/api/camara/quality_on_demand/v1_1_0/schemas.py +4 −0 Changes for src/open_exposure_gateway/api/camara/quality_on_demand/v1_1_0/schemas.py: 4 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -162,3 +162,7 @@ class SessionInfo(BaseSessionInfo): class ExtendSessionDuration(BaseModel): requestedAdditionalDuration: int = Field(ge=1) class RetrieveSessionsInput(BaseModel): device: Optional[Device] = None src/open_exposure_gateway/core/authorization.py +16 −0 Changes for src/open_exposure_gateway/core/authorization.py: 16 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -36,6 +36,22 @@ OPERATION_REQUIREMENTS: dict[str, OperationRequirements] = { ), "GET /qod/v0/qos-profiles": OperationRequirements("app-provider"), "GET /qod/v0/qos-profiles/{name}": OperationRequirements("app-provider"), # Quality on Demand v1: openId only, so the scope applies to every caller. "POST /quality-on-demand/v1/sessions": OperationRequirements( "app-provider", scope="quality-on-demand:sessions:create" ), "GET /quality-on-demand/v1/sessions/{sessionId}": OperationRequirements( "app-provider", scope="quality-on-demand:sessions:read" ), "DELETE /quality-on-demand/v1/sessions/{sessionId}": OperationRequirements( "app-provider", scope="quality-on-demand:sessions:delete" ), "POST /quality-on-demand/v1/sessions/{sessionId}/extend": OperationRequirements( "app-provider", scope="quality-on-demand:sessions:update" ), "POST /quality-on-demand/v1/retrieve-sessions": OperationRequirements( "app-provider", scope="quality-on-demand:sessions:retrieve-by-device" ), # Edge Application Management "GET /edge-application-management/v0.1alpha1/edge-cloud-zones": OperationRequirements( "app-provider", scope="edge-application-management:edge-cloud-zones:read" Loading src/open_exposure_gateway/core/exceptions.py +22 −4 Changes for src/open_exposure_gateway/core/exceptions.py: 22 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -20,6 +20,14 @@ class ErrorCode(StrEnum): UNNECESSARY_IDENTIFIER = "UNNECESSARY_IDENTIFIER" IDENTIFIER_NOT_FOUND = "IDENTIFIER_NOT_FOUND" SERVICE_NOT_APPLICABLE = "SERVICE_NOT_APPLICABLE" INVALID_SINK = "INVALID_SINK" INVALID_CREDENTIAL = "INVALID_CREDENTIAL" INVALID_TOKEN = "INVALID_TOKEN" QUALITY_ON_DEMAND_DURATION_OUT_OF_RANGE = "QUALITY_ON_DEMAND.DURATION_OUT_OF_RANGE" QUALITY_ON_DEMAND_QOS_PROFILE_NOT_APPLICABLE = "QUALITY_ON_DEMAND.QOS_PROFILE_NOT_APPLICABLE" QUALITY_ON_DEMAND_SESSION_EXTENSION_NOT_ALLOWED = ( "QUALITY_ON_DEMAND.SESSION_EXTENSION_NOT_ALLOWED" ) LOCATION_RETRIEVAL_UNABLE_TO_LOCATE = "LOCATION_RETRIEVAL.UNABLE_TO_LOCATE" LOCATION_RETRIEVAL_UNABLE_TO_FULFILL_MAX_AGE = "LOCATION_RETRIEVAL.UNABLE_TO_FULFILL_MAX_AGE" LOCATION_RETRIEVAL_UNABLE_TO_FULFILL_MAX_SURFACE = ( Loading @@ -43,8 +51,13 @@ class OEGException(Exception): class BadRequestException(OEGException): def __init__(self, message: str = "Bad request", details: Optional[Any] = None): super().__init__(message, 400, ErrorCode.INVALID_ARGUMENT, details) def __init__( self, message: str = "Bad request", details: Optional[Any] = None, error_code: ErrorCode = ErrorCode.INVALID_ARGUMENT, ): super().__init__(message, 400, error_code, details) class UnauthorizedException(OEGException): Loading Loading @@ -73,8 +86,13 @@ class MethodNotAllowedException(OEGException): class ConflictException(OEGException): def __init__(self, message: str = "Conflict", details: Optional[Any] = None): super().__init__(message, 409, ErrorCode.CONFLICT, details) def __init__( self, message: str = "Conflict", details: Optional[Any] = None, error_code: ErrorCode = ErrorCode.CONFLICT, ): super().__init__(message, 409, error_code, details) class AlreadyExistsException(OEGException): Loading tests/unit/test_authorization.py +1 −0 Changes for tests/unit/test_authorization.py: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -105,6 +105,7 @@ class TestEveryRouteIsRegistered: # which would otherwise only surface as a 500 at request time. guarded_prefixes = ( "/qod/", "/quality-on-demand/", "/edge-application-management/", "/location-retrieval/", "/platform/v1/federation/", Loading Loading
src/open_exposure_gateway/api/camara/quality_on_demand/v1_1_0/router.py +13 −0 Changes for src/open_exposure_gateway/api/camara/quality_on_demand/v1_1_0/router.py: 13 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ from open_exposure_gateway.api.camara.common import XCorrelatorHeader from open_exposure_gateway.api.camara.quality_on_demand.v1_1_0.schemas import ( CreateSession, ExtendSessionDuration, RetrieveSessionsInput, SessionInfo, ) from open_exposure_gateway.application.services.quality_on_demand_service import ( Loading Loading @@ -137,3 +138,15 @@ async def delete_qod_session( ) async def extend_qod_session_duration(sessionId: str, request: ExtendSessionDuration) -> Any: raise NotImplementedException(message="Session duration extension is not implemented") @router.post( "/retrieve-sessions", tags=["QoS Sessions"], summary="Get QoS session information for a device", response_model=list[SessionInfo], response_model_exclude_none=True, responses=_responses(400, 401, 403, 404, 422, 429, 500, 501, 503), ) async def retrieve_qod_sessions_by_device(request: RetrieveSessionsInput) -> Any: raise NotImplementedException(message="Retrieving sessions by device is not implemented")
src/open_exposure_gateway/api/camara/quality_on_demand/v1_1_0/schemas.py +4 −0 Changes for src/open_exposure_gateway/api/camara/quality_on_demand/v1_1_0/schemas.py: 4 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -162,3 +162,7 @@ class SessionInfo(BaseSessionInfo): class ExtendSessionDuration(BaseModel): requestedAdditionalDuration: int = Field(ge=1) class RetrieveSessionsInput(BaseModel): device: Optional[Device] = None
src/open_exposure_gateway/core/authorization.py +16 −0 Changes for src/open_exposure_gateway/core/authorization.py: 16 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -36,6 +36,22 @@ OPERATION_REQUIREMENTS: dict[str, OperationRequirements] = { ), "GET /qod/v0/qos-profiles": OperationRequirements("app-provider"), "GET /qod/v0/qos-profiles/{name}": OperationRequirements("app-provider"), # Quality on Demand v1: openId only, so the scope applies to every caller. "POST /quality-on-demand/v1/sessions": OperationRequirements( "app-provider", scope="quality-on-demand:sessions:create" ), "GET /quality-on-demand/v1/sessions/{sessionId}": OperationRequirements( "app-provider", scope="quality-on-demand:sessions:read" ), "DELETE /quality-on-demand/v1/sessions/{sessionId}": OperationRequirements( "app-provider", scope="quality-on-demand:sessions:delete" ), "POST /quality-on-demand/v1/sessions/{sessionId}/extend": OperationRequirements( "app-provider", scope="quality-on-demand:sessions:update" ), "POST /quality-on-demand/v1/retrieve-sessions": OperationRequirements( "app-provider", scope="quality-on-demand:sessions:retrieve-by-device" ), # Edge Application Management "GET /edge-application-management/v0.1alpha1/edge-cloud-zones": OperationRequirements( "app-provider", scope="edge-application-management:edge-cloud-zones:read" Loading
src/open_exposure_gateway/core/exceptions.py +22 −4 Changes for src/open_exposure_gateway/core/exceptions.py: 22 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -20,6 +20,14 @@ class ErrorCode(StrEnum): UNNECESSARY_IDENTIFIER = "UNNECESSARY_IDENTIFIER" IDENTIFIER_NOT_FOUND = "IDENTIFIER_NOT_FOUND" SERVICE_NOT_APPLICABLE = "SERVICE_NOT_APPLICABLE" INVALID_SINK = "INVALID_SINK" INVALID_CREDENTIAL = "INVALID_CREDENTIAL" INVALID_TOKEN = "INVALID_TOKEN" QUALITY_ON_DEMAND_DURATION_OUT_OF_RANGE = "QUALITY_ON_DEMAND.DURATION_OUT_OF_RANGE" QUALITY_ON_DEMAND_QOS_PROFILE_NOT_APPLICABLE = "QUALITY_ON_DEMAND.QOS_PROFILE_NOT_APPLICABLE" QUALITY_ON_DEMAND_SESSION_EXTENSION_NOT_ALLOWED = ( "QUALITY_ON_DEMAND.SESSION_EXTENSION_NOT_ALLOWED" ) LOCATION_RETRIEVAL_UNABLE_TO_LOCATE = "LOCATION_RETRIEVAL.UNABLE_TO_LOCATE" LOCATION_RETRIEVAL_UNABLE_TO_FULFILL_MAX_AGE = "LOCATION_RETRIEVAL.UNABLE_TO_FULFILL_MAX_AGE" LOCATION_RETRIEVAL_UNABLE_TO_FULFILL_MAX_SURFACE = ( Loading @@ -43,8 +51,13 @@ class OEGException(Exception): class BadRequestException(OEGException): def __init__(self, message: str = "Bad request", details: Optional[Any] = None): super().__init__(message, 400, ErrorCode.INVALID_ARGUMENT, details) def __init__( self, message: str = "Bad request", details: Optional[Any] = None, error_code: ErrorCode = ErrorCode.INVALID_ARGUMENT, ): super().__init__(message, 400, error_code, details) class UnauthorizedException(OEGException): Loading Loading @@ -73,8 +86,13 @@ class MethodNotAllowedException(OEGException): class ConflictException(OEGException): def __init__(self, message: str = "Conflict", details: Optional[Any] = None): super().__init__(message, 409, ErrorCode.CONFLICT, details) def __init__( self, message: str = "Conflict", details: Optional[Any] = None, error_code: ErrorCode = ErrorCode.CONFLICT, ): super().__init__(message, 409, error_code, details) class AlreadyExistsException(OEGException): Loading
tests/unit/test_authorization.py +1 −0 Changes for tests/unit/test_authorization.py: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -105,6 +105,7 @@ class TestEveryRouteIsRegistered: # which would otherwise only surface as a 500 at request time. guarded_prefixes = ( "/qod/", "/quality-on-demand/", "/edge-application-management/", "/location-retrieval/", "/platform/v1/federation/", Loading