Skip to content

Commit

Permalink
Update default setting
Browse files Browse the repository at this point in the history
  • Loading branch information
mxsasha committed Nov 24, 2021
1 parent 857bfbb commit 92a74f8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
5 changes: 5 additions & 0 deletions irrd/conf/default_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ irrd:
auth:
gnupg_keyring: null
authenticate_parents_route_creation: true
set_creation:
COMMON:
prefix_required: true
autnum_authentication: opportunistic

email:
footer: ''
notification_header: |
Expand Down
2 changes: 0 additions & 2 deletions irrd/updates/parser_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,4 @@ def for_set_name(set_name: str):
setting = get_setting(f'auth.set_creation.{set_name}.autnum_authentication')
if not setting:
setting = get_setting(f'auth.set_creation.{AUTH_SET_CREATION_COMMON_KEY}.autnum_authentication')
if not setting:
return RPSLSetAutnumAuthenticationMode.DISABLED
return getattr(RPSLSetAutnumAuthenticationMode, setting.upper())
8 changes: 1 addition & 7 deletions irrd/updates/tests/test_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,7 @@ def test_as_set_autnum_disabled(self, prepare_mocks, config_override):
['rpsl_pks', ({'TEST-MNT'},), {}],
]

def test_as_set_autnum_opportunistic_exists(self, prepare_mocks, config_override):
config_override({'auth': {'set_creation': {'as-set': {'autnum_authentication': 'opportunistic'}}}})
def test_as_set_autnum_opportunistic_exists_default(self, prepare_mocks, config_override):
validator, mock_dq, mock_dh = prepare_mocks
as_set = rpsl_object_from_text(SAMPLE_AS_SET)
assert as_set.clean_for_create() # fill pk_asn_segment
Expand Down Expand Up @@ -506,11 +505,6 @@ def test_as_set_autnum_opportunistic_exists(self, prepare_mocks, config_override
result = validator.process_auth(as_set, None)
assert result.is_valid()

# Default is disabled
config_override({})
result = validator.process_auth(as_set, None)
assert result.is_valid()

def test_as_set_autnum_opportunistic_does_not_exist(self, prepare_mocks, config_override):
config_override({'auth': {'set_creation': {
AUTH_SET_CREATION_COMMON_KEY: {'autnum_authentication': 'opportunistic'}
Expand Down

0 comments on commit 92a74f8

Please sign in to comment.