FATE icon indicating copy to clipboard operation
FATE copied to clipboard

check_component_constraint in authentication_utils.py

Open wxli0 opened this issue 3 years ago • 0 comments

Hello!

I am wondering if someone could please explain the reason for lines 366-368 in authentication_utils.py. The code snippet is:

(365) if 'guest' in roles.keys() and 'arbiter' in roles.keys() and 'host' in roles.keys():
(366)                for party_id in set(roles['guest']) & set(roles['arbiter']):
(367)                    if party_id not in roles['host'] or len(set(roles['guest']) & set(roles['arbiter'])) != len(roles['host']):
(368)                        raise Exception("{} component constraint party id, please check role config:{}".format(cpn, job_runtime_conf.get('role')))

I think lines 366-368 mean that party ids in the intersection of guest and arbiter should be exactly the same as the party ids in host; otherwise, an exception is thrown. Why does the if statement in line 367 have to be true?

Any help is greatly appreciated!

wxli0 avatar May 23 '22 01:05 wxli0