scram.route_manager package¶
Subpackages¶
- scram.route_manager.api package
- scram.route_manager.migrations package
- Submodules
- scram.route_manager.migrations.0001_initial module
- scram.route_manager.migrations.0002_ipaddress_uuid module
- scram.route_manager.migrations.0003_auto_20210408_0413 module
- scram.route_manager.migrations.0004_actiontype module
- scram.route_manager.migrations.0005_entry module
- scram.route_manager.migrations.0006_history module
- scram.route_manager.migrations.0007_history_expiration module
- scram.route_manager.migrations.0008_default_block_actiontype module
- scram.route_manager.migrations.0009_expiration_to_datetime module
- scram.route_manager.migrations.0010_actiontype_helptext module
- scram.route_manager.migrations.0011_history_helptext module
- scram.route_manager.migrations.0012_unique_entries module
- scram.route_manager.migrations.0013_accept_cidrs module
- scram.route_manager.migrations.0014_create_groups module
- scram.route_manager.migrations.0015_entry_is_active module
- scram.route_manager.migrations.0016_auto_20211202_1933 module
- scram.route_manager.migrations.0017_ignorelist module
- scram.route_manager.migrations.0018_auto_20220702_0203 module
- scram.route_manager.migrations.0019_auto_20220708_1945 module
- scram.route_manager.migrations.0020_historicalactiontype_historicalentry_historicalignoreentry module
- scram.route_manager.migrations.0021_auto_20220929_2047 module
- scram.route_manager.migrations.0022_auto_20230117_1930 module
- scram.route_manager.migrations.0023_client module
- scram.route_manager.migrations.0024_alter_client_is_authorized module
- scram.route_manager.migrations.0025_rename_uuid_client_uuid module
- scram.route_manager.migrations.0026_alter_client_hostname module
- scram.route_manager.migrations.0027_websocketmessage_websocketsequenceelement module
- scram.route_manager.migrations.0028_default_websocket_messages module
- scram.route_manager.migrations.0029_alter_websocketmessage_msg_data_route_field module
- Module contents
- scram.route_manager.tests package
- Submodules
- scram.route_manager.tests.functional_tests module
- scram.route_manager.tests.test_api module
- scram.route_manager.tests.test_authorization module
- scram.route_manager.tests.test_history module
- scram.route_manager.tests.test_views module
- scram.route_manager.tests.test_websockets module
- Module contents
Submodules¶
scram.route_manager.admin module¶
scram.route_manager.apps module¶
scram.route_manager.authentication_backends module¶
- class scram.route_manager.authentication_backends.ESnetAuthBackend(*args, **kwargs)¶
Bases:
OIDCAuthenticationBackend
- create_user(claims)¶
Return object for a newly created user account.
- update_groups(user, claims)¶
Sets the users group(s) to whatever is in the claims.
- update_user(user, claims)¶
Update existing user with new claims, if necessary save, and return user
scram.route_manager.context_processors module¶
- scram.route_manager.context_processors.login_logout(request)¶
scram.route_manager.models module¶
- class scram.route_manager.models.ActionType(*args, **kwargs)¶
Bases:
Model
Defines an action that can be done with a given route. e.g. Block, shunt, redirect, etc.
- exception DoesNotExist¶
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
- available¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- client_set¶
Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- entry_set¶
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- history = <django.db.models.manager.HistoryManagerFromHistoricalQuerySet object>¶
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- name¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects = <django.db.models.manager.Manager object>¶
- save_without_historical_record(*args, **kwargs)¶
Save model without saving a historical record
Make sure you know what you’re doing before you use this method.
- websocketsequenceelement_set¶
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- class scram.route_manager.models.Client(*args, **kwargs)¶
Bases:
Model
Any client that would like to hit the API to add entries (e.g. Zeek)
- exception DoesNotExist¶
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
- authorized_actiontypes¶
Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- hostname¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- is_authorized¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects = <django.db.models.manager.Manager object>¶
- uuid¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- class scram.route_manager.models.Entry(*args, **kwargs)¶
Bases:
Model
An instance of an action taken on a route.
- exception DoesNotExist¶
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
- actiontype¶
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- actiontype_id¶
- comment¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- delete(*args, **kwargs)¶
- expiration¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- expiration_reason¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- get_change_reason()¶
- get_next_by_expiration(*, field=<django.db.models.fields.DateTimeField: expiration>, is_next=True, **kwargs)¶
- get_next_by_when(*, field=<django.db.models.fields.DateTimeField: when>, is_next=True, **kwargs)¶
- get_previous_by_expiration(*, field=<django.db.models.fields.DateTimeField: expiration>, is_next=False, **kwargs)¶
- get_previous_by_when(*, field=<django.db.models.fields.DateTimeField: when>, is_next=False, **kwargs)¶
- history = <django.db.models.manager.HistoryManagerFromHistoricalQuerySet object>¶
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- is_active¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects = <django.db.models.manager.Manager object>¶
- route¶
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- route_id¶
- save_without_historical_record(*args, **kwargs)¶
Save model without saving a historical record
Make sure you know what you’re doing before you use this method.
- when¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- who¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- class scram.route_manager.models.IgnoreEntry(*args, **kwargs)¶
Bases:
Model
For cidrs you NEVER want to block ie don’t shoot yourself in the foot list
- exception DoesNotExist¶
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
- comment¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- history = <django.db.models.manager.HistoryManagerFromHistoricalQuerySet object>¶
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects = <django.db.models.manager.Manager object>¶
- route¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- save_without_historical_record(*args, **kwargs)¶
Save model without saving a historical record
Make sure you know what you’re doing before you use this method.
- class scram.route_manager.models.Route(*args, **kwargs)¶
Bases:
Model
Model describing a route
- exception DoesNotExist¶
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
- entry_set¶
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- get_absolute_url()¶
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects = <django.db.models.manager.Manager object>¶
- route¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- uuid¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- class scram.route_manager.models.WebSocketMessage(*args, **kwargs)¶
Bases:
Model
Defines a single message sent to downstream translators via WebSocket.
- exception DoesNotExist¶
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- msg_data¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- msg_data_route_field¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- msg_type¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects = <django.db.models.manager.Manager object>¶
- websocketsequenceelement_set¶
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- class scram.route_manager.models.WebSocketSequenceElement(*args, **kwargs)¶
Bases:
Model
In a sequence of messages, defines a single element.
- exception DoesNotExist¶
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
- VERB_CHOICES = [('A', 'Add'), ('C', 'Check'), ('R', 'Remove')]¶
- action_type¶
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- action_type_id¶
- get_verb_display(*, field=<django.db.models.fields.CharField: verb>)¶
- id¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- objects = <django.db.models.manager.Manager object>¶
- order_num¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- verb¶
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- websocketmessage¶
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- websocketmessage_id¶
scram.route_manager.urls module¶
scram.route_manager.views module¶
- class scram.route_manager.views.EntryDetailView(**kwargs)¶
Bases:
PermissionRequiredMixin
,DetailView
- permission_required = ['route_manager.view_entry']¶
- template_name = 'route_manager/entry_detail.html'¶
- class scram.route_manager.views.EntryListView(**kwargs)¶
Bases:
ListView
- get_context_data(**kwargs)¶
Get the context for this view.
- template_name = 'route_manager/entry_list.html'¶
- scram.route_manager.views.add_entry(request)¶
- scram.route_manager.views.delete_entry(request, pk)¶
- scram.route_manager.views.home_page()¶
- scram.route_manager.views.process_expired(request)¶
- scram.route_manager.views.search_entries(request)¶