+
+
+class ProxyGrantingTicket(BaseTicket):
+ user = models.ForeignKey(settings.AUTH_USER_MODEL, verbose_name=_('user'))
+ service = models.URLField(_('service'), null=True)
+ pgt = models.ForeignKey('self', null=True)
+ pgtiou = models.CharField(max_length=256, verbose_name=_('PGTiou'))
+ prefix = 'PGT'
+
+ def __init__(self, *args, **kwargs):
+ if 'pgtiou' not in kwargs:
+ kwargs['pgtiou'] = "PGTIOU-%s" % (''.join(Random().sample(string.ascii_letters + string.digits, 50)))
+ super(ProxyGrantingTicket, self).__init__(*args, **kwargs)
+
+ class Meta:
+ verbose_name = _('Proxy Granting Ticket')
+ verbose_name_plural = _('Proxy Granting Tickets')
+
+
+class ProxyTicket(ServiceTicket):
+ proxyGrantingTicket = models.ForeignKey(ProxyGrantingTicket, verbose_name=_('Proxy Granting Ticket'))
+
+ prefix = 'PT'
+
+ class Meta:
+ verbose_name = _('Proxy Ticket')
+ verbose_name_plural = _('Proxy Tickets')
+
+
+class ProxyGrantingTicketIOU(BaseTicket):
+ proxyGrantingTicket = models.ForeignKey(ProxyGrantingTicket, verbose_name=_('Proxy Granting Ticket'))
+
+ prefix = 'PGTIOU'
+
+ class Meta:
+ verbose_name = _('Proxy Granting Ticket IOU')
+ verbose_name_plural = _('Proxy Granting Tickets IOU')
+