-
-
Notifications
You must be signed in to change notification settings - Fork 303
[change] Limit controller operations on disabled organizations #1393 #1456
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
base: master
Are you sure you want to change the base?
Changes from all commits
169aea0
e7bfea8
9ec467f
f18f44c
f0c84b4
b202f12
c06d9d7
74fdb90
be61484
a6e0c46
5d20c0f
00fb369
7041e27
b5d7f46
f78039a
dface4c
b59418a
220733c
3adef55
9705981
5a1e7fe
29095f4
be92eec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -252,6 +252,8 @@ def save(self, *args, **kwargs): | |
| """ | ||
| Calls _auto_create_cert() if cert is not set. | ||
| """ | ||
| if self.organization_id and not self.organization.is_active: | ||
| return super().save(*args, **kwargs) | ||
| config = {} | ||
| created = self._state.adding | ||
| if not created: | ||
|
|
@@ -958,6 +960,8 @@ def _get_unique_checks(self, exclude=None, include_meta_constraints=False): | |
|
|
||
| def save(self, *args, **kwargs): | ||
| """Performs automatic provisioning if ``auto_cert`` is True.""" | ||
| if not self.config.device.organization.is_active: | ||
| return super().save(*args, **kwargs) | ||
|
Comment on lines
+963
to
+964
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Block the ZeroTier post-save write for inactive organizations. Line 964 still emits Keep peer-cache invalidation. Skip the ZeroTier member update when Proposed fix def post_save(cls, instance, **kwargs):
def _post_save():
instance.vpn._invalidate_peer_cache()
transaction.on_commit(_post_save)
+ if not instance.config.device.organization.is_active:
+ return
# ZT network member should be authorized and assigned
# an IP after the creation of the VPN client object🤖 Prompt for AI Agents |
||
| if self.auto_cert: | ||
| self._auto_x509() | ||
| self._auto_ip() | ||
|
|
@@ -970,7 +974,11 @@ def _auto_x509(self): | |
| """ | ||
| Automatically creates an x509 certificate. | ||
| """ | ||
| if not self.vpn._is_backend_type("openvpn") or self.cert: | ||
| if ( | ||
| not self.vpn._is_backend_type("openvpn") | ||
| or self.cert | ||
| or not self.config.device.organization.is_active | ||
| ): | ||
| return | ||
| cn = self._get_common_name() | ||
| self._auto_create_cert(name=self.config.device.name, common_name=cn) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This dependency now adds
password_based_tokento the swapped sample user model, but the corresponding sample migration was not updated../run-qa-checksfails in every matrix job with an unmigratedsample_users.User.password_based_tokenfield. Please update the existing sample-app migration, as required for these disposable sample apps, so the migration check passes.