Other user aliases view.
[cas.git] / src / services / views.py
1 from django.views.generic import DetailView
2 from .models import Service
3
4
5 class SshAuthorizedKeysView(DetailView):
6     model = Service
7     template_name = 'services/ssh_authorized_keys.txt'
8     content_type = 'text/plain'
9
10     def get_object(self):
11         obj = super().get_object()
12         if self.request.GET.get('key') != obj.key:
13             obj = None
14         return obj
15