* feat: DraftAliasGenerator class Encapsulates logic from generate_draft_aliases.py * refactor: Avoid circular imports * feat: Add draft_aliases API endpoint * feat: Add @requires_api_token decorator Stolen from feat/rpc-api * feat: Add token auth to draft_aliases endpoint * feat: draft-aliases-from-json.py script Parses output from the draft_aliases API call * chore: Remove unused cruft * refactor: Avoid shadowing "draft" name * fix: Suppress empty lists from DraftAliasGenerator * refactor: Use a GET instead of POST * feat: GroupAliasGenerator class * feat: group aliases API view * fix: Handle domains array correctly * fix: Suppress empty group aliases * refactor: Generalize aliases-from-json.py script * refactor: Same output fmt for draft and group alias apis * feat: Sort addresses for stability * fix: Add "anything" virtual alias * test: Test requires_api_token decorator * feat: Harden is_valid_token against misconfig * test: Test is_valid_token * test: Test draft_aliases view * test: Test group_aliases view * test: Test DraftAliasGenerator * fix: ise group is type "ise" in test data * test: Fix logic in testManagementCommand The test was incorrect - and fails when fixed. :-( * test: Test GroupAliasGenerator Test currently fails * fix: Suppress empty -ads alias * test: Fix group acronym copy/paste error I *think* this must be what had been intended. The code does not look like it ever dealt with GroupHistory, so I'm pretty sure it wasn't meant to have the same acronym used by two different Groups at different times. * test: Check draft .notify alias generation * test: Cover get_draft_notify_emails()
75 lines
3.4 KiB
Python
75 lines
3.4 KiB
Python
# Copyright The IETF Trust 2017, All Rights Reserved
|
|
|
|
from django.conf import settings
|
|
from django.urls import include
|
|
from django.views.generic import TemplateView
|
|
|
|
from ietf import api
|
|
from ietf.api import views as api_views
|
|
from ietf.doc import views_ballot
|
|
from ietf.meeting import views as meeting_views
|
|
from ietf.submit import views as submit_views
|
|
from ietf.utils.urls import url
|
|
|
|
api.autodiscover()
|
|
|
|
urlpatterns = [
|
|
# General API help page
|
|
url(r'^$', api_views.api_help),
|
|
# Top endpoint for Tastypie's REST API (this isn't standard Tastypie):
|
|
url(r'^v1/?$', api_views.top_level),
|
|
# For mailarchive use, requires secretariat role
|
|
url(r'^v2/person/person', api_views.ApiV2PersonExportView.as_view()),
|
|
#
|
|
# --- Custom API endpoints, sorted alphabetically ---
|
|
# Email alias information for drafts
|
|
url(r'^doc/draft-aliases/$', api_views.draft_aliases),
|
|
# GPRD: export of personal information for the logged-in person
|
|
url(r'^export/personal-information/$', api_views.PersonalInformationExportView.as_view()),
|
|
# Email alias information for groups
|
|
url(r'^group/group-aliases/$', api_views.group_aliases),
|
|
# Let IESG members set positions programmatically
|
|
url(r'^iesg/position', views_ballot.api_set_position),
|
|
# Let Meetecho set session video URLs
|
|
url(r'^meeting/session/video/url$', meeting_views.api_set_session_video_url),
|
|
# Meeting agenda + floorplan data
|
|
url(r'^meeting/(?P<num>[A-Za-z0-9._+-]+)/agenda-data$', meeting_views.api_get_agenda_data),
|
|
# Meeting session materials
|
|
url(r'^meeting/session/(?P<session_id>[A-Za-z0-9._+-]+)/materials$', meeting_views.api_get_session_materials),
|
|
# Let MeetEcho upload bluesheets
|
|
url(r'^notify/meeting/bluesheet/?$', meeting_views.api_upload_bluesheet),
|
|
# Let MeetEcho tell us about session attendees
|
|
url(r'^notify/session/attendees/?$', meeting_views.api_add_session_attendees),
|
|
# Let MeetEcho upload session chatlog
|
|
url(r'^notify/session/chatlog/?$', meeting_views.api_upload_chatlog),
|
|
# Let MeetEcho upload session polls
|
|
url(r'^notify/session/polls/?$', meeting_views.api_upload_polls),
|
|
# Let the registration system notify us about registrations
|
|
url(r'^notify/meeting/registration/?', api_views.api_new_meeting_registration),
|
|
# OpenID authentication provider
|
|
url(r'^openid/$', TemplateView.as_view(template_name='api/openid-issuer.html'), name='ietf.api.urls.oidc_issuer'),
|
|
url(r'^openid/', include('oidc_provider.urls', namespace='oidc_provider')),
|
|
# Draft submission API
|
|
url(r'^submit/?$', submit_views.api_submit),
|
|
# Draft upload API
|
|
url(r'^submission/?$', submit_views.api_submission),
|
|
# Draft submission state API
|
|
url(r'^submission/(?P<submission_id>[0-9]+)/status/?', submit_views.api_submission_status),
|
|
# Datatracker version
|
|
url(r'^version/?$', api_views.version),
|
|
# Application authentication API key
|
|
url(r'^appauth/[authortools|bibxml]', api_views.app_auth),
|
|
# latest versions
|
|
url(r'^rfcdiff-latest-json/%(name)s(?:-%(rev)s)?(\.txt|\.html)?/?$' % settings.URL_REGEXPS, api_views.rfcdiff_latest_json),
|
|
url(r'^rfcdiff-latest-json/(?P<name>[Rr][Ff][Cc] [0-9]+?)(\.txt|\.html)?/?$', api_views.rfcdiff_latest_json),
|
|
# direct authentication
|
|
url(r'^directauth/?$', api_views.directauth),
|
|
]
|
|
|
|
# Additional (standard) Tastypie endpoints
|
|
for n,a in api._api_list:
|
|
urlpatterns += [
|
|
url(r'^v1/', include(a.urls)),
|
|
]
|
|
|