+
+
+class ProxyGrantingTicket(BaseTicket):
+ user = models.ForeignKey(settings.AUTH_USER_MODEL, verbose_name=_('user'), on_delete=models.CASCADE)
+ service = models.URLField(_('service'), null=True)
+ pgt = models.ForeignKey('self', null=True, on_delete=models.CASCADE)
+ pgtiou = models.CharField(max_length=256, verbose_name=_('PGTiou'))
+ prefix = 'PGT'
+
+ def __init__(self, *args, **kwargs):
+ super(ProxyGrantingTicket, self).__init__(*args, **kwargs)
+ if not self.pgtiou:
+ self.pgtiou = "PGTIOU-%s" % (''.join(Random().sample(string.ascii_letters + string.digits, 50)))
+
+ 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'), on_delete=models.CASCADE)
+
+ 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'), on_delete=models.CASCADE)
+
+ prefix = 'PGTIOU'
+
+ class Meta:
+ verbose_name = _('Proxy Granting Ticket IOU')
+ verbose_name_plural = _('Proxy Granting Tickets IOU')
+