mirror of https://github.com/nucypher/nucypher.git
Be consistent with parameters that are not optional
Co-authored-by: Derek Pierre <derek.pierre@gmail.com>pull/3586/head
parent
22a18983f4
commit
7a33522410
|
@ -69,8 +69,8 @@ class JWTVerificationCall(ExecutionCall):
|
|||
|
||||
def __init__(
|
||||
self,
|
||||
jwt_token: Optional[str] = None,
|
||||
public_key: Optional[str] = None,
|
||||
jwt_token: str,
|
||||
public_key: str,
|
||||
expected_issuer: Optional[str] = None,
|
||||
):
|
||||
self.jwt_token = jwt_token
|
||||
|
@ -127,10 +127,10 @@ class JWTCondition(ExecutionCallAccessControlCondition):
|
|||
|
||||
def __init__(
|
||||
self,
|
||||
jwt_token: str,
|
||||
public_key: str,
|
||||
condition_type: str = ConditionType.JWT.value,
|
||||
name: Optional[str] = None,
|
||||
jwt_token: Optional[str] = None,
|
||||
public_key: Optional[str] = None,
|
||||
expected_issuer: Optional[str] = None,
|
||||
):
|
||||
super().__init__(
|
||||
|
|
|
@ -107,14 +107,16 @@ def test_jwt_condition_missing_jwt_token():
|
|||
with pytest.raises(
|
||||
InvalidCondition, match="'jwt_token' field - Field may not be null."
|
||||
):
|
||||
_ = JWTCondition()
|
||||
_ = JWTCondition(jwt_token=None, public_key=None)
|
||||
|
||||
|
||||
def test_jwt_condition_missing_public_key():
|
||||
with pytest.raises(
|
||||
InvalidCondition, match="'public_key' field - Field may not be null."
|
||||
):
|
||||
_ = JWTCondition(jwt_token=":ok_ok_this_is_a_variable_for_a_jwt")
|
||||
_ = JWTCondition(
|
||||
jwt_token=":ok_ok_this_is_a_variable_for_a_jwt", public_key=None
|
||||
)
|
||||
|
||||
|
||||
def test_jwt_condition_invalid_public_key():
|
||||
|
|
Loading…
Reference in New Issue