Skip to content

Commit f34451b

Browse files
feat: remove get_device_list
1 parent a46f816 commit f34451b

3 files changed

Lines changed: 0 additions & 67 deletions

File tree

cffi_defs.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -239,23 +239,10 @@ typedef struct tanker_verification_options tanker_verification_options_t;
239239
typedef struct tanker_encrypt_options tanker_encrypt_options_t;
240240
typedef struct tanker_sharing_options tanker_sharing_options_t;
241241
typedef struct tanker_log_record tanker_log_record_t;
242-
typedef struct tanker_device_list_elem tanker_device_list_elem_t;
243-
typedef struct tanker_device_list tanker_device_list_t;
244242
typedef struct tanker_verification_method_list
245243
tanker_verification_method_list_t;
246244
typedef struct tanker_attach_result tanker_attach_result_t;
247245

248-
struct tanker_device_list
249-
{
250-
tanker_device_list_elem_t* devices;
251-
uint32_t count;
252-
};
253-
254-
struct tanker_device_list_elem
255-
{
256-
char const* device_id;
257-
};
258-
259246
struct tanker_verification_method_list
260247
{
261248
tanker_verification_method_t* methods;
@@ -409,8 +396,6 @@ enum tanker_status tanker_status(tanker_t* tanker);
409396

410397
tanker_future_t* tanker_device_id(tanker_t* session);
411398

412-
tanker_future_t* tanker_get_device_list(tanker_t* session);
413-
414399
tanker_future_t* tanker_generate_verification_key(tanker_t* session);
415400

416401
tanker_future_t* tanker_set_verification_method(
@@ -452,8 +437,6 @@ tanker_future_t* tanker_verify_provisional_identity(
452437

453438
void tanker_free_buffer(void const* buffer);
454439

455-
void tanker_free_device_list(tanker_device_list_t* list);
456-
457440
void tanker_free_verification_method_list(
458441
tanker_verification_method_list_t* list);
459442

tankersdk/tanker.py

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -480,22 +480,6 @@ def get(self) -> CData:
480480
return self._c_verification_list
481481

482482

483-
class Device:
484-
"""An element of the list returned by `tanker.get_device_list()`
485-
486-
:ivar device_id: The id of the device
487-
488-
"""
489-
490-
def __init__(self, device_id: str):
491-
self.device_id = device_id
492-
493-
@classmethod
494-
def from_c(cls, c_device_list_elem: CData) -> "Device":
495-
device_id = ffihelpers.c_string_to_str(c_device_list_elem.device_id)
496-
return cls(device_id)
497-
498-
499483
class InputStream(typing_extensions.Protocol):
500484
async def read(self, size: int) -> bytes:
501485
...
@@ -915,29 +899,6 @@ async def device_id(self) -> str:
915899
tankerlib.tanker_free_buffer(c_str)
916900
return res
917901

918-
async def get_device_list(self) -> List[Device]:
919-
"""Get the list of devices owned by the current user
920-
921-
:returns: a list of :py:class`Device` instances
922-
"""
923-
warnings.warn(
924-
'The "get_device_list" method is deprecated, it will be removed in the future',
925-
DeprecationWarning,
926-
)
927-
928-
c_future = tankerlib.tanker_get_device_list(self.c_tanker)
929-
c_voidp = await ffihelpers.handle_tanker_future(c_future)
930-
c_list = ffi.cast("tanker_device_list_t*", c_voidp)
931-
count = c_list.count
932-
c_devices = c_list.devices
933-
res = []
934-
for i in range(count):
935-
c_device_list_elem = c_devices[i]
936-
device_description = Device.from_c(c_device_list_elem)
937-
res.append(device_description)
938-
tankerlib.tanker_free_device_list(c_list)
939-
return res
940-
941902
def get_resource_id(self, encrypted_data: bytes) -> str:
942903
"""Get resource ID from `encrypted` data"""
943904
c_expected = tankerlib.tanker_get_resource_id(

test/test_tanker.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -804,17 +804,6 @@ async def test_add_device(tmp_path: Path, app: Dict[str, str]) -> None:
804804
await phone.stop()
805805

806806

807-
@pytest.mark.asyncio
808-
async def test_get_device_list(tmp_path: Path, app: Dict[str, str]) -> None:
809-
_, laptop, phone = await create_two_devices(tmp_path, app)
810-
laptop_id = await laptop.device_id()
811-
phone_id = await phone.device_id()
812-
813-
actual_list = await phone.get_device_list()
814-
actual_ids = [x.device_id for x in actual_list]
815-
assert set(actual_ids) == {laptop_id, phone_id}
816-
817-
818807
@pytest.mark.asyncio
819808
async def test_must_verify_identity_on_second_device(
820809
tmp_path: Path, app: Dict[str, str]

0 commit comments

Comments
 (0)