Commit 7bb80498 authored by Wei Shoulin's avatar Wei Shoulin
Browse files

module_id validation

parent 5fc2146b
Pipeline #5810 passed with stage
...@@ -3,12 +3,15 @@ import datetime ...@@ -3,12 +3,15 @@ import datetime
from ..common.service import grpc_channel from ..common.service import grpc_channel
from ..common.utils import * from ..common.utils import *
from ..common.constants import * from ..common.constants import *
from csst_dfs_commons.models.constants import MODULES
class Level1DataApi(object): class Level1DataApi(object):
def __init__(self): def __init__(self):
self.stub = None self.stub = None
@grpc_channel @grpc_channel
def find(self, **kwargs): def find(self, **kwargs):
if get_parameter(kwargs, "module_id") not in MODULES:
return Result.error(message="module_id is not allowed")
return find_req("Level1Servicer.Find", kwargs) return find_req("Level1Servicer.Find", kwargs)
@grpc_channel @grpc_channel
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment