Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b93281c

Browse files
guillaume-pujollbalmaceda
authored andcommitted
remove fields and include_fields from Hooks.get_secrets
1 parent 55e8db9 commit b93281c

File tree

2 files changed

+4
-24
lines changed

2 files changed

+4
-24
lines changed

auth0/v3/management/hooks.py

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -129,27 +129,16 @@ def update(self, id, body):
129129
"""
130130
return self.client.patch(self._url(id), data=body)
131131

132-
def get_secrets(self, id, fields=None, include_fields=True):
132+
def get_secrets(self, id):
133133
"""Retrieves a hook's secrets.
134134
135135
Args:
136136
id (str): The id of the hook to retrieve secrets from.
137137
138-
fields (list, optional): A list of fields to include or exclude
139-
(depending on include_fields) from the result, empty to
140-
retrieve all fields.
141-
142-
include_fields (bool, optional): True if the fields specified are
143-
to be included in the result, False otherwise
144-
(defaults to true).
145-
146138
See: https://auth0.com/docs/api/management/v2#!/Hooks/get_secrets
147139
"""
148-
params = {
149-
"fields": fields and ",".join(fields) or None,
150-
"include_fields": str(include_fields).lower(),
151-
}
152-
return self.client.get(self._url("%s/secrets" % id), params=params)
140+
141+
return self.client.get(self._url("%s/secrets" % id))
153142

154143
def add_secrets(self, id, body):
155144
"""Add one or more secrets for an existing hook.

auth0/v3/test/management/test_hooks.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -138,16 +138,7 @@ def test_get_secrets(self, mock_rc):
138138
args, kwargs = mock_instance.get.call_args
139139

140140
self.assertEqual('https://domain/api/v2/hooks/an-id/secrets', args[0])
141-
self.assertEqual(kwargs['params'], {'fields': None,
142-
'include_fields': 'true'})
143-
144-
c.get_secrets('an-id', fields=['a', 'b'], include_fields=False)
145-
146-
args, kwargs = mock_instance.get.call_args
147-
148-
self.assertEqual('https://domain/api/v2/hooks/an-id/secrets', args[0])
149-
self.assertEqual(kwargs['params'], {'fields': 'a,b',
150-
'include_fields': 'false'})
141+
self.assertNotIn("params", kwargs)
151142

152143
@mock.patch('auth0.v3.management.hooks.RestClient')
153144
def test_delete_secrets(self, mock_rc):

0 commit comments

Comments
 (0)