SSHKey and friends.


CASCADE(collector, field, sub_objs, using)
escape(s[, quote]) Replace special characters “&”, “<” and “>” to HTML-safe sequences.
get_html_display_for_key(key, size) Return a compact HTML representation of this key with a boundary on the size of the resulting string.
mark_safe(s) Explicitly mark a string as safe for (HTML) output purposes.
normalise_openssh_public_key(keytext) Validate and normalise an OpenSSH public key.
validate_ssh_public_key(value) Validate that the given value contains a valid SSH public key.


CleanSave Mixin for model classes.
DefaultMeta Base class for model Meta classes in the maasserver app.
ForeignKey(to[, to_field, rel_class, ...])
SSHKey(*args, **kwargs) An SSHKey represents a user public SSH key.
SSHKeyManager() A utility to manage the colletion of `SSHKey`s.
TextField([verbose_name, name, primary_key, ...])
TimestampedModel(*args, **kwargs) Abstract base model with creation/update timestamps.
User(*args, **kwargs) Users within the Django authentication system are represented by this model.


ValidationError(message[, code, params]) An error while validating data.
class maasserver.models.sshkey.SSHKey(*args, **kwargs)[source]

Bases: maasserver.models.cleansave.CleanSave, maasserver.models.timestampedmodel.TimestampedModel

An SSHKey represents a user public SSH key.

Users will be able to access allocated nodes using any of their registered keys.

  • user – The user which owns the key.
  • key – The SSH public key.

Return a compact HTML representation of this key.

Returns:The HTML representation of this key.
Return type:unicode