awx/awx/sso/models.py
2021-04-30 14:32:05 -04:00

20 lines
612 B
Python

# Copyright (c) 2015 Ansible, Inc.
# All Rights Reserved.
# Django
from django.db import models
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
class UserEnterpriseAuth(models.Model):
"""Enterprise Auth association model"""
PROVIDER_CHOICES = (('radius', _('RADIUS')), ('tacacs+', _('TACACS+')), ('saml', _('SAML')))
class Meta:
unique_together = ('user', 'provider')
user = models.ForeignKey(User, related_name='enterprise_auth', on_delete=models.CASCADE)
provider = models.CharField(max_length=32, choices=PROVIDER_CHOICES)