-
Notifications
You must be signed in to change notification settings - Fork 165
Add default content guard auto-assignment for distributions within a domain #7992
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
Changes from all commits
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 |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Added a `default_content_guard` field to domains that is automatically assigned to new distributions created within the domain when they do not specify their own content-guard. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| import django.db.models.deletion | ||
| from django.db import migrations, models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
| dependencies = [ | ||
| ("core", "0157_distribution_base_path_constraint"), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.AddField( | ||
| model_name="domain", | ||
| name="default_content_guard", | ||
| field=models.ForeignKey( | ||
| null=True, | ||
| on_delete=django.db.models.deletion.SET_NULL, | ||
| related_name="+", | ||
| to="core.contentguard", | ||
| ), | ||
| ), | ||
| ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,6 +32,10 @@ class Domain(BaseModel, AutoAddObjPermsMixin): | |
| storage_settings (EncryptedJSONField): Settings needed to configure storage backend | ||
| redirect_to_object_storage (models.BooleanField): Redirect to object storage in content app | ||
| hide_guarded_distributions (models.BooleanField): Hide guarded distributions in content app | ||
|
|
||
| Relations: | ||
| default_content_guard (models.ForeignKey): An optional content-guard automatically | ||
| assigned to new distributions created within this domain. | ||
| """ | ||
|
|
||
| name = models.SlugField(null=False, unique=True) | ||
|
|
@@ -43,6 +47,10 @@ class Domain(BaseModel, AutoAddObjPermsMixin): | |
| # Pulp settings that are appropriate to be set on a "per domain" level | ||
| redirect_to_object_storage = models.BooleanField(default=True) | ||
| hide_guarded_distributions = models.BooleanField(default=False) | ||
| # related_name="+" suppresses the reverse accessor; use ContentGuard.pulp_domain to traverse. | ||
| default_content_guard = models.ForeignKey( | ||
| "ContentGuard", null=True, on_delete=models.SET_NULL, related_name="+" | ||
|
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. What is
Member
Author
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.
|
||
| ) | ||
|
|
||
| def get_storage(self): | ||
| """Returns this domain's instantiated storage class.""" | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.