Introduce sso UserEnterpriseAuth model.

This commit is contained in:
Aaron Tan
2017-05-18 15:38:32 -04:00
parent 8cf8e6c0c0
commit d314f83416
10 changed files with 139 additions and 70 deletions

View File

@@ -1,2 +1,26 @@
# 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):
"""Tower Enterprise Auth association model"""
PROVIDER_CHOICES = (
('radius', _('RADIUS')),
('tacacs+', _('TACACS+')),
)
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
)