Skip to content

Commit b380681

Browse files
authored
Merge pull request #49 from provokateurin/feat/config/global-key
feat(config): Allow passing through global_key option
2 parents b691efc + c048d37 commit b380681

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## v0.0.4 - 2024-??-?? - ???
2+
3+
* Add global_key provider param to support disabling IP whitelisting
4+
5+
16
## v0.0.3 - 2024-11-29 - Delete w/o fail
27

38
* Deletion of records results in a stack trace in version 0.0.2.

octodns_transip/__init__.py

+16-3
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,28 @@ class TransipProvider(BaseProvider):
8080
# See root NS handling in _process_desired_zone for more information
8181
ROOT_NS_TTL = 3600
8282

83-
def __init__(self, id, account, key=None, key_file=None, *args, **kwargs):
83+
def __init__(
84+
self,
85+
id,
86+
account,
87+
key=None,
88+
key_file=None,
89+
global_key=False,
90+
*args,
91+
**kwargs,
92+
):
8493
self.log = getLogger('TransipProvider[{}]'.format(id))
8594
self.log.debug('__init__: id=%s, account=%s, token=***', id, account)
8695
super().__init__(id, *args, **kwargs)
8796

8897
if key_file is not None:
89-
self._client = TransIP(login=account, private_key_file=key_file)
98+
self._client = TransIP(
99+
login=account, global_key=global_key, private_key_file=key_file
100+
)
90101
elif key is not None:
91-
self._client = TransIP(login=account, private_key=key)
102+
self._client = TransIP(
103+
login=account, global_key=global_key, private_key=key
104+
)
92105
else:
93106
raise TransipConfigException(
94107
'Missing `key` or `key_file` parameter in config'

tests/test_provider_octodns_transip.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,9 @@ def test_init(self):
178178
# Those should work
179179
TransipProvider("test", "unittest", key=self.bogus_key)
180180
TransipProvider("test", "unittest", key_file="/fake/path")
181-
TransipProvider("test", "unittest", key_file="/fake/path")
181+
TransipProvider(
182+
"test", "unittest", key_file="/fake/path", global_key=True
183+
)
182184

183185
@patch("octodns_transip.TransIP", make_failing_mock(401))
184186
def test_populate_unauthenticated(self):

0 commit comments

Comments
 (0)