Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add keyring and ulp-user #299

Merged
merged 52 commits into from
Dec 7, 2024
Merged
Changes from 1 commit
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
f2b9ca2
feat(keyring): add sample data for testing purposes
RaHehl Nov 30, 2024
e7f1ad9
feat(api): add ulp-user and keyring integration
RaHehl Nov 30, 2024
6bd9761
chore(pre-commit.ci): auto fixes
pre-commit-ci[bot] Nov 30, 2024
482accb
feat(keyrings): work in progress on adding keyrings functionality
RaHehl Nov 30, 2024
aa1f628
chore(pre-commit.ci): auto fixes
pre-commit-ci[bot] Nov 30, 2024
90a1248
refactor(api): streamline keyrings and ulpusers handling in ProtectAp…
RaHehl Dec 1, 2024
b0c23bb
chore(pre-commit.ci): auto fixes
pre-commit-ci[bot] Dec 1, 2024
3070aaf
feat(api): add dict_from_unifi_list function and refactor keyrings an…
RaHehl Dec 6, 2024
096e8ce
chore(pre-commit.ci): auto fixes
pre-commit-ci[bot] Dec 6, 2024
83c766e
refactor(api): replace get_keyrings and get_ulpusers methods with dir…
RaHehl Dec 6, 2024
49edd9b
chore(pre-commit.ci): auto fixes
pre-commit-ci[bot] Dec 6, 2024
0652cf6
fix(api): conditionally assign keyrings and ulp_users based on NVR ve…
RaHehl Dec 6, 2024
f9efb5a
chore(pre-commit.ci): auto fixes
pre-commit-ci[bot] Dec 6, 2024
c44070f
refactor(api): update dict_from_unifi_list to use Any type for return…
RaHehl Dec 6, 2024
232a671
fix(api): convert keys to snake_case in ProtectBaseObject data proces…
RaHehl Dec 6, 2024
d82a0d6
refactor(api): rename keyring and ulp_user update methods for clarity…
RaHehl Dec 6, 2024
a7821ff
test(api): add websocket tests for keyring add, update, and remove ac…
RaHehl Dec 6, 2024
8189ba3
chore(pre-commit.ci): auto fixes
pre-commit-ci[bot] Dec 6, 2024
b494a08
test(api): add websocket tests for keyring add actions with NFC and f…
RaHehl Dec 6, 2024
f958f7a
feat(api): define NFC fingerprint support version as constant
RaHehl Dec 6, 2024
bbcfff8
test(api): improve formatting in NFC keyring add test
RaHehl Dec 6, 2024
3d40a57
refactor(api): improve bootstrap update pop after keyring ulpusr requ…
RaHehl Dec 6, 2024
c038560
chore(pre-commit.ci): auto fixes
pre-commit-ci[bot] Dec 6, 2024
ed3b092
refactor(api): remove to_snake_case from update_from_dict
RaHehl Dec 6, 2024
6405e90
refactor(api): typed dict_from_unifi_list
RaHehl Dec 6, 2024
7b37530
chore(pre-commit.ci): auto fixes
pre-commit-ci[bot] Dec 6, 2024
d9d24dd
refactor(api): update dict_from_unifi_list to use ProtectModelWithId …
RaHehl Dec 6, 2024
456a809
refactor(api): consolidate keyring and ULP user message processing in…
RaHehl Dec 6, 2024
d268d7a
chore(pre-commit.ci): auto fixes
pre-commit-ci[bot] Dec 6, 2024
96cab1d
refactor(api): update device key retrieval and add ULP user managemen…
RaHehl Dec 6, 2024
cacd825
chore(pre-commit.ci): auto fixes
pre-commit-ci[bot] Dec 6, 2024
e6f6910
refactor(api): improve object removal and update handling in Bootstra…
RaHehl Dec 6, 2024
61020d8
chore(pre-commit.ci): auto fixes
pre-commit-ci[bot] Dec 6, 2024
99163a8
refactor(api): streamline action handling in Bootstrap class
RaHehl Dec 6, 2024
c636bfc
Merge branch 'uilibs:main' into add-keyring
RaHehl Dec 6, 2024
426f5ab
refactor(api): remove unused user message processing method in Bootst…
RaHehl Dec 6, 2024
5b5e8b6
refactor(api): move dict_from_unifi_list function to convert module
RaHehl Dec 7, 2024
a3fb886
chore(pre-commit.ci): auto fixes
pre-commit-ci[bot] Dec 7, 2024
2fcfffa
test(api): add tests for force update with version checks
RaHehl Dec 7, 2024
58cce26
chore(pre-commit.ci): auto fixes
pre-commit-ci[bot] Dec 7, 2024
f64c321
test(api): remove outdated NFC fingerprint support version tests
RaHehl Dec 7, 2024
c2171fb
test(data): remove additional keys from obj_dict in bootstrap test
RaHehl Dec 7, 2024
8500629
fix(data): enhance type checking for model class in bootstrap and upd…
RaHehl Dec 7, 2024
ae5bb87
fix(data): improve type handling in Bootstrap and convert functions f…
RaHehl Dec 7, 2024
79d6d34
fix(api): enhance type safety by casting keyrings and ulp_users in Pr…
RaHehl Dec 7, 2024
fa5ffbf
chore(pre-commit.ci): auto fixes
pre-commit-ci[bot] Dec 7, 2024
a7bce24
fix(api): remove type check for ProtectModelWithId and enhance mock d…
RaHehl Dec 7, 2024
fc437bc
chore(pre-commit.ci): auto fixes
pre-commit-ci[bot] Dec 7, 2024
4c81f0e
fix(api): add debug logging for unexpected websocket actions and enha…
RaHehl Dec 7, 2024
1d23987
chore(pre-commit.ci): auto fixes
pre-commit-ci[bot] Dec 7, 2024
b7bf1b2
fix(data): initialize keyrings and ulp_users as empty dictionaries; u…
RaHehl Dec 7, 2024
1e9e3a7
fix: lint
bdraco Dec 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor(api): update dict_from_unifi_list to use Any type for return…
… dictionary
RaHehl committed Dec 6, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit c44070f2037c6a983193523c5ed5d88979b1155f
4 changes: 2 additions & 2 deletions src/uiprotect/api.py
Original file line number Diff line number Diff line change
@@ -153,8 +153,8 @@ def get_user_hash(host: str, username: str) -> str:
return session.hexdigest()


def dict_from_unifi_list(self, list) -> dict[str, Keyring]:
return_dict: dict[str, Keyring] = {}
def dict_from_unifi_list(self, list) -> dict[str, Any]:
RaHehl marked this conversation as resolved.
Show resolved Hide resolved
RaHehl marked this conversation as resolved.
Show resolved Hide resolved
RaHehl marked this conversation as resolved.
Show resolved Hide resolved
return_dict: dict[str, Any] = {}
for obj_dict in list:
RaHehl marked this conversation as resolved.
Show resolved Hide resolved
obj = create_from_unifi_dict(obj_dict, api=self)
return_dict[obj.id] = obj