1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

68 Commits

Author SHA1 Message Date
81ca455fef Move array_to_range(), array_to_string(), deepmerge(), drange(), flatten_dict(), and shallow_compare_dict() to utilities.data 2024-03-22 08:59:52 -04:00
6f6d483ca5 Merge branch 'feature' into 15277-object-types 2024-03-05 08:52:07 -05:00
cd74e040c1 Merge branch 'feature' into 15278-primary-nested-serializers 2024-03-04 16:42:36 -05:00
0419a69ae8 Clean up outdated references to ContentType 2024-03-04 10:46:34 -05:00
01ee9c87b8 Update ObjectPermission.object_types to reference ObjectType 2024-03-04 09:52:45 -05:00
c6a3fc2407 #12795: Introduce a custom Group model (#15304)
* Rename sequences & indexes after renaming users table

* Migrate from auth.Group to a custom group model

* Delete original groups from auth_group table

* Update object & multi-object custom fields referencing the Group model

* Fix ContentType resolution

* Clean up obsolete logic for view/serializer resolution
2024-03-04 08:29:53 -05:00
ca56c8b9ef Add dynamic nesting support to SerializedPKRelatedField 2024-02-27 14:00:42 -05:00
c382ba0ae0 Refactor REST API serializers to avoid circular imports 2024-02-27 13:26:43 -05:00
c146f5e1b5 Replace nested serializers with primary serializers where possible 2024-02-26 16:49:30 -05:00
d042e6f69d Closes #15238: Include description field in brief mode 2024-02-26 11:39:31 -05:00
3f3bcc5eb5 Closes #15235: Use primary serializers for REST API "brief" mode (#15246)
* Use primary serializers for brief mode

* Remove BriefModeMixin

* Correct ModuleBayTest brief_fields (see #15243)
2024-02-23 14:21:25 -05:00
3ddacf4b88 Merge branch 'develop' into feature 2024-02-21 16:24:23 -05:00
cf3969bc6c Added Last Login to user/profile GUI views and the /users/user API output (#15198)
* Added Last Login to user/profile GUI and user api output

* Update netbox/templates/account/profile.html

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>

* Update netbox/templates/account/profile.html

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>

* Update netbox/templates/users/user.html

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2024-02-20 15:43:49 -05:00
b3f25a400b Closes #15087: Support for specifying a subset of API serializer fields (#15122)
* Enable dynamic field inclusion for REST API serializers

* Recurse through nested serializer when resolving prefetches

* Remove obsolete calls to prefetch_related() for API views

* Remove support for brief_prefetch_fields viewset attribute

* Rename query parameter

* Fixes #15133: Fix FHRP group representation on assignments endpoint under brief mode (#15134)

* Fixes #15133: Fix FHRP group representation on assignments endpoint under brief mode

* Update API test

* Restore get_queryset() on BriefModeMixin, minus prefetch logic

* get_prefetches_for_serializer() should reference serializer field source if set
2024-02-14 09:28:37 -05:00
3a3d43911c Fixed password was not hashed on REST API update (#14340)
* Fixed password was not hashed on REST API update

* When we updated a user password with a REST API call the password was
  stored in clear in plain text in the database.

* Following code review

* Move test on UserTest class
* Call `super().update()` in overriding `update` method

* Return directly the result of `super().update()`
2023-11-29 15:59:54 -05:00
7848beedce adds additional parameters for token provision api #12870 2023-09-01 12:33:02 -04:00
2a4e3dd09f Merge branch 'develop' into feature 2023-08-29 10:45:55 -04:00
be2b24a155 fixes the swagger schema for token provisioning #13557 2023-08-25 09:45:03 -04:00
07f68ae579 Closes #13038: Establish DEFAULT_PERMISSIONS config parameter (#13308)
* Introduce the DEFAULT_PERMISSIONS config parameter

* Establish default permissions for user token management
2023-07-30 15:04:58 -04:00
518fd8cca6 12794 change User ref to get_user_model (#12905)
* 12794 change User ref to get_user_model

* 12794 call get_user_model once in tests

* 12794 call get_user_model once in tests

* 12794 use settings.AUTH_USER_MODEL for FK reference
2023-06-22 08:26:50 -04:00
59a6b3e71b Merge branch 'develop' into feature 2023-04-12 17:38:16 -04:00
9e305c6181 Closes #12207: Establish a permission for creating API tokens on behalf of other users (#12192)
* 11091 add permission to allow user to create api tokens for other users

* 11091 update docs

* 11091 fix for test

* 11091 fix for test

* 11091 test case for invalid token creation

* 11091 add test for permission grant

* Cleanup & fix serializer validation

---------

Co-authored-by: jeremystretch <jstretch@netboxlabs.com>
2023-04-12 10:25:06 -04:00
ecd0c56554 Closes #9608: Move from drf-yasg to spectacular
Co-authored-by: arthanson <worldnomad@gmail.com>
Co-authored-by: jeremystretch <jstretch@netboxlabs.com>
2023-03-30 14:32:59 -04:00
816fedb78d 8853 Prevent the retrieval of API tokens after creation (#10645)
* 8853 hide api token

* 8853 hide key on edit

* 8853 add key display

* 8853 cleanup html

* 8853 make token view accessible only once on POST

* Clean up display of tokens in views

* Honor ALLOW_TOKEN_RETRIEVAL in API serializer

* Add docs & tweak default setting

* Include token key when provisioning with user credentials

Co-authored-by: jeremystretch <jstretch@ns1.com>
2022-11-02 12:45:00 -04:00
b11fa53519 Closes #10231: Add missing serializer annotations 2022-09-01 17:18:09 +02:00
1b88b36820 Merge branch 'develop' into feature 2022-08-08 15:39:03 -04:00
876251c1cf Fixes #9948: Fix TypeError exception when requesting API tokens list as non-authenticated user 2022-08-08 12:22:01 -04:00
36ac83a319 Fixes #9949: Fix KeyError exception resulting from invalid API token provisioning request 2022-08-08 11:43:27 -04:00
3eb6b6c07f Clean up core API imports 2022-07-13 16:18:55 -04:00
dc05e62ce0 Documentation & clenaup for #9536 2022-06-23 12:15:02 -04:00
d4db656940 Allowed IPs should be optional on Token 2022-06-23 08:09:39 -04:00
3c15419bd0 Introduce IPNetworkSerializer to serialize allowed token IPs 2022-06-22 21:51:43 -04:00
a38a880e67 Refactor source IP resolution logic 2022-06-22 17:01:07 -04:00
536239d272 Merge branch 'feature' into issue_8233 2022-06-17 16:31:13 +02:00
da1aabdfc1 Changelog for #8894, #8998, #9122; PEP8 fix 2022-05-04 14:19:09 -04:00
0a9ba3b2e6 add get_display to users serializer 2022-05-03 10:45:08 +00:00
535606a185 Update netbox/users/api/nested_serializers.py
Co-authored-by: Jeremy Stretch <jstretch@ns1.com>
2022-05-03 09:01:06 +01:00
25c266e4de Update netbox/users/api/nested_serializers.py
Co-authored-by: Jeremy Stretch <jstretch@ns1.com>
2022-05-03 09:00:52 +01:00
2587720298 Fix 8878: Restrict API key usage by Source IP 2022-04-19 14:44:35 +02:00
bc2491e6b7 Closes #8894: Add first and last name to APISelect widget if set 2022-04-15 21:50:24 +00:00
59aba52b03 Rename OrderedDefaultRouter to NetBoxRouter & document for plugins 2022-03-11 15:59:03 -05:00
efd5a73a18 Refactor API views 2022-03-09 11:27:42 -05:00
4c4fe80697 Fix schema generation for tokens endpoint 2021-06-14 08:52:22 -04:00
b038b1f613 Add a REST API endpoint to provision new tokens using username & password 2021-06-11 15:54:31 -04:00
48b4bf1683 Initial work on REST API endpoint for tokens 2021-06-11 15:14:19 -04:00
1024782b9e Rename FilterSet modules 2021-04-29 16:48:24 -04:00
fb48c1f6dd Add 'display' field to all REST API serializers 2021-03-16 10:06:25 -04:00
915cf3e715 Merge branch 'develop' into develop-2.10 2020-12-01 11:42:55 -05:00
77bbe5730b Fixes #5383: Fix setting user password via REST API 2020-11-25 11:47:53 -05:00
a43361170c Fix overwriting of existing preferences 2020-10-29 14:15:38 -04:00