Commit Graph

15573 Commits

Author SHA1 Message Date
Martin Hauser d7de863681
Closes #17598: Add bulk creation for VLANs (#22377) 2026-06-15 08:22:58 -05:00
Jeremy Stretch 8afbfc42d5
Fixes #22346: Return a clean error message & redirect on SSO auth failure (#22420) 2026-06-15 07:51:06 -05:00
github-actions c889e58bee Update source translation strings 2026-06-15 06:46:14 +00:00
Fabi bf1a27b89c
Fixes #22397: Fix AttributeError exception for unauthentictaed users during bulk export 2026-06-14 10:34:51 -04:00
github-actions 850aae2d35 Update source translation strings 2026-06-14 06:31:05 +00:00
Jeremy Stretch 8ff56032b9
Fixes #22444: Fix KeyError exception on device view with non-English locale (#22445) 2026-06-14 02:10:29 +02:00
Tobias Genannt b4fdd6f209 Closes #22333: Use lowercase username for testing
The test failures arises from unstable sorting of the usernames
depending on the collation used in the PostgreSQL database used for
testing. When a case-insensitive collation is used 'testuser' is sorted
before 'User*' and because this user has permissions assigned and
additional query is issued resulting in 12 queries. When a
case-sensitive collation is used the sorting is inverted. Because the
'User*' don't have permissions only 11 queries are sent to the database.

Using only testusers with lowercase names enforces stable sorting
across collations.
2026-06-13 19:42:21 -04:00
Martin Hauser 8f974e3cc8 perf(ipam): Optimize Prefix availability calculations
Replace IPSet-heavy Prefix availability and utilization logic with
indexed host lookups, distinct host counts, and interval-based
availability calculation.

This adds mask-insensitive host-bound filtering for IP addresses and
ranges, moves availability/counting behavior onto QuerySet and model
methods, and uses merged occupied intervals to find available addresses
without materializing large address sets in Python.

Prefix utilization remains on a cheap utilization-only path for list
views, while Prefix detail views can use a shared usage summary when
both utilization and available IP count are needed. Usable IP bounds now
live on the Prefix model, since the logic depends on Prefix-specific
state such as is_pool.

This also adds host expression indexes for IP Ranges, fixes zero-address
preparation, fixes child IP matching across differing mask lengths,
keeps Prefix hierarchy rebuilding scoped to the existing VRF/global API,
and preserves IPRange.first_available_ip as a cached compatibility
wrapper.

Fixes #21870
2026-06-13 18:02:51 -04:00
bctiemann bc7ed0e9bb
Merge pull request #22434 from netbox-community/22303-openapi-fields-omit
Fixes #22303: Annotate fields & omit parameters in OpenAPI schema
2026-06-12 08:38:34 -04:00
github-actions acef3ac112 Update source translation strings 2026-06-12 06:31:01 +00:00
bctiemann d1919627ce
Closes #22429: Enforce ObjectPermission constraints on grant_token (#22424) 2026-06-11 13:30:27 -07:00
github-actions 65454d30db Update source translation strings 2026-06-11 06:32:06 +00:00
Jeremy Stretch d59f5f4381 Fixes #22303: Annotate fields & omit parameters in OpenAPI schema 2026-06-10 13:55:29 -04:00
Brian Tiemann 97a1375a82 Security: replace random.choice with secrets.choice in Token.generate()
Token.generate() used Python's random module (Mersenne Twister PRNG).
Mersenne Twister is not a CSPRNG: observing ~624 outputs from the same
worker process allows full state recovery and prediction of subsequent
outputs. Any token minted in the same worker within that window becomes
predictable, including tokens for privileged accounts.

Fix: replace random.choice with secrets.choice. secrets is backed by
os.urandom() / getrandom() which provides OS-level CSPRNG entropy and
is immune to state-recovery attacks.

The import of the now-unused random module is removed.

Regression tests:
- test_generate_uses_csprng: patches secrets.choice with wraps= to
  confirm it is called exactly TOKEN_DEFAULT_LENGTH times per generate().
- test_generate_length_parameter: verifies length= is respected and
  output is drawn only from TOKEN_CHARSET.

Ref: SR-001 / VM-317 (internal security review, R1-F07 / R3-F1)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 13:16:12 -04:00
Jeremy Stretch c63e3a8b80
Fixes #22421: GraphQLTestCase should support relative imports (#22422) 2026-06-10 09:48:35 -07:00
mburggraf b4116f2532
Fixes #22273: Fix migration failure when a service has thousands of ports defined 2026-06-10 12:27:50 -04:00
github-actions 34f2ca6f84 Update source translation strings 2026-06-10 06:35:05 +00:00
mburggraf f732a8e878
Fixes #22376: Remove files from request for script action event rules 2026-06-09 13:55:20 -04:00
github-actions c81bd39f7d Update source translation strings 2026-06-09 06:21:09 +00:00
Jeremy Stretch 70391e5a0b
Closes #22392: Deprecate support for Redis 5.x (#22405) 2026-06-08 09:28:31 -07:00
Jeremy Stretch 87c53aaaeb
Fixes #22399: Enforce object permissions for relevant static media (#22400) 2026-06-08 16:05:39 +02:00
bctiemann 6121418f5a
Merge pull request #22391 from netbox-community/22349-minimum-redis-version
Closes #22349: Correct documentation to reflect minimum Redis version of 5.0
2026-06-08 08:40:21 -04:00
github-actions 22d0b22fc9 Update source translation strings 2026-06-05 06:29:27 +00:00
bctiemann f4d95e6e9d
Merge pull request #22384 from netbox-community/15569-add-better-tests-for-graphql-filtering-and-lookup
Closes #15569: Auto-generate GraphQL filter tests for API test cases
2026-06-04 19:17:17 -04:00
Martin Hauser 86ea67d640 fix(extras): Prevent direct access to TableConfig create view
Add GET handler to TableConfigEditView that redirects users to home with
a warning if they attempt to access the create form directly without
required object_type and table parameters from a source list view.

Fixes #22237
2026-06-04 15:58:58 -04:00
Alex Houlton b905e99e63
Closes #22375: Fix VLAN filter_interface_id performance: use UNION instead of OR across M2M joins (#22387) 2026-06-04 15:50:39 -04:00
Jeremy Stretch d592afe56c Closes #22349: Correct documentation to reflect minimum Redis version of 5.0 2026-06-04 14:57:03 -04:00
Jeremy Stretch 553b97464a
Fixes #22388: Pin redis-py to <8.0 (#22389) 2026-06-04 20:55:18 +02:00
Martin Hauser cdde9e98fa
test(api): Add GraphQL nested filter and auto-filter tests
Introduce declarative GraphQL filter test framework with
`GraphQLFilterTest` and `GraphQLQueryTest` dataclasses. Implement
auto-filter discovery from filter class annotations with per-field-kind
test generators for string, numeric, date, range, and array lookups.

Fixes #15569
2026-06-04 17:45:06 +02:00
github-actions d4d931dd4f Update source translation strings 2026-06-04 06:31:28 +00:00
Martin Hauser 2e50fc3d97
fix(extras): Add choice_value lookup for ChoiceSetField (#22366)
Introduce ChoiceSetField as ArrayField subclass for custom field
choices and implement choice_value lookup to filter by value element
only. Update GraphQL filter to use ExtraChoicesLookup with contains and
length options.

Fixes #22324
2026-06-03 11:06:18 -07:00
Martin Hauser 902aa495dd
Closes #18663: Replace assertions with proper error handling (#22344) 2026-06-03 06:24:10 -05:00
Jeremy Stretch d9a58e6376
Fixes #22357: Remove unused `local_context_data` field from dcim.Module (#22364) 2026-06-03 06:19:46 -05:00
Martin Hauser 62837089b4
Fixes #21895: Fix missing pagination controls for Job Log entries (#22252) 2026-06-03 06:14:38 -05:00
mburggraf 583ab535e8
Fixes #22358: Remove broken and unused function get_0u_devices (#22368) 2026-06-03 13:08:21 +02:00
github-actions 120700688c Update source translation strings 2026-06-03 06:34:32 +00:00
bctiemann c1d69ebae6
Merge pull request #22275 from jniec-js/main
Closes: #22245: Fix OpenAPI request schemas for bulk update endpoints
2026-06-02 21:19:42 -04:00
Josh Niec c3d8b14a3d fix: address pr comments 2026-06-02 19:51:42 -04:00
Josh Niec 56ac8030b8 fix: address pr comments 2026-06-02 19:48:37 -04:00
Josh Niec c264b42abc fix: avoid problem when fields is set to '__all__' 2026-06-02 18:37:24 -04:00
Josh Niec 1597f1bd7d fix: linting 2026-06-02 18:30:10 -04:00
Josh Niec 208dd9b05b fix: address pr comments 2026-06-02 18:28:45 -04:00
Martin Hauser 5561deb1e4 fix(dcim): Refresh cable path for endpoints loaded before tracing
Repair stale `_path` references when an endpoint instance is cabled but
has no path set, as occurs during cable creation before path tracing.
The `path` accessor now refreshes the denormalized FK from the database
in this case, ensuring event payloads include connected endpoints.

Fixes #21338
2026-06-02 16:41:53 -04:00
Martin Hauser 3172e47904
Fixes #22210: Respect filters when rendering IPAM child availability views (#22327)
* fix(ipam): Honor filters for child availability views

Retain the instantiated child FilterSet on ObjectChildrenView and expose
whether child object filters are active. Use this in IPAM child views to
avoid rendering synthetic availability rows when the child queryset has
been filtered.

This ensures Saved Filters and direct filters are respected on
Prefix IP Address, Child Prefix, Aggregate Prefix,
and VLAN Group VLAN tabs.

Fixes #22210

* refactor(ipam): Replace has_active_filters with ChildAvailabilityMixin

Extracts filter detection logic from ObjectChildrenView into a dedicated
ChildAvailabilityMixin. Compares WHERE clause signatures between
filtered and unfiltered querysets instead of inspecting filter
parameters, improving reliability when child querysets are pre-scoped
to parent objects.
2026-06-02 16:30:17 -04:00
bctiemann b1ebd93349
Merge pull request #22365 from netbox-community/22340-token-allowed_ips-list
Fixes #22340: Correct display of allowed IPs for tokens in web UI
2026-06-02 14:21:27 -04:00
Jeremy Stretch 5b08541242 Fixes #22340: Correct display of allowed IPs for tokens in web UI 2026-06-02 12:39:05 -04:00
Jeremy Stretch 839259ccec
Closes #22361: Introduce ArrayAttr UI panel attribute (#22362) 2026-06-02 18:17:02 +02:00
Maksym-Ototiuk fc17d468aa Closes #21666: Add MU fiber connector type 2026-06-02 12:01:26 -04:00
bctiemann 35450a6cb8
Fixes #22251: Re-parent child ModuleBays when a Module is moved to a new bay (#22336) 2026-06-02 08:25:56 -07:00
Jeremy Stretch b55b50b12e
CAP-122: Add GitHub workflow to close new issues missing labels (#22356) 2026-06-02 16:43:52 +02:00