Exemplo n.º 1
0
 def with_assumed_user_id(process: ProcessQuery) -> ProcessQuery:
     # The ssh_process must have an associated user id
     (
         UserIdAssumptionQuery()
         .with_assuming_process(process)
         .with_user_id()
     )
     return process
Exemplo n.º 2
0
    def get_user_id(process: ProcessView) -> Optional[int]:
        user_assumption = (UserIdAssumptionQuery().with_assuming_process(
            ProcessQuery().with_node_key(
                process.node_key)).with_user_id().query_first(
                    process.dgraph_client)
                           )  # type: Optional[UserIdAssumptionView]
        if user_assumption:
            return user_assumption.get_used_id()

        return None
Exemplo n.º 3
0
 def with_assumed_user_id(process: ProcessQuery) -> ProcessQuery:
     (UserIdAssumptionQuery().with_assuming_process(process).with_user_id())
     return process